package otelconv

import "go.opentelemetry.io/otel/semconv/v1.39.0/otelconv"

Package otelconv provides types and functionality for OpenTelemetry semantic conventions in the "otel" namespace.

Index

Types

type ComponentTypeAttr

type ComponentTypeAttr string

ComponentTypeAttr is an attribute conforming to the otel.component.type semantic conventions. It represents a name identifying the type of the OpenTelemetry component.

var (
	// ComponentTypeBatchingSpanProcessor is the builtin SDK batching span
	// processor.
	ComponentTypeBatchingSpanProcessor ComponentTypeAttr = "batching_span_processor"
	// ComponentTypeSimpleSpanProcessor is the builtin SDK simple span processor.
	ComponentTypeSimpleSpanProcessor ComponentTypeAttr = "simple_span_processor"
	// ComponentTypeBatchingLogProcessor is the builtin SDK batching log record
	// processor.
	ComponentTypeBatchingLogProcessor ComponentTypeAttr = "batching_log_processor"
	// ComponentTypeSimpleLogProcessor is the builtin SDK simple log record
	// processor.
	ComponentTypeSimpleLogProcessor ComponentTypeAttr = "simple_log_processor"
	// ComponentTypeOtlpGRPCSpanExporter is the OTLP span exporter over gRPC with
	// protobuf serialization.
	ComponentTypeOtlpGRPCSpanExporter ComponentTypeAttr = "otlp_grpc_span_exporter"
	// ComponentTypeOtlpHTTPSpanExporter is the OTLP span exporter over HTTP with
	// protobuf serialization.
	ComponentTypeOtlpHTTPSpanExporter ComponentTypeAttr = "otlp_http_span_exporter"
	// ComponentTypeOtlpHTTPJSONSpanExporter is the OTLP span exporter over HTTP
	// with JSON serialization.
	ComponentTypeOtlpHTTPJSONSpanExporter ComponentTypeAttr = "otlp_http_json_span_exporter"
	// ComponentTypeZipkinHTTPSpanExporter is the zipkin span exporter over HTTP.
	ComponentTypeZipkinHTTPSpanExporter ComponentTypeAttr = "zipkin_http_span_exporter"
	// ComponentTypeOtlpGRPCLogExporter is the OTLP log record exporter over gRPC
	// with protobuf serialization.
	ComponentTypeOtlpGRPCLogExporter ComponentTypeAttr = "otlp_grpc_log_exporter"
	// ComponentTypeOtlpHTTPLogExporter is the OTLP log record exporter over HTTP
	// with protobuf serialization.
	ComponentTypeOtlpHTTPLogExporter ComponentTypeAttr = "otlp_http_log_exporter"
	// ComponentTypeOtlpHTTPJSONLogExporter is the OTLP log record exporter over
	// HTTP with JSON serialization.
	ComponentTypeOtlpHTTPJSONLogExporter ComponentTypeAttr = "otlp_http_json_log_exporter"
	// ComponentTypePeriodicMetricReader is the builtin SDK periodically exporting
	// metric reader.
	ComponentTypePeriodicMetricReader ComponentTypeAttr = "periodic_metric_reader"
	// ComponentTypeOtlpGRPCMetricExporter is the OTLP metric exporter over gRPC
	// with protobuf serialization.
	ComponentTypeOtlpGRPCMetricExporter ComponentTypeAttr = "otlp_grpc_metric_exporter"
	// ComponentTypeOtlpHTTPMetricExporter is the OTLP metric exporter over HTTP
	// with protobuf serialization.
	ComponentTypeOtlpHTTPMetricExporter ComponentTypeAttr = "otlp_http_metric_exporter"
	// ComponentTypeOtlpHTTPJSONMetricExporter is the OTLP metric exporter over HTTP
	// with JSON serialization.
	ComponentTypeOtlpHTTPJSONMetricExporter ComponentTypeAttr = "otlp_http_json_metric_exporter"
	// ComponentTypePrometheusHTTPTextMetricExporter is the prometheus metric
	// exporter over HTTP with the default text-based format.
	ComponentTypePrometheusHTTPTextMetricExporter ComponentTypeAttr = "prometheus_http_text_metric_exporter"
)

type ErrorTypeAttr

type ErrorTypeAttr string

ErrorTypeAttr is an attribute conforming to the error.type semantic conventions. It represents the describes a class of error the operation ended with.

var (
	// ErrorTypeOther is a fallback error value to be used when the instrumentation
	// doesn't define a custom value.
	ErrorTypeOther ErrorTypeAttr = "_OTHER"
)

type SDKExporterLogExported

type SDKExporterLogExported struct {
	metric.Int64Counter
}

SDKExporterLogExported is an instrument used to record metric values conforming to the "otel.sdk.exporter.log.exported" semantic conventions. It represents the number of log records for which the export has finished, either successful or failed.

func NewSDKExporterLogExported

func NewSDKExporterLogExported(
	m metric.Meter,
	opt ...metric.Int64CounterOption,
) (SDKExporterLogExported, error)

NewSDKExporterLogExported returns a new SDKExporterLogExported instrument.

func (SDKExporterLogExported) Add

func (m SDKExporterLogExported) Add(
	ctx context.Context,
	incr int64,
	attrs ...attribute.KeyValue,
)

Add adds incr to the existing count for attrs.

All additional attrs passed are included in the recorded value.

For successful exports, `error.type` MUST NOT be set. For failed exports, `error.type` MUST contain the failure cause. For exporters with partial success semantics (e.g. OTLP with `rejected_log_records`), rejected log records MUST count as failed and only non-rejected log records count as success. If no rejection reason is available, `rejected` SHOULD be used as value for `error.type`.

func (SDKExporterLogExported) AddSet

func (m SDKExporterLogExported) AddSet(ctx context.Context, incr int64, set attribute.Set)

AddSet adds incr to the existing count for set.

