Skip to content

Upgrading go.opentelemetry.io/otel 0.20 to 1

Breakingv0.20.0 → v1.47.0Breaking50Security9Platform24Deprecated21New340Changed746Fixed341Other1563

Fetching 66 releases from GitHub…29 / 66
BreakingUpgrade verdict

45 breaking changes and 20 platform requirement changes and 8 security fixes.

  • If you give the metrics exporter a URL without a path, it now sends to the root path instead of automatically adding /v1/metrics.
  • Several log value types and helper functions have been deleted from the log package, so code using them will no longer compile.
  • The test record factory no longer has attribute limit settings, and records it produces keep attribute limits off so tests can add exact attributes.
  • Removes attribute limit fields from RecordFactory in sdk/log/logtest.
Top 5 of 92 that need code or config changes
Breaking45
WithEndpointURL in otlpmetrichttp no longer appends the default signal path when the endpoint URL has no path; the root path is used instead.
WithEndpointURLOTEL_EXPORTER_OTLP_METRICS_ENDPOINTOTEL_EXPORTER_OTLP_TRACES_ENDPOINT
Removes Kind, Value, KeyValue, their constructors, and attribute conversion helpers from go.opentelemetry.io/otel/log.
KindValueKeyValue
Removes AttributeValueLengthLimit and AttributeCountLimit fields from RecordFactory in sdk/log/logtest; records now keep attribute limits disabled.
RecordFactoryAttributeValueLengthLimitAttributeCountLimit
Removes attribute limit fields from RecordFactory in sdk/log/logtest.
RecordFactory
sdk/metric now applies a default cardinality limit of 2000; new attribute sets beyond it are dropped and aggregated into otel.metric.overflow.
WithCardinalityLimitOTEL_GO_X_CARDINALITY_LIMITotel.metric.overflow
Prometheus exporter drops the scope attributes name, version and schema_url.
nameversionschema_url
Prometheus exporter now emits NewInvalidMetric for dropped data, causing scrapes to fail with HTTP 500 by default.
prometheus.NewInvalidMetricpromhttp.HandlerOptspromhttp.ContinueOnError
Removes the otel_scope_info metric from the go.opentelemetry.io/otel/exporters/prometheus exporter.
go.opentelemetry.io/otel/exporters/prometheusotel_scope_info
Removes otel_scope_info from the Prometheus exporter.
otel_scope_info
Removes the Resource field from EnabledParameters in the sdk/log package.
ResourceEnabledParametersgo.opentelemetry.io/otel/sdk/log
Removes ScopeRecords, EmittedRecord, and RecordFactory types from the logtest package.
ScopeRecordsEmittedRecordRecordFactorygo.opentelemetry.io/otel/log/logtest
Removes AssertRecordEqual from logtest; use AssertEqual instead.
AssertRecordEqualAssertEqualgo.opentelemetry.io/otel/log/logtest
Removes EnabledParameters.Resource from sdk/log.
EnabledParameters.ResourceEnabledParameters
Removes RecordFactory from log/logtest.
RecordFactorylog/logtest
Adds AssertEqual and removes AssertRecordEqual from log/logtest.
logtest.AssertEquallogtest.AssertRecordEqual
Removes all examples under go.opentelemetry.io/otel/example, which moved to the Contrib repository.
go.opentelemetry.io/otel/example
The Record type in go.opentelemetry.io/otel/log is no longer comparable.
Record
Renames SampledFilter to TraceBasedFilter.
SampledFilterTraceBasedFilter
The Processor interface in go.opentelemetry.io/otel/sdk/log no longer includes the Enabled method.
ProcessorEnabledFilterProcessor
The SimpleProcessor type in go.opentelemetry.io/otel/sdk/log is no longer comparable.
SimpleProcessor
The BatchProcessor type in go.opentelemetry.io/otel/sdk/log is no longer comparable.
BatchProcessor
Removes the Enabled method of SimpleProcessor in the sdk/log package.
SimpleProcessor.Enabled
Removes the Enabled method of BatchProcessor in the sdk/log package.
BatchProcessor.Enabled
Removes zeroInstrumentKind.
zeroInstrumentKind
Removes the deprecated go.opentelemetry.io/otel/bridge/opencensus.NewTracer.
NewTracer
Removes the deprecated go.opentelemetry.io/otel/exporters/otlp/otlpmetric module.
go.opentelemetry.io/otel/exporters/otlp/otlpmetric
Removes the deprecated go.opentelemetry.io/otel/example/view module.
go.opentelemetry.io/otel/example/view
Removes the deprecated go.opentelemetry.io/otel/example/fib module.
go.opentelemetry.io/otel/example/fib
Removes the experimental OTEL_GO_X_METRIC_EXPORT_BATCH_SIZE environment variable from the metric SDK.
OTEL_GO_X_METRIC_EXPORT_BATCH_SIZEWithMaxExportBatchSize
Uses attribute.Value and attribute.KeyValue for log bodies and attributes in go.opentelemetry.io/otel/log, logtest, sdk/log, and sdk/log/logtest.
attribute.Valueattribute.KeyValue
Returns spec-compliant TraceIdRatioBased description, a breaking behavioral change needed for spec compliance.
TraceIdRatioBased
Moves the Enabled method from FilterProcessor to Processor in sdk/log.
sdk/logFilterProcessorProcessorEnabled
Record.Resource now returns *resource.Resource instead of resource.Resource in go.opentelemetry.io/otel/sdk/log.
Record.Resourceresource.Resourcego.opentelemetry.io/otel/sdk/log
Changes sdk/log Record.Resource to return *resource.Resource.
sdk/logRecord.Resourceresource.Resource
Changes EnabledParameters to have a Severity field instead of a getter and setter in go.opentelemetry.io/otel/log.
EnabledParametersSeverity
Changes EnabledParameters to use a field instead of a getter and setter.
EnabledParameters
Logger.Enabled in go.opentelemetry.io/otel/log now accepts the new EnabledParameters type instead of Record.
Logger.EnabledEnabledParametersRecord
Makes log.Record not comparable.
Record
Processor.OnEmit in go.opentelemetry.io/otel/sdk/log now accepts a pointer to Record instead of a value.
Processor.OnEmitRecord
Moves log.Processor.Enabled to an independent FilterProcessor interface type.
log.Processor.EnabledFilterProcessor
Trace API interfaces TracerProvider, Tracer, and Span now embed types from the new trace/embedded package, breaking custom implementations.
TracerProviderTracerSpango.opentelemetry.io/otel/trace/embedded
The trace TracerProvider interface now embeds embedded.TracerProvider, breaking existing implementations.
TracerProvidergo.opentelemetry.io/otel/tracego.opentelemetry.io/otel/trace/embedded.TracerProvider
The Tracer interface in go.opentelemetry.io/otel/trace now embeds embedded.Tracer, breaking existing implementations.
Tracerembedded.Tracer
The Span interface in go.opentelemetry.io/otel/trace now embeds embedded.Span, breaking existing implementations.
Spanembedded.Span
FilterProcessor.Enabled in go.opentelemetry.io/otel/sdk/log/internal/x now accepts EnabledParameters instead of Record.
FilterProcessor.EnabledEnabledParametersRecord
Security8
Prevent panics in bridge/opentracing when OpenTracing baggage is propagated concurrently with Span.SetBaggageItem.
Span.SetBaggageItem
Closes schema files opened by ParseFile in schema/v1.0 and schema/v1.1 to fix a resource leak advisory.
ParseFile
Limits HTTP response body to 4 MiB in otlptracehttp to mitigate excessive memory usage; larger responses are non-retryable errors.
Updates google.golang.org/grpc to v1.79.3 as a security fix.
Opentelemetry-go's baggage parsing no longer caps raw header length in go.opentelemetry.io/otel
OpenTelemetry-Go: Multi-value baggage header extraction causes excessive allocations in go.opentelemetry.io/otel
Updates module golang.org/x/crypto to v0.45.0.
Updates all dependencies to address GO-2024-2687.
Platform20
This release is the last to support Go 1.25; the next release will require at least Go 1.26.
Adds support for Go 1.27.
Drops support for Go 1.24.
This release is the last to support Go 1.24; the next release will require at least Go 1.25.
Adds support for Go 1.26.
Drops support for Go 1.23.
This release is the last to support Go 1.23; the next release will require at least Go 1.24.
Adds support for Go 1.25.
Drops support for Go 1.22.
This is the last release to support Go 1.22; the next release will require at least Go 1.23.
Adds support for Go 1.24.
Relaxes the minimum Go version to 1.22.0 in various modules.
Downgrades the minimum Go version dependency back to 1.22.0 in various packages.
Drops support for Go 1.21.
Drops support for Go 1.21 in the dice example.
This release is the last to support Go 1.21; the next release will require at least Go 1.22.
Adds support for Go 1.23.
Drops support for Go 1.20.
This release is the last to support Go 1.20; the next release will require at least Go 1.21.
Adds support for Go 1.22.
Deprecated19
Deprecates WithExportBufferSize in sdk/log; the option remains for source compatibility but no longer affects behavior.
WithExportBufferSizeBatchProcessor
Deprecates the Value.Emit method in attribute; use Value.String instead.
Value.EmitValue.String
Deprecates INVALID in attribute; use EMPTY instead.
attribute.INVALIDattribute.EMPTY
Deprecates go.opentelemetry.io/otel/exporters/zipkin.
go.opentelemetry.io/otel/exporters/zipkin
Deprecates the zipkin exporter.
Deprecates the WithoutUnits and WithoutCounterSuffixes options in favor of WithTranslationStrategy.
WithoutUnitsWithoutCounterSuffixesWithTranslationStrategy
Deprecates the OTEL_GO_X_CARDINALITY_LIMIT environment variable in sdk/metric in favor of the WithCardinalityLimit option.
OTEL_GO_X_CARDINALITY_LIMITWithCardinalityLimit
Deprecates the sdk/metric/x feature supporting cardinality limits.
sdk/metric/x
Deprecates support for model.LegacyValidation in the Prometheus exporter.
model.LegacyValidationgo.opentelemetry.io/otel/exporters/prometheus
Deprecates all examples under go.opentelemetry.io/otel/example as they move to the Contrib repository.
Deprecates examples and redirects to contrib.
Deprecates the attribute.Sortable type.
attribute.Sortable
Deprecates the attribute.NewSetWithSortable function.
attribute.NewSetWithSortable
Deprecates the attribute.NewSetWithSortableFiltered function.
attribute.NewSetWithSortableFiltered
Deprecates opencensus.NewTracer in favor of opencensus.InstallTraceBridge.
go.opentelemetry.io/otel/bridge/opencensus.NewTraceropencensus.InstallTraceBridge
Deprecates the example/fib package in favor of example/dice.
go.opentelemetry.io/otel/example/fibgo.opentelemetry.io/otel/example/dice
Deprecates trace.NewNoopTracerProvider in favor of the new NewTracerProvider function in trace/noop.
go.opentelemetry.io/otel/trace.NewNoopTracerProviderNewTracerProvidergo.opentelemetry.io/otel/trace/noop
Deprecates the example/view package in favor of example/prometheus.
go.opentelemetry.io/otel/example/viewgo.opentelemetry.io/otel/example/prometheus
Deprecates the otlpmetric exporter package.
go.opentelemetry.io/otel/exporters/otlp/otlpmetric