package otelconv

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

Package httpconv 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 LogRecord
	// Processor.
	ComponentTypeBatchingLogProcessor ComponentTypeAttr = "batching_log_processor"
	// ComponentTypeSimpleLogProcessor is the builtin SDK Simple LogRecord
	// 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"
	// ComponentTypeOtlpGRPCLogExporter is the OTLP LogRecord exporter over gRPC
	// with protobuf serialization.
	ComponentTypeOtlpGRPCLogExporter ComponentTypeAttr = "otlp_grpc_log_exporter"
	// ComponentTypeOtlpHTTPLogExporter is the OTLP LogRecord exporter over HTTP
	// with protobuf serialization.
	ComponentTypeOtlpHTTPLogExporter ComponentTypeAttr = "otlp_http_log_exporter"
	// ComponentTypeOtlpHTTPJSONLogExporter is the OTLP LogRecord exporter over HTTP
	// with JSON serialization.
	ComponentTypeOtlpHTTPJSONLogExporter ComponentTypeAttr = "otlp_http_json_log_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.

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) 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.

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) 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 SDKExporterSpanExportedCount

type SDKExporterSpanExportedCount struct {
	metric.Int64Counter
}

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

func NewSDKExporterSpanExportedCount

func NewSDKExporterSpanExportedCount(
	m metric.Meter,
	opt ...metric.Int64CounterOption,
) (SDKExporterSpanExportedCount, error)

NewSDKExporterSpanExportedCount returns a new SDKExporterSpanExportedCount instrument.

func (SDKExporterSpanExportedCount) Add

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

Add adds incr to the existing count.

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 (SDKExporterSpanExportedCount) AttrComponentName

func (SDKExporterSpanExportedCount) 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 (SDKExporterSpanExportedCount) 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 (SDKExporterSpanExportedCount) 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 (SDKExporterSpanExportedCount) AttrServerAddress

func (SDKExporterSpanExportedCount) 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 (SDKExporterSpanExportedCount) AttrServerPort

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

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

func (SDKExporterSpanExportedCount) Description

func (SDKExporterSpanExportedCount) Description() string

Description returns the semantic convention description of the instrument

func (SDKExporterSpanExportedCount) Inst

Inst returns the underlying metric instrument.

func (SDKExporterSpanExportedCount) Name

Name returns the semantic convention name of the instrument.

func (SDKExporterSpanExportedCount) Unit

Unit returns the semantic convention unit of the instrument

type SDKExporterSpanInflightCount

type SDKExporterSpanInflightCount struct {
	metric.Int64UpDownCounter
}

SDKExporterSpanInflightCount is an instrument used to record metric values conforming to the "otel.sdk.exporter.span.inflight.count" 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 NewSDKExporterSpanInflightCount

func NewSDKExporterSpanInflightCount(
	m metric.Meter,
	opt ...metric.Int64UpDownCounterOption,
) (SDKExporterSpanInflightCount, error)

NewSDKExporterSpanInflightCount returns a new SDKExporterSpanInflightCount instrument.

func (SDKExporterSpanInflightCount) Add

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

Add adds incr to the existing count.

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 (SDKExporterSpanInflightCount) AttrComponentName

func (SDKExporterSpanInflightCount) 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 (SDKExporterSpanInflightCount) 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 (SDKExporterSpanInflightCount) AttrServerAddress

func (SDKExporterSpanInflightCount) 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 (SDKExporterSpanInflightCount) AttrServerPort

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

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

func (SDKExporterSpanInflightCount) Description

func (SDKExporterSpanInflightCount) Description() string

Description returns the semantic convention description of the instrument

func (SDKExporterSpanInflightCount) Inst

Inst returns the underlying metric instrument.

func (SDKExporterSpanInflightCount) Name

Name returns the semantic convention name of the instrument.

func (SDKExporterSpanInflightCount) 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.

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 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.

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) 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.Int64UpDownCounter
}

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.Int64UpDownCounterOption,
) (SDKProcessorLogQueueCapacity, error)

NewSDKProcessorLogQueueCapacity returns a new SDKProcessorLogQueueCapacity instrument.

func (SDKProcessorLogQueueCapacity) Add

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

Add adds incr to the existing count.

All additional attrs passed are included in the recorded value.

Only applies to Log Record processors which use a queue, e.g. the SDK Batching Log Record Processor.

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.Int64UpDownCounter
}

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.Int64UpDownCounterOption,
) (SDKProcessorLogQueueSize, error)

NewSDKProcessorLogQueueSize returns a new SDKProcessorLogQueueSize instrument.

func (SDKProcessorLogQueueSize) Add

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

Add adds incr to the existing count.

All additional attrs passed are included in the recorded value.

Only applies to log record processors which use a queue, e.g. the SDK Batching Log Record Processor.

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 SDKProcessorSpanProcessedCount

type SDKProcessorSpanProcessedCount struct {
	metric.Int64Counter
}

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

func NewSDKProcessorSpanProcessedCount

