open-telemetry / opentelemetry-js

OpenTelemetry JavaScript Client
https://opentelemetry.io
Apache License 2.0
2.55k stars 742 forks source link

Update usage of semantic conventions to new exported strings #4567

Open JamieDanielson opened 3 months ago

JamieDanielson commented 3 months ago

Same as https://github.com/open-telemetry/opentelemetry-js-contrib/issues/2025 for core repo.

This issue is intended to track the necessary change of updating each package to use the new exports for semantic conventions that were added in https://github.com/open-telemetry/opentelemetry-js/pull/4298 and now available in v1.22.0.

Each package will need to

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.

JamieDanielson commented 3 months ago

I am working on http package

mmouru commented 2 months ago

PR for instrumentation-fetch https://github.com/open-telemetry/opentelemetry-js/pull/4632

Prashansa-K commented 1 month ago

@JamieDanielson Can I also contribute in this issue? I can start working on this package - @opentelemetry/instrumentation-xml-http-request if no one has picked this up yet.

Prashansa-K commented 1 month ago

Created a PR for instrumentation-xhr here: https://github.com/open-telemetry/opentelemetry-js/pull/4681

JohannesHuster commented 1 month ago

I am working on core package.

JohannesHuster commented 1 month ago

I'm working on

Zen-cronic commented 1 month ago

hey, i'm working on:

Zen-cronic commented 1 month ago

@JamieDanielson hey, i found that in each example in the examples/opentelemetry-web directory, there's no usage of @opentelemetry/semantic-conventions. But it's installed as a dep in package.json. And it's already been updated to 1.24.1. So i think the issue list can do without it!

JamieDanielson commented 1 month ago

@JamieDanielson hey, i found that in each example in the examples/opentelemetry-web directory, there's no usage of @opentelemetry/semantic-conventions. But it's installed as a dep in package.json. And it's already been updated to 1.24.1. So i think the issue list can do without it!

It looks like they are being used for the service name, as seen here in esm-http-ts example. We'll need to replace SemanticResourceAttributes.SERVICE_NAME with the SEMRESATTRS_SERVICE_NAME constant instead. If it helps, take a look at this PR in the js-contrib repo for guidance.

Zen-cronic commented 1 month ago

@JamieDanielson hey, i found that in each example in the examples/opentelemetry-web directory, there's no usage of @opentelemetry/semantic-conventions. But it's installed as a dep in package.json. And it's already been updated to 1.24.1. So i think the issue list can do without it!

It looks like they are being used for the service name, as seen here in esm-http-ts example. We'll need to replace SemanticResourceAttributes.SERVICE_NAME with the SEMRESATTRS_SERVICE_NAME constant instead. If it helps, take a look at this PR in the js-contrib repo for guidance.

Hey, thanks for the pointers. But i mean that none of the example in the opentelemetry-web imports @opentelemetry/semantic-conventions. For e.g., the code in the fetch example inside opentelemetry-web doesn't use the semantic-conventions package. I hope this clarifies it.

JamieDanielson commented 1 month ago

Hey, thanks for the pointers. But i mean that none of the example in the opentelemetry-web imports @opentelemetry/semantic-conventions. For e.g., the code in the fetch example inside opentelemetry-web doesn't use the semantic-conventions package. I hope this clarifies it.

Oh! I see what you mean now, sorry I read too fast earlier 😅 . It looks like service names were removed inadvertently during an update and migration of this example a few years back actually, so I see we have two options: either remove the semantic conventions package from the package.json since it's not being used, or add the resource and service name for these to match the other examples. I'm leaning toward the second option, what do you think?

Zen-cronic commented 1 month ago

Oh! I see what you mean now, sorry I read too fast earlier 😅 . It looks like service names were removed inadvertently during an update and migration of this example a few years back actually, so I see we have two options: either remove the semantic conventions package from the package.json since it's not being used, or add the resource and service name for these to match the other examples. I'm leaning toward the second option, what do you think?

No problem at all! Oh i see. Removing the unused dep would be straightforward, but i think we should aim for consistency with the other examples. So, i'm down with the 2nd option too.

JamieDanielson commented 1 month ago

I am going to update the remaining items in the resources package

JamieDanielson commented 1 month ago

Also going to update exporter-zipkin, exporter-jaeger, and exporter-prometheus

Zen-cronic commented 1 month ago

i'm on the examples/opentelemetry-web now

JohannesHuster commented 4 weeks ago

I'm working on sdk-node and opentelemetry-browser-detector.