Skip to content
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

service.name tag of OTEL default value is not set by default to process.env.OTEL_SERVICE_NAME. #14

Closed
2 tasks done
tskorupka opened this issue Jan 31, 2025 · 2 comments · Fixed by #17
Closed
2 tasks done
Labels
enhancement New feature or request

Comments

@tskorupka
Copy link
Contributor

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Fastify version

5.2.1

Plugin version

0.2.0

Node.js version

22.12.0

Operating system

Linux

Operating system version (i.e. 20.04, 11.3, 10)

alpine 3.21.2

Description

Hey,

I think this is a bug, when I am sending my otel data via grpc to new relic endpoint, instead of seeing all traces defined under service.name equal to my OTEL_SERVICE_NAME, I see them divided into mine OTEL_SERVICE_NAME and fastify service.name.

This ends up in having two different entities in my new relic dashboard, I can fix this by doing something like this.

export const fastifyOtelInstrumentation = new FastifyOtelInstrumentation({
  servername: process.env.OTEL_SERVICE_NAME,
});

I would expect this library to behave as defined in General SDK Configuration (Documentation) of OTEL.
https://opentelemetry.io/docs/languages/sdk-configuration/general/#otel_service_name

Kind Regards,
Tomasz.

Link to code that reproduces the bug

None

Expected Behavior

If I do not provide any configuration options for FastifyOtelInstrumentation, it should set servername default configuration option to environment variable OTEL_SERVICE_NAME, as a result it will create spans with service.name equal to it.

@Eomm Eomm added the enhancement New feature or request label Jan 31, 2025
@metcoder95
Copy link
Member

Thanks for the report! Would you like to send a PR for it?

@tskorupka
Copy link
Contributor Author

Yeah I can do.

tskorupka added a commit to tskorupka/otel that referenced this issue Feb 1, 2025
…iguration, use process.env.OTEL_SERVICE_NAME;

Additionally fix some of the README.md import names, to be more meaningful.
tskorupka added a commit to tskorupka/otel that referenced this issue Feb 1, 2025
Co-authored-by: James Sumners <[email protected]>
Signed-off-by: tskorupka <[email protected]>
tskorupka added a commit to tskorupka/otel that referenced this issue Feb 3, 2025
metcoder95 pushed a commit that referenced this issue Feb 4, 2025
…on, use process.env.OTEL_SERVICE_NAME; (#17)

Co-authored-by: James Sumners <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
3 participants