Open pichlermarc opened 11 months ago
I'll work on this. Working on experimental/packages/opentelemetry-exporter-prometheus/
maybe we make this into a checklist so it's easier to track?
opentelemetry-exporter-prometheus
opentelemetry-instrumentation-fetch
opentelemetry-instrumentation-grpc
opentelemetry-instrumentation-http
opentelemetry-instrumentation-xml-http-request
opentelemetry-core (#4408)
opentelemetry-resources (#4428)
sdk-trace-base
opentelemetry-semantic-conventions (https://github.com/open-telemetry/opentelemetry-js/issues/4175#issuecomment-1899295180)
opentelemetry-shim-opentracing (#4430)
sdk-metrics
packages/opentelemetry-semantic-conventions/src/resource/SemanticResourceAttributes.ts
this is an auto-generated file and the references to SpanAttributes are auto-generated from a script. No changes should be made here.
I believe ResourceAttributes
can be replaced with Attributes
as well.
Refs: https://github.com/open-telemetry/opentelemetry-js/pull/4428#discussion_r1458498771
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.
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 main
is 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/api
installed will get an npm
error and won't be able to typescript compile anymore once we exchange SpanAttributes
with Attributes
as the type does not exist on their version of the API.
However, there are a few packages where we can actually exchange the SpanAttributes
and MetricAttributes
for Attributes
on main
even if the package is 1.x
(semver stable) already, and that's in all packages where we use @opentelemetry/api@>=1.3.0
already, because:
Attributes
already exists in 1.3.0
, and MetricAttributes
is a type-alias for Attributes
so 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 next
branch as they'll actually be breaking for a stable package. :sweat_smile:
So, to summarize, we can bump and replace SpanAttributes
and MetricAttributes
on main
everywhere except for:
@opentelemetry/context-async-hooks
is 1.x and depends on API >=1.0.0 (no Attributes
type)@opentelemetry/context-zone
is 1.x and depends on API >=1.0.0 (no Attributes
type)@opentelemetry/context-zone-peer-dep
is 1.x and depends on API >=1.0.0 (no Attributes
type)@opentelemetry/core
is 1.x and depends on API >=1.0.0 (no Attributes
type)@opentelemetry/exporter-jaeger
is 1.x and depends on API >=1.0.0 (no Attributes
type)@opentelemetry/exporter-zipkin
is 1.x and depends on API >=1.0.0 (no Attributes
type)@opentelemetry/propagator-b3
is 1.x and depends on API >=1.0.0 (no Attributes
type)@opentelemetry/propagator-jaeger
is 1.x and depends on API >=1.0.0 (no Attributes
type)@opentelemetry/resources
is 1.x and depends on API >=1.0.0 (no Attributes
type)@opentelemetry/sdk-trace-base
is 1.x and depends on API >=1.0.0 (no Attributes
type)@opentelemetry/sdk-trace-node
is 1.x and depends on API >=1.0.0 (no Attributes
type)@opentelemetry/sdk-trace-web
is 1.x and depends on API >=1.0.0 (no Attributes
type)@opentelemetry/propagator-aws-xray
is 1.x and depends on API >=1.0.0 (no Attributes
type)@opentelemetry/shim-opentracing
is 1.x and depends on API >=1.0.0 (no Attributes
type)These changes would have to go into the next
branch and will be released with 2.0.
There is a special case with @opentelemetry/sdk-metrics
which is 1.x but it's already depending on API >=1.3.0, so the Attributes
type is available. Since that type is available (and there's not difference between Attributes
and MetricAttributes
) we can just replace all usages of MetricAttributes
to Attributes
in @opentelemetry/sdk-metrics
without any repercussions. :slightly_smiling_face:
SpanAttributes
is deprecated, but bumping the minimum API version would be considered breaking. For 2.0 we could replaceSpanAttributes
withAttributes
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 RELEASEBelow is a list of files with instances of
SpanAttributes
orMetricAttributes
. In each package, the minimum API version should be bumped to1.1.0
(first version with the common definition ofAttributes
) and any instances ofSpanAttributes
orMetricAttributes
should be replaced withAttributes
.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.