For successful exports, `error.type` MUST NOT be set. For failed exports, `error.type` MUST contain the failure cause. For exporters with partial success semantics (e.g. OTLP with `rejected_log_records`), rejected log records MUST count as failed and only non-rejected log records count as success. If no rejection reason is available, `rejected` SHOULD be used as value for `error.type`.

func (SDKExporterLogExported) AttrComponentName

func (SDKExporterLogExported) AttrComponentName(val string) attribute.KeyValue

AttrComponentName returns an optional attribute for the "otel.component.name" semantic convention. It represents a name uniquely identifying the instance of the OpenTelemetry component within its containing SDK instance.

func (SDKExporterLogExported) AttrComponentType

AttrComponentType returns an optional attribute for the "otel.component.type" semantic convention. It represents a name identifying the type of the OpenTelemetry component.

func (SDKExporterLogExported) AttrErrorType

AttrErrorType returns an optional attribute for the "error.type" semantic convention. It represents the describes a class of error the operation ended with.

func (SDKExporterLogExported) AttrServerAddress

func (SDKExporterLogExported) AttrServerAddress(val string) attribute.KeyValue

AttrServerAddress returns an optional attribute for the "server.address" semantic convention. It represents the server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.

func (SDKExporterLogExported) AttrServerPort

func (SDKExporterLogExported) AttrServerPort(val int) attribute.KeyValue

AttrServerPort returns an optional attribute for the "server.port" semantic convention. It represents the server port number.

func (SDKExporterLogExported) Description

func (SDKExporterLogExported) Description() string

Description returns the semantic convention description of the instrument

func (SDKExporterLogExported) Inst

Inst returns the underlying metric instrument.

func (SDKExporterLogExported) Name

Name returns the semantic convention name of the instrument.

func (SDKExporterLogExported) Unit

Unit returns the semantic convention unit of the instrument

type SDKExporterLogInflight

type SDKExporterLogInflight struct {
	metric.Int64UpDownCounter
}

SDKExporterLogInflight is an instrument used to record metric values conforming to the "otel.sdk.exporter.log.inflight" semantic conventions. It represents the number of log records which were passed to the exporter, but that have not been exported yet (neither successful, nor failed).

func NewSDKExporterLogInflight

func NewSDKExporterLogInflight(
	m metric.Meter,
	opt ...metric.Int64UpDownCounterOption,
) (SDKExporterLogInflight, error)

NewSDKExporterLogInflight returns a new SDKExporterLogInflight instrument.

func (SDKExporterLogInflight) Add

func (m SDKExporterLogInflight) Add(
	ctx context.Context,
	incr int64,
	attrs ...attribute.KeyValue,
)

Add adds incr to the existing count for attrs.

All additional attrs passed are included in the recorded value.

For successful exports, `error.type` MUST NOT be set. For failed exports, `error.type` MUST contain the failure cause.

func (SDKExporterLogInflight) AddSet

func (m SDKExporterLogInflight) AddSet(ctx context.Context, incr int64, set attribute.Set)

AddSet adds incr to the existing count for set.

For successful exports, `error.type` MUST NOT be set. For failed exports, `error.type` MUST contain the failure cause.

func (SDKExporterLogInflight) AttrComponentName

func (SDKExporterLogInflight) AttrComponentName(val string) attribute.KeyValue

AttrComponentName returns an optional attribute for the "otel.component.name" semantic convention. It represents a name uniquely identifying the instance of the OpenTelemetry component within its containing SDK instance.

func (SDKExporterLogInflight) AttrComponentType

AttrComponentType returns an optional attribute for the "otel.component.type" semantic convention. It represents a name identifying the type of the OpenTelemetry component.

func (SDKExporterLogInflight) AttrServerAddress

func (SDKExporterLogInflight) AttrServerAddress(val string) attribute.KeyValue

AttrServerAddress returns an optional attribute for the "server.address" semantic convention. It represents the server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.

func (SDKExporterLogInflight) AttrServerPort

func (SDKExporterLogInflight) AttrServerPort(val int) attribute.KeyValue

AttrServerPort returns an optional attribute for the "server.port" semantic convention. It represents the server port number.

func (SDKExporterLogInflight) Description

func (SDKExporterLogInflight) Description() string

Description returns the semantic convention description of the instrument

func (SDKExporterLogInflight) Inst

Inst returns the underlying metric instrument.

func (SDKExporterLogInflight) Name

Name returns the semantic convention name of the instrument.

func (SDKExporterLogInflight) Unit

Unit returns the semantic convention unit of the instrument

type SDKExporterMetricDataPointExported

type SDKExporterMetricDataPointExported struct {
	metric.Int64Counter
}

SDKExporterMetricDataPointExported is an instrument used to record metric values conforming to the "otel.sdk.exporter.metric_data_point.exported" semantic conventions. It represents the number of metric data points for which the export has finished, either successful or failed.

func NewSDKExporterMetricDataPointExported

func NewSDKExporterMetricDataPointExported(
	m metric.Meter,
	opt ...metric.Int64CounterOption,
) (SDKExporterMetricDataPointExported, error)

NewSDKExporterMetricDataPointExported returns a new SDKExporterMetricDataPointExported instrument.

func (SDKExporterMetricDataPointExported) Add

Add adds incr to the existing count for attrs.

All additional attrs passed are included in the recorded value.

For successful exports, `error.type` MUST NOT be set. For failed exports, `error.type` MUST contain the failure cause. For exporters with partial success semantics (e.g. OTLP with `rejected_data_points`), rejected data points MUST count as failed and only non-rejected data points count as success. If no rejection reason is available, `rejected` SHOULD be used as value for `error.type`.

func (SDKExporterMetricDataPointExported) AddSet

AddSet adds incr to the existing count for set.

For successful exports, `error.type` MUST NOT be set. For failed exports, `error.type` MUST contain the failure cause. For exporters with partial success semantics (e.g. OTLP with `rejected_data_points`), rejected data points MUST count as failed and only non-rejected data points count as success. If no rejection reason is available, `rejected` SHOULD be used as value for `error.type`.

