Options
All
  • Public
  • Public/Protected
  • All
Menu

Module @opentelemetry/sdk-metrics

Index

Type Aliases

AggregationSelector: ((instrumentType: InstrumentType) => Aggregation)

Type declaration

AggregationTemporalitySelector: ((instrumentType: InstrumentType) => AggregationTemporality)

Type declaration

InstrumentDescriptor: MetricDescriptor
deprecated

Use MetricDescriptor instead.

LastValue: number

DataPoint value type for LastValueAggregation.

Represents an aggregated metric data.

PeriodicExportingMetricReaderOptions: { exportIntervalMillis?: number; exportTimeoutMillis?: number; exporter: PushMetricExporter; metricProducers?: MetricProducer[] }

Type declaration

  • Optional exportIntervalMillis?: number

    An internal milliseconds for the metric reader to initiate metric collection.

  • Optional exportTimeoutMillis?: number

    Milliseconds for the async observable callback to timeout.

  • exporter: PushMetricExporter

    The backing exporter for the metric reader.

  • Optional metricProducers?: MetricProducer[]

    Note, this option is experimental. Additional MetricProducers to use as a source of aggregated metric data in addition to the SDK's metric data. The resource returned by these MetricProducers is ignored; the SDK's resource will be used instead.

    experimental
Sum: number

DataPoint value type for SumAggregation.

ViewOptions: { aggregation?: Aggregation; attributeKeys?: string[]; description?: string; instrumentName?: string; instrumentType?: InstrumentType; instrumentUnit?: string; meterName?: string; meterSchemaUrl?: string; meterVersion?: string; name?: string }

Type declaration

  • Optional aggregation?: Aggregation

    Alters the metric stream: Alters the Aggregation of the metric stream.

    example

    changes the aggregation of the selected instrument(s) to ExplicitBucketHistogramAggregation aggregation: new ExplicitBucketHistogramAggregation([1, 10, 100])

    example

    changes the aggregation of the selected instrument(s) to LastValueAggregation aggregation: new LastValueAggregation()

  • Optional attributeKeys?: string[]

    Alters the metric stream: If provided, the attributes that are not in the list will be ignored. If not provided, all attribute keys will be used by default.

    example

    drops all attributes with top-level keys except for 'myAttr' and 'myOtherAttr' attributeKeys: ['myAttr', 'myOtherAttr']

    example

    drops all attributes attributeKeys: []

  • Optional description?: string

    Alters the metric stream: This will be used as the description of the metrics stream. If not provided, the original Instrument description will be used by default.

    example

    changes the description of all selected instruments to 'sample description' description: 'sample description'

  • Optional instrumentName?: string

    Instrument selection criteria: Original name of the Instrument(s) with wildcard support.

    example

    select all instruments instrumentName: '*'

    example

    select all instruments starting with 'my.instruments.' instrumentName: 'my.instruments.*'

    example

    select all instruments named 'my.instrument.requests' exactly instrumentName: 'my.instruments.requests'

  • Optional instrumentType?: InstrumentType

    Instrument selection criteria: The original type of the Instrument(s).

    example

    selects all counters instrumentType: InstrumentType.COUNTER

    example

    selects all histograms instrumentType: InstrumentType.HISTOGRAM

  • Optional instrumentUnit?: string

    Instrument selection criteria: The unit of the Instrument(s).

    example

    select all instruments with unit 'ms' instrumentUnit: 'ms'

  • Optional meterName?: string

    Instrument selection criteria: The name of the Meter. No wildcard support, name must match the meter exactly.

    example

    select all meters named 'example.component.app' exactly meterName: 'example.component.app'

  • Optional meterSchemaUrl?: string

    Instrument selection criteria: The schema URL of the Meter. No wildcard support, schema URL must match exactly.

    example

    Select all meters with schema URL 'https://example.com/schema' exactly. meterSchemaUrl: 'https://example.com/schema'

  • Optional meterVersion?: string

    Instrument selection criteria: The version of the Meter. No wildcard support, version must match exactly.

    example

    meterVersion: '1.0.1'

  • Optional name?: string

    Alters the metric stream: This will be used as the name of the metrics stream. If not provided, the original Instrument name will be used.

Generated using TypeDoc