Upgrading go.opentelemetry.io/otel 0.20 to 1
Breakingv0.20.0 → v1.47.0Breaking50Security9Platform24Deprecated21New340Changed746Fixed341Other1563
Fetching 66 releases from GitHub…29 / 66
SecurityPrevent panics in bridge/opentracing when OpenTracing baggage is propagated concurrently with Span.SetBaggageItem.GHSA-42cj-99w8-cp2p ↗
BreakingUpgrade verdict
45 breaking changes and 20 platform requirement changes and 8 security fixes.
In plain terms
- 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.
Must act Top 5 of 92 that need code or config changes
What you must change
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_ENDPOINTRemoves Kind, Value, KeyValue, their constructors, and attribute conversion helpers from go.opentelemetry.io/otel/log.
KindValueKeyValueRemoves AttributeValueLengthLimit and AttributeCountLimit fields from RecordFactory in sdk/log/logtest; records now keep attribute limits disabled.
RecordFactoryAttributeValueLengthLimitAttributeCountLimitRemoves attribute limit fields from RecordFactory in sdk/log/logtest.
RecordFactorysdk/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.overflowPrometheus exporter drops the scope attributes name, version and schema_url.
nameversionschema_urlPrometheus exporter now emits NewInvalidMetric for dropped data, causing scrapes to fail with HTTP 500 by default.
prometheus.NewInvalidMetricpromhttp.HandlerOptspromhttp.ContinueOnErrorRemoves the otel_scope_info metric from the go.opentelemetry.io/otel/exporters/prometheus exporter.
go.opentelemetry.io/otel/exporters/prometheusotel_scope_infoRemoves otel_scope_info from the Prometheus exporter.
otel_scope_infoRemoves the Resource field from EnabledParameters in the sdk/log package.
ResourceEnabledParametersgo.opentelemetry.io/otel/sdk/logRemoves ScopeRecords, EmittedRecord, and RecordFactory types from the logtest package.
ScopeRecordsEmittedRecordRecordFactorygo.opentelemetry.io/otel/log/logtestRemoves AssertRecordEqual from logtest; use AssertEqual instead.
AssertRecordEqualAssertEqualgo.opentelemetry.io/otel/log/logtestRemoves EnabledParameters.Resource from sdk/log.
EnabledParameters.ResourceEnabledParametersRemoves RecordFactory from log/logtest.
RecordFactorylog/logtestAdds AssertEqual and removes AssertRecordEqual from log/logtest.
logtest.AssertEquallogtest.AssertRecordEqualRemoves all examples under go.opentelemetry.io/otel/example, which moved to the Contrib repository.
go.opentelemetry.io/otel/exampleThe Record type in go.opentelemetry.io/otel/log is no longer comparable.
RecordRenames SampledFilter to TraceBasedFilter.
SampledFilterTraceBasedFilterThe
Processor interface in go.opentelemetry.io/otel/sdk/log no longer includes the Enabled method.ProcessorEnabledFilterProcessorThe
SimpleProcessor type in go.opentelemetry.io/otel/sdk/log is no longer comparable.SimpleProcessorThe
BatchProcessor type in go.opentelemetry.io/otel/sdk/log is no longer comparable.BatchProcessorRemoves the Enabled method of SimpleProcessor in the sdk/log package.
SimpleProcessor.EnabledRemoves the Enabled method of BatchProcessor in the sdk/log package.
BatchProcessor.EnabledRemoves zeroInstrumentKind.
zeroInstrumentKindRemoves the deprecated
go.opentelemetry.io/otel/bridge/opencensus.NewTracer.NewTracerRemoves the deprecated
go.opentelemetry.io/otel/exporters/otlp/otlpmetric module.go.opentelemetry.io/otel/exporters/otlp/otlpmetricRemoves the deprecated
go.opentelemetry.io/otel/example/view module.go.opentelemetry.io/otel/example/viewRemoves the deprecated
go.opentelemetry.io/otel/example/fib module.go.opentelemetry.io/otel/example/fibRemoves the experimental OTEL_GO_X_METRIC_EXPORT_BATCH_SIZE environment variable from the metric SDK.
OTEL_GO_X_METRIC_EXPORT_BATCH_SIZEWithMaxExportBatchSizeUses 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.KeyValueReturns spec-compliant TraceIdRatioBased description, a breaking behavioral change needed for spec compliance.
TraceIdRatioBasedMoves the
Enabled method from FilterProcessor to Processor in sdk/log.sdk/logFilterProcessorProcessorEnabledRecord.Resource now returns *resource.Resource instead of resource.Resource in go.opentelemetry.io/otel/sdk/log.
Record.Resourceresource.Resourcego.opentelemetry.io/otel/sdk/logChanges sdk/log Record.Resource to return *resource.Resource.
sdk/logRecord.Resourceresource.ResourceChanges EnabledParameters to have a Severity field instead of a getter and setter in go.opentelemetry.io/otel/log.
EnabledParametersSeverityChanges EnabledParameters to use a field instead of a getter and setter.
EnabledParametersLogger.Enabled in go.opentelemetry.io/otel/log now accepts the new EnabledParameters type instead of Record.
Logger.EnabledEnabledParametersRecordMakes log.Record not comparable.
RecordProcessor.OnEmit in go.opentelemetry.io/otel/sdk/log now accepts a pointer to Record instead of a value.Processor.OnEmitRecordMoves log.Processor.Enabled to an independent FilterProcessor interface type.
log.Processor.EnabledFilterProcessorTrace API interfaces TracerProvider, Tracer, and Span now embed types from the new trace/embedded package, breaking custom implementations.
TracerProviderTracerSpango.opentelemetry.io/otel/trace/embeddedThe trace TracerProvider interface now embeds embedded.TracerProvider, breaking existing implementations.
TracerProvidergo.opentelemetry.io/otel/tracego.opentelemetry.io/otel/trace/embedded.TracerProviderThe Tracer interface in go.opentelemetry.io/otel/trace now embeds embedded.Tracer, breaking existing implementations.
Tracerembedded.TracerThe Span interface in go.opentelemetry.io/otel/trace now embeds embedded.Span, breaking existing implementations.
Spanembedded.SpanFilterProcessor.Enabled in go.opentelemetry.io/otel/sdk/log/internal/x now accepts EnabledParameters instead of Record.
FilterProcessor.EnabledEnabledParametersRecordSecurity8
Prevent panics in bridge/opentracing when OpenTracing baggage is propagated concurrently with Span.SetBaggageItem.
Span.SetBaggageItemCloses schema files opened by ParseFile in schema/v1.0 and schema/v1.1 to fix a resource leak advisory.
ParseFileLimits 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.
Deprecations to plan for
Deprecated19
Deprecates WithExportBufferSize in sdk/log; the option remains for source compatibility but no longer affects behavior.
WithExportBufferSizeBatchProcessorDeprecates the Value.Emit method in attribute; use Value.String instead.
Value.EmitValue.StringDeprecates INVALID in attribute; use EMPTY instead.
attribute.INVALIDattribute.EMPTYDeprecates go.opentelemetry.io/otel/exporters/zipkin.
go.opentelemetry.io/otel/exporters/zipkinDeprecates the zipkin exporter.
Deprecates the WithoutUnits and WithoutCounterSuffixes options in favor of WithTranslationStrategy.
WithoutUnitsWithoutCounterSuffixesWithTranslationStrategyDeprecates the OTEL_GO_X_CARDINALITY_LIMIT environment variable in sdk/metric in favor of the WithCardinalityLimit option.
OTEL_GO_X_CARDINALITY_LIMITWithCardinalityLimitDeprecates the sdk/metric/x feature supporting cardinality limits.
sdk/metric/xDeprecates support for model.LegacyValidation in the Prometheus exporter.
model.LegacyValidationgo.opentelemetry.io/otel/exporters/prometheusDeprecates 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.SortableDeprecates the attribute.NewSetWithSortable function.
attribute.NewSetWithSortableDeprecates the attribute.NewSetWithSortableFiltered function.
attribute.NewSetWithSortableFilteredDeprecates opencensus.NewTracer in favor of opencensus.InstallTraceBridge.
go.opentelemetry.io/otel/bridge/opencensus.NewTraceropencensus.InstallTraceBridgeDeprecates the example/fib package in favor of example/dice.
go.opentelemetry.io/otel/example/fibgo.opentelemetry.io/otel/example/diceDeprecates trace.NewNoopTracerProvider in favor of the new NewTracerProvider function in trace/noop.
go.opentelemetry.io/otel/trace.NewNoopTracerProviderNewTracerProvidergo.opentelemetry.io/otel/trace/noopDeprecates the example/view package in favor of example/prometheus.
go.opentelemetry.io/otel/example/viewgo.opentelemetry.io/otel/example/prometheusDeprecates the otlpmetric exporter package.
go.opentelemetry.io/otel/exporters/otlp/otlpmetric