func (SDKExporterMetricDataPointExported) AttrComponentName

AttrComponentName returns an optional attribute for the "otel.component.name" semantic convention. It represents a name uniquely identifying the instance of the OpenTelemetry component within its containing SDK instance.

func (SDKExporterMetricDataPointExported) AttrComponentType

AttrComponentType returns an optional attribute for the "otel.component.type" semantic convention. It represents a name identifying the type of the OpenTelemetry component.

func (SDKExporterMetricDataPointExported) AttrErrorType

AttrErrorType returns an optional attribute for the "error.type" semantic convention. It represents the describes a class of error the operation ended with.

func (SDKExporterMetricDataPointExported) AttrServerAddress

AttrServerAddress returns an optional attribute for the "server.address" semantic convention. It represents the server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.

func (SDKExporterMetricDataPointExported) AttrServerPort

AttrServerPort returns an optional attribute for the "server.port" semantic convention. It represents the server port number.

func (SDKExporterMetricDataPointExported) Description

Description returns the semantic convention description of the instrument

func (SDKExporterMetricDataPointExported) Inst

Inst returns the underlying metric instrument.

func (SDKExporterMetricDataPointExported) Name

Name returns the semantic convention name of the instrument.

func (SDKExporterMetricDataPointExported) Unit

Unit returns the semantic convention unit of the instrument

type SDKExporterMetricDataPointInflight

type SDKExporterMetricDataPointInflight struct {
	metric.Int64UpDownCounter
}

SDKExporterMetricDataPointInflight is an instrument used to record metric values conforming to the "otel.sdk.exporter.metric_data_point.inflight" semantic conventions. It represents the number of metric data points which were passed to the exporter, but that have not been exported yet (neither successful, nor failed).

func NewSDKExporterMetricDataPointInflight

func NewSDKExporterMetricDataPointInflight(
	m metric.Meter,
	opt ...metric.Int64UpDownCounterOption,
) (SDKExporterMetricDataPointInflight, error)

NewSDKExporterMetricDataPointInflight returns a new SDKExporterMetricDataPointInflight instrument.

func (SDKExporterMetricDataPointInflight) Add

Add adds incr to the existing count for attrs.

All additional attrs passed are included in the recorded value.

For successful exports, `error.type` MUST NOT be set. For failed exports, `error.type` MUST contain the failure cause.

func (SDKExporterMetricDataPointInflight) AddSet

AddSet adds incr to the existing count for set.

For successful exports, `error.type` MUST NOT be set. For failed exports, `error.type` MUST contain the failure cause.

func (SDKExporterMetricDataPointInflight) AttrComponentName

AttrComponentName returns an optional attribute for the "otel.component.name" semantic convention. It represents a name uniquely identifying the instance of the OpenTelemetry component within its containing SDK instance.

func (SDKExporterMetricDataPointInflight) AttrComponentType

AttrComponentType returns an optional attribute for the "otel.component.type" semantic convention. It represents a name identifying the type of the OpenTelemetry component.

func (SDKExporterMetricDataPointInflight) AttrServerAddress

AttrServerAddress returns an optional attribute for the "server.address" semantic convention. It represents the server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.

func (SDKExporterMetricDataPointInflight) AttrServerPort

AttrServerPort returns an optional attribute for the "server.port" semantic convention. It represents the server port number.

func (SDKExporterMetricDataPointInflight) Description

Description returns the semantic convention description of the instrument

func (SDKExporterMetricDataPointInflight) Inst

Inst returns the underlying metric instrument.

func (SDKExporterMetricDataPointInflight) Name

Name returns the semantic convention name of the instrument.

func (SDKExporterMetricDataPointInflight) Unit

Unit returns the semantic convention unit of the instrument

type SDKExporterOperationDuration

type SDKExporterOperationDuration struct {
	metric.Float64Histogram
}

SDKExporterOperationDuration is an instrument used to record metric values conforming to the "otel.sdk.exporter.operation.duration" semantic conventions. It represents the duration of exporting a batch of telemetry records.

func NewSDKExporterOperationDuration

func NewSDKExporterOperationDuration(
	m metric.Meter,
	opt ...metric.Float64HistogramOption,
) (SDKExporterOperationDuration, error)

NewSDKExporterOperationDuration returns a new SDKExporterOperationDuration instrument.

func (SDKExporterOperationDuration) AttrComponentName

func (SDKExporterOperationDuration) AttrComponentName(val string) attribute.KeyValue

AttrComponentName returns an optional attribute for the "otel.component.name" semantic convention. It represents a name uniquely identifying the instance of the OpenTelemetry component within its containing SDK instance.

func (SDKExporterOperationDuration) AttrComponentType

AttrComponentType returns an optional attribute for the "otel.component.type" semantic convention. It represents a name identifying the type of the OpenTelemetry component.

func (SDKExporterOperationDuration) AttrErrorType

AttrErrorType returns an optional attribute for the "error.type" semantic convention. It represents the describes a class of error the operation ended with.

func (SDKExporterOperationDuration) AttrHTTPResponseStatusCode

func (SDKExporterOperationDuration) AttrHTTPResponseStatusCode(val int) attribute.KeyValue

AttrHTTPResponseStatusCode returns an optional attribute for the "http.response.status_code" semantic convention. It represents the HTTP status code of the last HTTP request performed in scope of this export call.

func (SDKExporterOperationDuration) AttrRPCResponseStatusCode

func (SDKExporterOperationDuration) AttrRPCResponseStatusCode(val string) attribute.KeyValue

AttrRPCResponseStatusCode returns an optional attribute for the "rpc.response.status_code" semantic convention. It represents the gRPC status code of the last gRPC request performed in scope of this export call.

func (SDKExporterOperationDuration) AttrServerAddress

func (SDKExporterOperationDuration) AttrServerAddress(val string) attribute.KeyValue

