-
Notifications
You must be signed in to change notification settings - Fork 821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use service.name resource attribute since the 0.20.0 release ? #2271
Comments
Hi, You may be able to define it when instantiating your trace provider. e.g.: import { ResourceAttributes } from '@opentelemetry/semantic-conventions';
import { Resource } from '@opentelemetry/resources';
// ...other imports
// ...code
const tracerProvider = new WebTracerProvider( {
resource: new Resource( {
[ ResourceAttributes.SERVICE_NAME ]: "yourServiceName",
} )
} );
// ...code |
Thanks ! It works. |
This was very helpful and fixed my issue! I was running into the same issue when running a node.js project locally. I was unable to pass the Semantic Attributes through an env variable on macOS. Thank you @julien-sugg Just wondering if there are limitations with passing Semantic Attributes through environment variables right now? |
Hei,
Since the 0.20.0 release and the pull request #2227 it seems that
serviceName
is deprecated and we should useservice.name
instead. I havn't easily found this information in the changelog, it did require some digging to understand why the service name was now a very longunknown_service:/path/to/node
. Documentation saysUse service.name Resource attribute instead.
but it wasn't about replacingserviceName: 'toto'
byservice: { name: 'toto'}
.So how to use service.name resource attribute ?
The text was updated successfully, but these errors were encountered: