otelconv

package
v1.38.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 29, 2025 License: Apache-2.0, BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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"
	// 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"
)

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 RPCGRPCStatusCodeAttr

type RPCGRPCStatusCodeAttr int64

RPCGRPCStatusCodeAttr is an attribute conforming to the rpc.grpc.status_code semantic conventions. It represents the gRPC status code of the last gRPC requests performed in scope of this export call.

var (
	// RPCGRPCStatusCodeOk is the OK.
	RPCGRPCStatusCodeOk RPCGRPCStatusCodeAttr = 0
	// RPCGRPCStatusCodeCancelled is the CANCELLED.
	RPCGRPCStatusCodeCancelled RPCGRPCStatusCodeAttr = 1
	// RPCGRPCStatusCodeUnknown is the UNKNOWN.
	RPCGRPCStatusCodeUnknown RPCGRPCStatusCodeAttr = 2
	// RPCGRPCStatusCodeInvalidArgument is the INVALID_ARGUMENT.
	RPCGRPCStatusCodeInvalidArgument RPCGRPCStatusCodeAttr = 3
	// RPCGRPCStatusCodeDeadlineExceeded is the DEADLINE_EXCEEDED.
	RPCGRPCStatusCodeDeadlineExceeded RPCGRPCStatusCodeAttr = 4
	// RPCGRPCStatusCodeNotFound is the NOT_FOUND.
	RPCGRPCStatusCodeNotFound RPCGRPCStatusCodeAttr = 5
	// RPCGRPCStatusCodeAlreadyExists is the ALREADY_EXISTS.
	RPCGRPCStatusCodeAlreadyExists RPCGRPCStatusCodeAttr = 6
	// RPCGRPCStatusCodePermissionDenied is the PERMISSION_DENIED.
	RPCGRPCStatusCodePermissionDenied RPCGRPCStatusCodeAttr = 7
	// RPCGRPCStatusCodeResourceExhausted is the RESOURCE_EXHAUSTED.
	RPCGRPCStatusCodeResourceExhausted RPCGRPCStatusCodeAttr = 8
	// RPCGRPCStatusCodeFailedPrecondition is the FAILED_PRECONDITION.
	RPCGRPCStatusCodeFailedPrecondition RPCGRPCStatusCodeAttr = 9
	// RPCGRPCStatusCodeAborted is the ABORTED.
	RPCGRPCStatusCodeAborted RPCGRPCStatusCodeAttr = 10
	// RPCGRPCStatusCodeOutOfRange is the OUT_OF_RANGE.
	RPCGRPCStatusCodeOutOfRange RPCGRPCStatusCodeAttr = 11
	// RPCGRPCStatusCodeUnimplemented is the UNIMPLEMENTED.
	RPCGRPCStatusCodeUnimplemented RPCGRPCStatusCodeAttr = 12
	// RPCGRPCStatusCodeInternal is the INTERNAL.
	RPCGRPCStatusCodeInternal RPCGRPCStatusCodeAttr = 13
	// RPCGRPCStatusCodeUnavailable is the UNAVAILABLE.
	RPCGRPCStatusCodeUnavailable RPCGRPCStatusCodeAttr = 14
	// RPCGRPCStatusCodeDataLoss is the DATA_LOSS.
	RPCGRPCStatusCodeDataLoss RPCGRPCStatusCodeAttr = 15
	// RPCGRPCStatusCodeUnauthenticated is the UNAUTHENTICATED.
	RPCGRPCStatusCodeUnauthenticated RPCGRPCStatusCodeAttr = 16
)

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

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

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

AttrRPCGRPCStatusCode returns an optional attribute for the "rpc.grpc.status_code" semantic convention. It represents the gRPC status code of the last gRPC requests 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.

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

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

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

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.

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

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

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

type SDKSpanEnded struct {
	metric.Int64Counter
}

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

func NewSDKSpanEnded

func NewSDKSpanEnded(
	m metric.Meter,
	opt ...metric.Int64CounterOption,
) (SDKSpanEnded, error)

NewSDKSpanEnded returns a new SDKSpanEnded instrument.

func (SDKSpanEnded) Add

func (m SDKSpanEnded) 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` and `otel.sdk.span.ended`. For spans with `recording=false`: If implementations decide to record this metric, they MUST also record `otel.sdk.span.live`.

func (SDKSpanEnded) AttrSpanSamplingResult

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

func (SDKSpanEnded) Description() string

Description returns the semantic convention description of the instrument

func (SDKSpanEnded) Inst

func (m SDKSpanEnded) Inst() metric.Int64Counter

Inst returns the underlying metric instrument.

func (SDKSpanEnded) Name

func (SDKSpanEnded) Name() string

Name returns the semantic convention name of the instrument.

func (SDKSpanEnded) Unit

func (SDKSpanEnded) Unit() string

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

All additional attrs passed are included in the recorded value.

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

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