AttrServerAddress returns an optional attribute for the "server.address" semantic convention. It represents the server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.

func (SDKExporterOperationDuration) AttrServerPort

func (SDKExporterOperationDuration) AttrServerPort(val int) attribute.KeyValue

AttrServerPort returns an optional attribute for the "server.port" semantic convention. It represents the server port number.

func (SDKExporterOperationDuration) Description

func (SDKExporterOperationDuration) Description() string

Description returns the semantic convention description of the instrument

func (SDKExporterOperationDuration) Inst

Inst returns the underlying metric instrument.

func (SDKExporterOperationDuration) Name

Name returns the semantic convention name of the instrument.

func (SDKExporterOperationDuration) Record

func (m SDKExporterOperationDuration) Record(
	ctx context.Context,
	val float64,
	attrs ...attribute.KeyValue,
)

Record records val to the current distribution for attrs.

All additional attrs passed are included in the recorded value.

This metric defines successful operations using the full success definitions for http and grpc. Anything else is defined as an unsuccessful operation. For successful operations, `error.type` MUST NOT be set. For unsuccessful export operations, `error.type` MUST contain a relevant failure cause.

func (SDKExporterOperationDuration) RecordSet

func (m SDKExporterOperationDuration) RecordSet(ctx context.Context, val float64, set attribute.Set)

RecordSet records val to the current distribution for set.

This metric defines successful operations using the full success definitions for http and grpc. Anything else is defined as an unsuccessful operation. For successful operations, `error.type` MUST NOT be set. For unsuccessful export operations, `error.type` MUST contain a relevant failure cause.

func (SDKExporterOperationDuration) Unit

Unit returns the semantic convention unit of the instrument

type SDKExporterSpanExported

type SDKExporterSpanExported struct {
	metric.Int64Counter
}

SDKExporterSpanExported is an instrument used to record metric values conforming to the "otel.sdk.exporter.span.exported" semantic conventions. It represents the number of spans for which the export has finished, either successful or failed.

func NewSDKExporterSpanExported

func NewSDKExporterSpanExported(
	m metric.Meter,
	opt ...metric.Int64CounterOption,
) (SDKExporterSpanExported, error)

NewSDKExporterSpanExported returns a new SDKExporterSpanExported instrument.

func (SDKExporterSpanExported) Add

func (m SDKExporterSpanExported) Add(
	ctx context.Context,
	incr int64,
	attrs ...attribute.KeyValue,
)

Add adds incr to the existing count for attrs.

All additional attrs passed are included in the recorded value.

For successful exports, `error.type` MUST NOT be set. For failed exports, `error.type` MUST contain the failure cause. For exporters with partial success semantics (e.g. OTLP with `rejected_spans` ), rejected spans MUST count as failed and only non-rejected spans count as success. If no rejection reason is available, `rejected` SHOULD be used as value for `error.type`.

func (SDKExporterSpanExported) AddSet

func (m SDKExporterSpanExported) AddSet(ctx context.Context, incr int64, set attribute.Set)

AddSet adds incr to the existing count for set.

For successful exports, `error.type` MUST NOT be set. For failed exports, `error.type` MUST contain the failure cause. For exporters with partial success semantics (e.g. OTLP with `rejected_spans` ), rejected spans MUST count as failed and only non-rejected spans count as success. If no rejection reason is available, `rejected` SHOULD be used as value for `error.type`.

func (SDKExporterSpanExported) AttrComponentName

func (SDKExporterSpanExported) AttrComponentName(val string) attribute.KeyValue

AttrComponentName returns an optional attribute for the "otel.component.name" semantic convention. It represents a name uniquely identifying the instance of the OpenTelemetry component within its containing SDK instance.

func (SDKExporterSpanExported) AttrComponentType

AttrComponentType returns an optional attribute for the "otel.component.type" semantic convention. It represents a name identifying the type of the OpenTelemetry component.

func (SDKExporterSpanExported) AttrErrorType

AttrErrorType returns an optional attribute for the "error.type" semantic convention. It represents the describes a class of error the operation ended with.

func (SDKExporterSpanExported) AttrServerAddress

func (SDKExporterSpanExported) AttrServerAddress(val string) attribute.KeyValue

AttrServerAddress returns an optional attribute for the "server.address" semantic convention. It represents the server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.

func (SDKExporterSpanExported) AttrServerPort

func (SDKExporterSpanExported) AttrServerPort(val int) attribute.KeyValue

AttrServerPort returns an optional attribute for the "server.port" semantic convention. It represents the server port number.

func (SDKExporterSpanExported) Description

func (SDKExporterSpanExported) Description() string

Description returns the semantic convention description of the instrument

func (SDKExporterSpanExported) Inst

Inst returns the underlying metric instrument.

func (SDKExporterSpanExported) Name

Name returns the semantic convention name of the instrument.

func (SDKExporterSpanExported) Unit

Unit returns the semantic convention unit of the instrument

type SDKExporterSpanInflight

type SDKExporterSpanInflight struct {
	metric.Int64UpDownCounter
}

SDKExporterSpanInflight is an instrument used to record metric values conforming to the "otel.sdk.exporter.span.inflight" semantic conventions. It represents the number of spans which were passed to the exporter, but that have not been exported yet (neither successful, nor failed).

func NewSDKExporterSpanInflight

func NewSDKExporterSpanInflight(
	m metric.Meter,
	opt ...metric.Int64UpDownCounterOption,
) (SDKExporterSpanInflight, error)

NewSDKExporterSpanInflight returns a new SDKExporterSpanInflight instrument.

func (SDKExporterSpanInflight) Add

func (m SDKExporterSpanInflight) Add(
	ctx context.Context,
	incr int64,
	attrs ...attribute.KeyValue,
)

Add adds incr to the existing count for attrs.

All additional attrs passed are included in the recorded value.

For successful exports, `error.type` MUST NOT be set. For failed exports, `error.type` MUST contain the failure cause.

