Table of Contents

Class ResourceMetricsExporter

Namespace
Typhon.Engine
Assembly
Typhon.Engine.dll

Exports Typhon resource metrics to OpenTelemetry via Meter.

public sealed class ResourceMetricsExporter : IDisposable
Inheritance
ResourceMetricsExporter
Implements
Inherited Members

Remarks

The exporter uses the "observable" pattern: OTel callbacks read from a cached snapshot rather than pushing metrics. This design has zero overhead when no OTel consumer is listening.

Usage pattern:

  1. Create exporter with IResourceGraph and options
  2. Periodically call UpdateSnapshot() (via ResourceMetricsService)
  3. OTel exporters (Prometheus, OTLP) automatically read from callbacks
var exporter = new ResourceMetricsExporter(resourceGraph, options);

// Periodic update
exporter.UpdateSnapshot();

// OTel callbacks automatically return latest values

Constructors

ResourceMetricsExporter(IResourceGraph, ObservabilityBridgeOptions)

Creates a new ResourceMetricsExporter.

public ResourceMetricsExporter(IResourceGraph resourceGraph, ObservabilityBridgeOptions options)

Parameters

resourceGraph IResourceGraph

The resource graph to export metrics from.

options ObservabilityBridgeOptions

Configuration options.

Fields

MeterName

The Meter name used for all Typhon resource metrics.

public const string MeterName = "Typhon.Resources"

Field Value

string

MeterVersion

The Meter version.

public const string MeterVersion = "1.0.0"

Field Value

string

Properties

CurrentSnapshot

The most recent snapshot. Used by health checks and alert generators.

public ResourceSnapshot CurrentSnapshot { get; }

Property Value

ResourceSnapshot

Meter

The OTel Meter used by this exporter.

public Meter Meter { get; }

Property Value

Meter

Methods

Dispose()

Disposes the meter and all instruments.

public void Dispose()

UpdateSnapshot()

Update the cached snapshot from the resource graph. Called periodically by ResourceMetricsService.

public ResourceSnapshot UpdateSnapshot()

Returns

ResourceSnapshot

The new snapshot.