Repository navigation
Description
SpanAttributes is deprecated, but bumping the minimum API version would be considered breaking. For 2.0 we could replace SpanAttributes with Attributes and bump the minimum API version accordingly.
We can do the same with MetricAttributes
THIS IS A BREAKING CHANGE. PLEASE MAKE PR TO THE next BRANCH FOR INCLUSION IN THE 2.0 RELEASE
Below is a list of files with instances of SpanAttributes or MetricAttributes. In each package, the minimum API version should be bumped to 1.1.0 (first version with the common definition of Attributes) and any instances of SpanAttributes or MetricAttributes should be replaced with Attributes.
Please limit PRs to a single package in order to make them quickly and easily reviewable.
If you are working on one of the below packages, please comment so others know the issue is being worked on.
experimental/packages/opentelemetry-exporter-prometheus/src/PrometheusSerializer.ts
experimental/packages/opentelemetry-exporter-prometheus/test/PrometheusSerializer.test.ts
experimental/packages/opentelemetry-instrumentation-fetch/src/fetch.ts
experimental/packages/opentelemetry-instrumentation-grpc/src/grpc-js/index.ts
experimental/packages/opentelemetry-instrumentation-grpc/src/types.ts
experimental/packages/opentelemetry-instrumentation-grpc/test/grpc-protobuf-ts.test.ts
experimental/packages/opentelemetry-instrumentation-grpc/test/helper.ts
experimental/packages/opentelemetry-instrumentation-http/src/http.ts
experimental/packages/opentelemetry-instrumentation-http/src/types.ts
experimental/packages/opentelemetry-instrumentation-http/src/utils.ts
experimental/packages/opentelemetry-instrumentation-http/test/functionals/http-enable.test.ts
experimental/packages/opentelemetry-instrumentation-http/test/functionals/utils.test.ts
experimental/packages/opentelemetry-instrumentation-xml-http-request/src/xhr.ts
packages/opentelemetry-core/src/common/attributes.ts
packages/opentelemetry-core/src/trace/sampler/ParentBasedSampler.ts
packages/opentelemetry-resources/src/Resource.ts
packages/opentelemetry-resources/src/types.ts
packages/opentelemetry-sdk-trace-base/src/export/ReadableSpan.ts
packages/opentelemetry-sdk-trace-base/src/Sampler.ts
packages/opentelemetry-sdk-trace-base/src/sampler/ParentBasedSampler.ts
packages/opentelemetry-sdk-trace-base/src/Span.ts
packages/opentelemetry-sdk-trace-base/src/TimedEvent.ts
packages/opentelemetry-sdk-trace-base/test/common/Span.test.ts
packages/opentelemetry-sdk-trace-base/test/common/Tracer.test.ts
packages/opentelemetry-semantic-conventions/src/resource/SemanticResourceAttributes.ts
packages/opentelemetry-shim-opentracing/src/shim.ts
packages/sdk-metrics/src/aggregator/types.ts
packages/sdk-metrics/src/exemplar/AlignedHistogramBucketExemplarReservoir.ts
packages/sdk-metrics/src/exemplar/AlwaysSampleExemplarFilter.ts
packages/sdk-metrics/src/exemplar/Exemplar.ts
packages/sdk-metrics/src/exemplar/ExemplarFilter.ts
packages/sdk-metrics/src/exemplar/ExemplarReservoir.ts
packages/sdk-metrics/src/exemplar/NeverSampleExemplarFilter.ts
packages/sdk-metrics/src/exemplar/SimpleFixedSizeExemplarReservoir.ts
packages/sdk-metrics/src/exemplar/WithTraceExemplarFilter.ts
packages/sdk-metrics/src/export/MetricData.ts
packages/sdk-metrics/src/Instruments.ts
packages/sdk-metrics/src/ObservableResult.ts
packages/sdk-metrics/src/state/DeltaMetricProcessor.ts
packages/sdk-metrics/src/state/HashMap.ts
packages/sdk-metrics/src/state/MultiWritableMetricStorage.ts
packages/sdk-metrics/src/state/SyncMetricStorage.ts
packages/sdk-metrics/src/state/WritableMetricStorage.ts
packages/sdk-metrics/src/utils.ts
packages/sdk-metrics/src/view/AttributesProcessor.ts
packages/sdk-metrics/test/MeterProvider.test.ts
packages/sdk-metrics/test/state/HashMap.test.ts
packages/sdk-metrics/test/state/MultiWritableMetricStorage.test.ts
packages/sdk-metrics/test/util.ts
packages/sdk-metrics/test/utils.test.ts
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
[-]Replace usages of `SpanAttributes` with `Attributes`[/-][+]Replace usages of `SpanAttributes`/`MetricAttributes` with `Attributes`[/+]lilacyl commentedon Nov 8, 2023
I'll work on this. Working on experimental/packages/opentelemetry-exporter-prometheus/
JamieDanielson commentedon Jan 9, 2024
maybe we make this into a checklist so it's easier to track?
opentelemetry-exporter-prometheus (#4993)
opentelemetry-instrumentation-fetch (no usages found)
opentelemetry-instrumentation-grpc (no usages found)
opentelemetry-instrumentation-http (#5023)
opentelemetry-instrumentation-xml-http-request
opentelemetry-core (#4408)
opentelemetry-resources (#4428)
sdk-trace-base (#5009)
opentelemetry-semantic-conventions (#4175 (comment))
opentelemetry-shim-opentracing (#4430)
sdk-metrics (#5021)
2 remaining items
github-actions commentedon Apr 22, 2024
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days.
JamieDanielson commentedon Sep 16, 2024
Adding Marc's comment here because it was a really useful explanation:
We're just allowed to bump the API version for all packages except for
./packages, as these are all stable and that's the only place where it's actually breaking and requires us to bump to 2.0. So what you could actually do is bump all versions in./selenium-tests/(not public anyway -> API bump is okay)./experimental/(not stable - therefore we can break in minor -> API bump is okay)./integration-tests(not public anyway -> API bump is okay)./examples/(they're all examples, not published to NPM -> API bump is okay)What we cannot do on
mainis bump the peer-dependency of any package in./packages(with one exception, see below) because it's breaking AND the packages are 1.x (semver stable) already. So a user with an older version of@opentelemetry/apiinstalled will get annpmerror and won't be able to typescript compile anymore once we exchangeSpanAttributeswithAttributesas the type does not exist on their version of the API.However, there are a few packages where we can actually exchange the
SpanAttributesandMetricAttributesforAttributesonmaineven if the package is1.x(semver stable) already, and that's in all packages where we use@opentelemetry/api@>=1.3.0already, because:Attributesalready exists in1.3.0, andMetricAttributesis a type-alias forAttributesso it's actually a drop-in replacement that won't cause any compile issues.Everything else that does not fit these constraints must be done in the
nextbranch as they'll actually be breaking for a stable package. 😅So, to summarize, we can bump and replace
SpanAttributesandMetricAttributesonmaineverywhere except for:@opentelemetry/context-async-hooksis 1.x and depends on API >=1.0.0 (noAttributestype)@opentelemetry/context-zoneis 1.x and depends on API >=1.0.0 (noAttributestype)@opentelemetry/context-zone-peer-depis 1.x and depends on API >=1.0.0 (noAttributestype)@opentelemetry/coreis 1.x and depends on API >=1.0.0 (noAttributestype)@opentelemetry/exporter-jaegeris 1.x and depends on API >=1.0.0 (noAttributestype)@opentelemetry/exporter-zipkinis 1.x and depends on API >=1.0.0 (noAttributestype)@opentelemetry/propagator-b3is 1.x and depends on API >=1.0.0 (noAttributestype)@opentelemetry/propagator-jaegeris 1.x and depends on API >=1.0.0 (noAttributestype)@opentelemetry/resourcesis 1.x and depends on API >=1.0.0 (noAttributestype)@opentelemetry/sdk-trace-baseis 1.x and depends on API >=1.0.0 (noAttributestype)@opentelemetry/sdk-trace-nodeis 1.x and depends on API >=1.0.0 (noAttributestype)@opentelemetry/sdk-trace-webis 1.x and depends on API >=1.0.0 (noAttributestype)@opentelemetry/propagator-aws-xrayis 1.x and depends on API >=1.0.0 (noAttributestype)@opentelemetry/shim-opentracingis 1.x and depends on API >=1.0.0 (noAttributestype)These changes would have to go into the
nextbranch and will be released with 2.0.There is a special case with
@opentelemetry/sdk-metricswhich is 1.x but it's already depending on API >=1.3.0, so theAttributestype is available. Since that type is available (and there's not difference betweenAttributesandMetricAttributes) we can just replace all usages ofMetricAttributestoAttributesin@opentelemetry/sdk-metricswithout any repercussions. 🙂david-luna commentedon Sep 27, 2024
In main branch
I think instrumentation-xml-http-request is fine :)
david-luna commentedon Sep 27, 2024
instrumentation-grpc seems to be clear as well
No types to rename
david-luna commentedon Sep 27, 2024
instrumentation-fetch too
david-luna commentedon Sep 27, 2024
@JamieDanielson could I be missing something in my previous comments?
with #4978 merged I can go for the http instrumentation :)
pichlermarc commentedon Nov 7, 2024
@david-luna yep, I everything seems to be done - thanks for taking care of so many of these. 🙌
feat(instrumentation-hapi): support migration to stable HTTP semconv,…
feat(instrumentation-hapi): support migration to stable HTTP semconv,…