func (SDKExporterSpanInflight) AddSet

func (m SDKExporterSpanInflight) AddSet(ctx context.Context, incr int64, set attribute.Set)

AddSet adds incr to the existing count for set.

For successful exports, `error.type` MUST NOT be set. For failed exports, `error.type` MUST contain the failure cause.

func (SDKExporterSpanInflight) AttrComponentName

func (SDKExporterSpanInflight) AttrComponentName(val string) attribute.KeyValue

AttrComponentName returns an optional attribute for the "otel.component.name" semantic convention. It represents a name uniquely identifying the instance of the OpenTelemetry component within its containing SDK instance.

func (SDKExporterSpanInflight) AttrComponentType

AttrComponentType returns an optional attribute for the "otel.component.type" semantic convention. It represents a name identifying the type of the OpenTelemetry component.

func (SDKExporterSpanInflight) AttrServerAddress

func (SDKExporterSpanInflight) AttrServerAddress(val string) attribute.KeyValue

AttrServerAddress returns an optional attribute for the "server.address" semantic convention. It represents the server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.

func (SDKExporterSpanInflight) AttrServerPort

func (SDKExporterSpanInflight) AttrServerPort(val int) attribute.KeyValue

AttrServerPort returns an optional attribute for the "server.port" semantic convention. It represents the server port number.

func (SDKExporterSpanInflight) Description

func (SDKExporterSpanInflight) Description() string

Description returns the semantic convention description of the instrument

func (SDKExporterSpanInflight) Inst

Inst returns the underlying metric instrument.

func (SDKExporterSpanInflight) Name

Name returns the semantic convention name of the instrument.

func (SDKExporterSpanInflight) Unit

Unit returns the semantic convention unit of the instrument

type SDKLogCreated

type SDKLogCreated struct {
	metric.Int64Counter
}

SDKLogCreated is an instrument used to record metric values conforming to the "otel.sdk.log.created" semantic conventions. It represents the number of logs submitted to enabled SDK Loggers.

func NewSDKLogCreated

func NewSDKLogCreated(
	m metric.Meter,
	opt ...metric.Int64CounterOption,
) (SDKLogCreated, error)

NewSDKLogCreated returns a new SDKLogCreated instrument.

func (SDKLogCreated) Add

func (m SDKLogCreated) Add(ctx context.Context, incr int64, attrs ...attribute.KeyValue)

Add adds incr to the existing count for attrs.

func (SDKLogCreated) AddSet

func (m SDKLogCreated) AddSet(ctx context.Context, incr int64, set attribute.Set)

AddSet adds incr to the existing count for set.

func (SDKLogCreated) Description

func (SDKLogCreated) Description() string

Description returns the semantic convention description of the instrument

func (SDKLogCreated) Inst

Inst returns the underlying metric instrument.

func (SDKLogCreated) Name

func (SDKLogCreated) Name() string

Name returns the semantic convention name of the instrument.

func (SDKLogCreated) Unit

func (SDKLogCreated) Unit() string

Unit returns the semantic convention unit of the instrument

type SDKMetricReaderCollectionDuration

type SDKMetricReaderCollectionDuration struct {
	metric.Float64Histogram
}

SDKMetricReaderCollectionDuration is an instrument used to record metric values conforming to the "otel.sdk.metric_reader.collection.duration" semantic conventions. It represents the duration of the collect operation of the metric reader.

func NewSDKMetricReaderCollectionDuration

func NewSDKMetricReaderCollectionDuration(
	m metric.Meter,
	opt ...metric.Float64HistogramOption,
) (SDKMetricReaderCollectionDuration, error)

NewSDKMetricReaderCollectionDuration returns a new SDKMetricReaderCollectionDuration instrument.

func (SDKMetricReaderCollectionDuration) AttrComponentName

AttrComponentName returns an optional attribute for the "otel.component.name" semantic convention. It represents a name uniquely identifying the instance of the OpenTelemetry component within its containing SDK instance.

func (SDKMetricReaderCollectionDuration) AttrComponentType

AttrComponentType returns an optional attribute for the "otel.component.type" semantic convention. It represents a name identifying the type of the OpenTelemetry component.

func (SDKMetricReaderCollectionDuration) AttrErrorType

AttrErrorType returns an optional attribute for the "error.type" semantic convention. It represents the describes a class of error the operation ended with.

func (SDKMetricReaderCollectionDuration) Description

Description returns the semantic convention description of the instrument

func (SDKMetricReaderCollectionDuration) Inst

Inst returns the underlying metric instrument.

func (SDKMetricReaderCollectionDuration) Name

Name returns the semantic convention name of the instrument.

func (SDKMetricReaderCollectionDuration) Record

Record records val to the current distribution for attrs.

All additional attrs passed are included in the recorded value.

For successful collections, `error.type` MUST NOT be set. For failed collections, `error.type` SHOULD contain the failure cause. It can happen that metrics collection is successful for some MetricProducers, while others fail. In that case `error.type` SHOULD be set to any of the failure causes.

func (SDKMetricReaderCollectionDuration) RecordSet

RecordSet records val to the current distribution for set.

For successful collections, `error.type` MUST NOT be set. For failed collections, `error.type` SHOULD contain the failure cause. It can happen that metrics collection is successful for some MetricProducers, while others fail. In that case `error.type` SHOULD be set to any of the failure causes.

func (SDKMetricReaderCollectionDuration) Unit

Unit returns the semantic convention unit of the instrument

type SDKProcessorLogProcessed

type SDKProcessorLogProcessed struct {
	metric.Int64Counter
}

SDKProcessorLogProcessed is an instrument used to record metric values conforming to the "otel.sdk.processor.log.processed" semantic conventions. It represents the number of log records for which the processing has finished, either successful or failed.

func NewSDKProcessorLogProcessed

func NewSDKProcessorLogProcessed(
	m metric.Meter,
	opt ...metric.Int64CounterOption,
) (SDKProcessorLogProcessed, error)