func NewSDKProcessorSpanProcessedCount(
	m metric.Meter,
	opt ...metric.Int64CounterOption,
) (SDKProcessorSpanProcessedCount, error)

NewSDKProcessorSpanProcessedCount returns a new SDKProcessorSpanProcessedCount instrument.

func (SDKProcessorSpanProcessedCount) Add

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

Add adds incr to the existing count.

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 (SDKProcessorSpanProcessedCount) 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 (SDKProcessorSpanProcessedCount) 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 (SDKProcessorSpanProcessedCount) 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 (SDKProcessorSpanProcessedCount) Description

func (SDKProcessorSpanProcessedCount) Description() string

Description returns the semantic convention description of the instrument

func (SDKProcessorSpanProcessedCount) Inst

Inst returns the underlying metric instrument.

func (SDKProcessorSpanProcessedCount) Name

Name returns the semantic convention name of the instrument.

func (SDKProcessorSpanProcessedCount) Unit

Unit returns the semantic convention unit of the instrument

type SDKProcessorSpanQueueCapacity

type SDKProcessorSpanQueueCapacity struct {
	metric.Int64UpDownCounter
}

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.Int64UpDownCounterOption,
) (SDKProcessorSpanQueueCapacity, error)

NewSDKProcessorSpanQueueCapacity returns a new SDKProcessorSpanQueueCapacity instrument.

func (SDKProcessorSpanQueueCapacity) Add

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

Add adds incr to the existing count.

All additional attrs passed are included in the recorded value.

Only applies to span processors which use a queue, e.g. the SDK Batching Span Processor.

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.Int64UpDownCounter
}

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.Int64UpDownCounterOption,
) (SDKProcessorSpanQueueSize, error)

NewSDKProcessorSpanQueueSize returns a new SDKProcessorSpanQueueSize instrument.

func (SDKProcessorSpanQueueSize) Add

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

Add adds incr to the existing count.

All additional attrs passed are included in the recorded value.

Only applies to span processors which use a queue, e.g. the SDK Batching Span Processor.

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 SDKSpanEndedCount

type SDKSpanEndedCount struct {
	metric.Int64Counter
}

SDKSpanEndedCount is an instrument used to record metric values conforming to the "otel.sdk.span.ended.count" semantic conventions. It represents the number of created spans for which the end operation was called.

func NewSDKSpanEndedCount

func NewSDKSpanEndedCount(
	m metric.Meter,
	opt ...metric.Int64CounterOption,
) (SDKSpanEndedCount, error)

NewSDKSpanEndedCount returns a new SDKSpanEndedCount instrument.

func (SDKSpanEndedCount) Add

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

Add adds incr to the existing count.

All additional attrs passed are included in the recorded value.

For spans with `recording=true`: Implementations MUST record both `otel.sdk.span.live.count` and `otel.sdk.span.ended.count`. For spans with `recording=false`: If implementations decide to record this metric, they MUST also record `otel.sdk.span.live.count`.

func (SDKSpanEndedCount) AttrSpanSamplingResult

func (SDKSpanEndedCount) 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 (SDKSpanEndedCount) Description

func (SDKSpanEndedCount) Description() string

Description returns the semantic convention description of the instrument

func (SDKSpanEndedCount) Inst

Inst returns the underlying metric instrument.

func (SDKSpanEndedCount) Name

func (SDKSpanEndedCount) Name() string

Name returns the semantic convention name of the instrument.

func (SDKSpanEndedCount) Unit

func (SDKSpanEndedCount) Unit() string

Unit returns the semantic convention unit of the instrument

type SDKSpanLiveCount

type SDKSpanLiveCount struct {
	metric.Int64UpDownCounter
}

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

func NewSDKSpanLiveCount

func NewSDKSpanLiveCount(
	m metric.Meter,
	opt ...metric.Int64UpDownCounterOption,
) (SDKSpanLiveCount, error)

NewSDKSpanLiveCount returns a new SDKSpanLiveCount instrument.

func (SDKSpanLiveCount) Add

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

Add adds incr to the existing count.

All additional attrs passed are included in the recorded value.

For spans with `recording=true`: Implementations MUST record both `otel.sdk.span.live.count` and `otel.sdk.span.ended.count`. For spans with `recording=false`: If implementations decide to record this metric, they MUST also record `otel.sdk.span.ended.count`.

func (SDKSpanLiveCount) AttrSpanSamplingResult

func (SDKSpanLiveCount) 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 (SDKSpanLiveCount) Description

func (SDKSpanLiveCount) Description() string

Description returns the semantic convention description of the instrument

func (SDKSpanLiveCount) Inst

Inst returns the underlying metric instrument.

func (SDKSpanLiveCount) Name

func (SDKSpanLiveCount) Name() string

Name returns the semantic convention name of the instrument.

func (SDKSpanLiveCount) Unit

func (SDKSpanLiveCount) Unit() string

Unit returns the semantic convention unit of the instrument

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.38.0
Published
Aug 29, 2025
Platform
linux/amd64
Imports
5 packages
Last checked
3 hours ago

Tools for package owners.