NewSDKProcessorLogProcessed returns a new SDKProcessorLogProcessed instrument.

func (SDKProcessorLogProcessed) Add

func (m SDKProcessorLogProcessed) Add(
	ctx context.Context,
	incr int64,
	attrs ...attribute.KeyValue,
)

Add adds incr to the existing count for attrs.

All additional attrs passed are included in the recorded value.

For successful processing, `error.type` MUST NOT be set. For failed processing, `error.type` MUST contain the failure cause. For the SDK Simple and Batching Log Record Processor a log record is considered to be processed already when it has been submitted to the exporter, not when the corresponding export call has finished.

func (SDKProcessorLogProcessed) AddSet

func (m SDKProcessorLogProcessed) AddSet(ctx context.Context, incr int64, set attribute.Set)

AddSet adds incr to the existing count for set.

For successful processing, `error.type` MUST NOT be set. For failed processing, `error.type` MUST contain the failure cause. For the SDK Simple and Batching Log Record Processor a log record is considered to be processed already when it has been submitted to the exporter, not when the corresponding export call has finished.

func (SDKProcessorLogProcessed) AttrComponentName

func (SDKProcessorLogProcessed) AttrComponentName(val string) attribute.KeyValue

AttrComponentName returns an optional attribute for the "otel.component.name" semantic convention. It represents a name uniquely identifying the instance of the OpenTelemetry component within its containing SDK instance.

func (SDKProcessorLogProcessed) AttrComponentType

AttrComponentType returns an optional attribute for the "otel.component.type" semantic convention. It represents a name identifying the type of the OpenTelemetry component.

func (SDKProcessorLogProcessed) AttrErrorType

AttrErrorType returns an optional attribute for the "error.type" semantic convention. It represents a low-cardinality description of the failure reason. SDK Batching Log Record Processors MUST use `queue_full` for log records dropped due to a full queue.

func (SDKProcessorLogProcessed) Description

func (SDKProcessorLogProcessed) Description() string

Description returns the semantic convention description of the instrument

func (SDKProcessorLogProcessed) Inst

Inst returns the underlying metric instrument.

func (SDKProcessorLogProcessed) Name

Name returns the semantic convention name of the instrument.

func (SDKProcessorLogProcessed) Unit

Unit returns the semantic convention unit of the instrument

type SDKProcessorLogQueueCapacity

type SDKProcessorLogQueueCapacity struct {
	metric.Int64ObservableUpDownCounter
}

SDKProcessorLogQueueCapacity is an instrument used to record metric values conforming to the "otel.sdk.processor.log.queue.capacity" semantic conventions. It represents the maximum number of log records the queue of a given instance of an SDK Log Record processor can hold.

func NewSDKProcessorLogQueueCapacity

func NewSDKProcessorLogQueueCapacity(
	m metric.Meter,
	opt ...metric.Int64ObservableUpDownCounterOption,
) (SDKProcessorLogQueueCapacity, error)

NewSDKProcessorLogQueueCapacity returns a new SDKProcessorLogQueueCapacity instrument.

func (SDKProcessorLogQueueCapacity) AttrComponentName

func (SDKProcessorLogQueueCapacity) AttrComponentName(val string) attribute.KeyValue

AttrComponentName returns an optional attribute for the "otel.component.name" semantic convention. It represents a name uniquely identifying the instance of the OpenTelemetry component within its containing SDK instance.

func (SDKProcessorLogQueueCapacity) AttrComponentType

AttrComponentType returns an optional attribute for the "otel.component.type" semantic convention. It represents a name identifying the type of the OpenTelemetry component.

func (SDKProcessorLogQueueCapacity) Description

func (SDKProcessorLogQueueCapacity) Description() string

Description returns the semantic convention description of the instrument

func (SDKProcessorLogQueueCapacity) Inst

Inst returns the underlying metric instrument.

func (SDKProcessorLogQueueCapacity) Name

Name returns the semantic convention name of the instrument.

func (SDKProcessorLogQueueCapacity) Unit

Unit returns the semantic convention unit of the instrument

type SDKProcessorLogQueueSize

type SDKProcessorLogQueueSize struct {
	metric.Int64ObservableUpDownCounter
}

SDKProcessorLogQueueSize is an instrument used to record metric values conforming to the "otel.sdk.processor.log.queue.size" semantic conventions. It represents the number of log records in the queue of a given instance of an SDK log processor.

func NewSDKProcessorLogQueueSize

func NewSDKProcessorLogQueueSize(
	m metric.Meter,
	opt ...metric.Int64ObservableUpDownCounterOption,
) (SDKProcessorLogQueueSize, error)

NewSDKProcessorLogQueueSize returns a new SDKProcessorLogQueueSize instrument.

func (SDKProcessorLogQueueSize) AttrComponentName

func (SDKProcessorLogQueueSize) AttrComponentName(val string) attribute.KeyValue

AttrComponentName returns an optional attribute for the "otel.component.name" semantic convention. It represents a name uniquely identifying the instance of the OpenTelemetry component within its containing SDK instance.

func (SDKProcessorLogQueueSize) AttrComponentType

AttrComponentType returns an optional attribute for the "otel.component.type" semantic convention. It represents a name identifying the type of the OpenTelemetry component.

func (SDKProcessorLogQueueSize) Description

func (SDKProcessorLogQueueSize) Description() string

Description returns the semantic convention description of the instrument

func (SDKProcessorLogQueueSize) Inst

Inst returns the underlying metric instrument.

func (SDKProcessorLogQueueSize) Name

Name returns the semantic convention name of the instrument.

func (SDKProcessorLogQueueSize) Unit

Unit returns the semantic convention unit of the instrument

type SDKProcessorSpanProcessed

type SDKProcessorSpanProcessed struct {
	metric.Int64Counter
}

SDKProcessorSpanProcessed is an instrument used to record metric values conforming to the "otel.sdk.processor.span.processed" semantic conventions. It represents the number of spans for which the processing has finished, either successful or failed.

func NewSDKProcessorSpanProcessed

func NewSDKProcessorSpanProcessed(
	m metric.Meter,
	opt ...metric.Int64CounterOption,
) (SDKProcessorSpanProcessed, error)

NewSDKProcessorSpanProcessed returns a new SDKProcessorSpanProcessed instrument.

func (SDKProcessorSpanProcessed) Add

func (m SDKProcessorSpanProcessed) Add(
	ctx context.Context,
	incr int64,
	attrs ...attribute.KeyValue,
)

Add adds incr to the existing count for attrs.

All additional attrs passed are included in the recorded value.

For successful processing, `error.type` MUST NOT be set. For failed processing, `error.type` MUST contain the failure cause. For the SDK Simple and Batching Span Processor a span is considered to be processed already when it has been submitted to the exporter, not when the corresponding export call has finished.

func (SDKProcessorSpanProcessed) AddSet

func (m SDKProcessorSpanProcessed) AddSet(ctx context.Context, incr int64, set attribute.Set)

AddSet adds incr to the existing count for set.

For successful processing, `error.type` MUST NOT be set. For failed processing, `error.type` MUST contain the failure cause. For the SDK Simple and Batching Span Processor a span is considered to be processed already when it has been submitted to the exporter, not when the corresponding export call has finished.

func (SDKProcessorSpanProcessed) AttrComponentName

func (SDKProcessorSpanProcessed) AttrComponentName(val string) attribute.KeyValue

AttrComponentName returns an optional attribute for the "otel.component.name" semantic convention. It represents a name uniquely identifying the instance of the OpenTelemetry component within its containing SDK instance.

func (SDKProcessorSpanProcessed) AttrComponentType

AttrComponentType returns an optional attribute for the "otel.component.type" semantic convention. It represents a name identifying the type of the OpenTelemetry component.

func (SDKProcessorSpanProcessed) AttrErrorType

AttrErrorType returns an optional attribute for the "error.type" semantic convention. It represents a low-cardinality description of the failure reason. SDK Batching Span Processors MUST use `queue_full` for spans dropped due to a full queue.

func (SDKProcessorSpanProcessed) Description

func (SDKProcessorSpanProcessed) Description() string

Description returns the semantic convention description of the instrument

func (SDKProcessorSpanProcessed) Inst

Inst returns the underlying metric instrument.

func (SDKProcessorSpanProcessed) Name

Name returns the semantic convention name of the instrument.

func (SDKProcessorSpanProcessed) Unit

Unit returns the semantic convention unit of the instrument

type SDKProcessorSpanQueueCapacity

type SDKProcessorSpanQueueCapacity struct {
	metric.Int64ObservableUpDownCounter
}

SDKProcessorSpanQueueCapacity is an instrument used to record metric values conforming to the "otel.sdk.processor.span.queue.capacity" semantic conventions. It represents the maximum number of spans the queue of a given instance of an SDK span processor can hold.

func NewSDKProcessorSpanQueueCapacity

func NewSDKProcessorSpanQueueCapacity(
	m metric.Meter,
	opt ...metric.Int64ObservableUpDownCounterOption,
) (SDKProcessorSpanQueueCapacity, error)

NewSDKProcessorSpanQueueCapacity returns a new SDKProcessorSpanQueueCapacity instrument.

func (SDKProcessorSpanQueueCapacity) AttrComponentName

func (SDKProcessorSpanQueueCapacity) AttrComponentName(val string) attribute.KeyValue

AttrComponentName returns an optional attribute for the "otel.component.name" semantic convention. It represents a name uniquely identifying the instance of the OpenTelemetry component within its containing SDK instance.

func (SDKProcessorSpanQueueCapacity) AttrComponentType

AttrComponentType returns an optional attribute for the "otel.component.type" semantic convention. It represents a name identifying the type of the OpenTelemetry component.

func (SDKProcessorSpanQueueCapacity) Description

func (SDKProcessorSpanQueueCapacity) Description() string

Description returns the semantic convention description of the instrument

func (SDKProcessorSpanQueueCapacity) Inst

Inst returns the underlying metric instrument.

func (SDKProcessorSpanQueueCapacity) Name

Name returns the semantic convention name of the instrument.

func (SDKProcessorSpanQueueCapacity) Unit

Unit returns the semantic convention unit of the instrument

type SDKProcessorSpanQueueSize

type SDKProcessorSpanQueueSize struct {
	metric.Int64ObservableUpDownCounter
}

SDKProcessorSpanQueueSize is an instrument used to record metric values conforming to the "otel.sdk.processor.span.queue.size" semantic conventions. It represents the number of spans in the queue of a given instance of an SDK span processor.

func NewSDKProcessorSpanQueueSize

func NewSDKProcessorSpanQueueSize(
	m metric.Meter,
	opt ...metric.Int64ObservableUpDownCounterOption,
) (SDKProcessorSpanQueueSize, error)

NewSDKProcessorSpanQueueSize returns a new SDKProcessorSpanQueueSize instrument.

func (SDKProcessorSpanQueueSize) AttrComponentName

func (SDKProcessorSpanQueueSize) AttrComponentName(val string) attribute.KeyValue

AttrComponentName returns an optional attribute for the "otel.component.name" semantic convention. It represents a name uniquely identifying the instance of the OpenTelemetry component within its containing SDK instance.

func (SDKProcessorSpanQueueSize) AttrComponentType

AttrComponentType returns an optional attribute for the "otel.component.type" semantic convention. It represents a name identifying the type of the OpenTelemetry component.

func (SDKProcessorSpanQueueSize) Description

func (SDKProcessorSpanQueueSize) Description() string

Description returns the semantic convention description of the instrument

func (SDKProcessorSpanQueueSize) Inst

Inst returns the underlying metric instrument.

func (SDKProcessorSpanQueueSize) Name

Name returns the semantic convention name of the instrument.

func (SDKProcessorSpanQueueSize) Unit

Unit returns the semantic convention unit of the instrument

type SDKSpanLive

type SDKSpanLive struct {
	metric.Int64UpDownCounter
}

SDKSpanLive is an instrument used to record metric values conforming to the "otel.sdk.span.live" semantic conventions. It represents the number of created spans with `recording=true` for which the end operation has not been called yet.

func NewSDKSpanLive

func NewSDKSpanLive(
	m metric.Meter,
	opt ...metric.Int64UpDownCounterOption,
) (SDKSpanLive, error)

NewSDKSpanLive returns a new SDKSpanLive instrument.

func (SDKSpanLive) Add

func (m SDKSpanLive) Add(
	ctx context.Context,
	incr int64,
	attrs ...attribute.KeyValue,
)

Add adds incr to the existing count for attrs.

All additional attrs passed are included in the recorded value.

func (SDKSpanLive) AddSet

func (m SDKSpanLive) AddSet(ctx context.Context, incr int64, set attribute.Set)

AddSet adds incr to the existing count for set.

func (SDKSpanLive) AttrSpanSamplingResult

func (SDKSpanLive) AttrSpanSamplingResult(val SpanSamplingResultAttr) attribute.KeyValue

AttrSpanSamplingResult returns an optional attribute for the "otel.span.sampling_result" semantic convention. It represents the result value of the sampler for this span.

func (SDKSpanLive) Description

func (SDKSpanLive) Description() string

Description returns the semantic convention description of the instrument

func (SDKSpanLive) Inst

Inst returns the underlying metric instrument.

func (SDKSpanLive) Name

func (SDKSpanLive) Name() string

Name returns the semantic convention name of the instrument.

func (SDKSpanLive) Unit

func (SDKSpanLive) Unit() string

Unit returns the semantic convention unit of the instrument

type SDKSpanStarted

type SDKSpanStarted struct {
	metric.Int64Counter
}

SDKSpanStarted is an instrument used to record metric values conforming to the "otel.sdk.span.started" semantic conventions. It represents the number of created spans.

func NewSDKSpanStarted

func NewSDKSpanStarted(
	m metric.Meter,
	opt ...metric.Int64CounterOption,
) (SDKSpanStarted, error)

NewSDKSpanStarted returns a new SDKSpanStarted instrument.

func (SDKSpanStarted) Add

func (m SDKSpanStarted) Add(
	ctx context.Context,
	incr int64,
	attrs ...attribute.KeyValue,
)

Add adds incr to the existing count for attrs.

All additional attrs passed are included in the recorded value.

Implementations MUST record this metric for all spans, even for non-recording ones.

func (SDKSpanStarted) AddSet

func (m SDKSpanStarted) AddSet(ctx context.Context, incr int64, set attribute.Set)

AddSet adds incr to the existing count for set.

Implementations MUST record this metric for all spans, even for non-recording ones.

func (SDKSpanStarted) AttrSpanParentOrigin

func (SDKSpanStarted) AttrSpanParentOrigin(val SpanParentOriginAttr) attribute.KeyValue

AttrSpanParentOrigin returns an optional attribute for the "otel.span.parent.origin" semantic convention. It represents the determines whether the span has a parent span, and if so, whether it is a remote parent .

func (SDKSpanStarted) AttrSpanSamplingResult

func (SDKSpanStarted) AttrSpanSamplingResult(val SpanSamplingResultAttr) attribute.KeyValue

AttrSpanSamplingResult returns an optional attribute for the "otel.span.sampling_result" semantic convention. It represents the result value of the sampler for this span.

func (SDKSpanStarted) Description

func (SDKSpanStarted) Description() string

Description returns the semantic convention description of the instrument

func (SDKSpanStarted) Inst

Inst returns the underlying metric instrument.

func (SDKSpanStarted) Name

func (SDKSpanStarted) Name() string

Name returns the semantic convention name of the instrument.

func (SDKSpanStarted) Unit

func (SDKSpanStarted) Unit() string

Unit returns the semantic convention unit of the instrument

type SpanParentOriginAttr

type SpanParentOriginAttr string

SpanParentOriginAttr is an attribute conforming to the otel.span.parent.origin semantic conventions. It represents the determines whether the span has a parent span, and if so, whether it is a remote parent.

var (
	// SpanParentOriginNone is the span does not have a parent, it is a root span.
	SpanParentOriginNone SpanParentOriginAttr = "none"
	// SpanParentOriginLocal is the span has a parent and the parent's span context
	// [isRemote()] is false.
	//
	// [isRemote()]: https://opentelemetry.io/docs/specs/otel/trace/api/#isremote
	SpanParentOriginLocal SpanParentOriginAttr = "local"
	// SpanParentOriginRemote is the span has a parent and the parent's span context
	// [isRemote()] is true.
	//
	// [isRemote()]: https://opentelemetry.io/docs/specs/otel/trace/api/#isremote
	SpanParentOriginRemote SpanParentOriginAttr = "remote"
)

type SpanSamplingResultAttr

type SpanSamplingResultAttr string

SpanSamplingResultAttr is an attribute conforming to the otel.span.sampling_result semantic conventions. It represents the result value of the sampler for this span.

var (
	// SpanSamplingResultDrop is the span is not sampled and not recording.
	SpanSamplingResultDrop SpanSamplingResultAttr = "DROP"
	// SpanSamplingResultRecordOnly is the span is not sampled, but recording.
	SpanSamplingResultRecordOnly SpanSamplingResultAttr = "RECORD_ONLY"
	// SpanSamplingResultRecordAndSample is the span is sampled and recording.
	SpanSamplingResultRecordAndSample SpanSamplingResultAttr = "RECORD_AND_SAMPLE"
)

Source Files

metric.go

Version
v1.43.0 (latest)
Published
Apr 3, 2026
Platform
linux/amd64
Imports
5 packages
Last checked
1 hour ago

Tools for package owners.