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

Unify service names #39

Merged
merged 3 commits into from
Nov 6, 2023
Merged

Unify service names #39

merged 3 commits into from
Nov 6, 2023

Conversation

roobre
Copy link
Collaborator

@roobre roobre commented Oct 31, 2023

Before this PR, the main function created a single TracerProvider that was passed down to the http Server. As trace resources, such as service.name, are immutable, this approach had the limitation of all tracing middlewares using the same service.name. When deploying in Docker, as there was only one service, all "microservices" reported the same service name.

This PR introduces a new object called TraceInstaller, which creates fresh new TracerProvider instances for each handler that is instrumented. This allows different handlers to specify their own service name, even when they run inside the same process. By doing this, we get the same trace format in docker, where different endpoints live within the same process, as we do in Kubernetes, where each service gets their own pod.

As a comparison, this is how a trace looked before and after the change, both deployed in docker as a single container:

Before After
image image

Tasklist:

  • Verify this still works as expected in K8s

@roobre roobre marked this pull request as ready for review October 31, 2023 16:26
@roobre roobre force-pushed the unified-service-names branch 4 times, most recently from fbf8c15 to 7cd4a37 Compare November 6, 2023 11:32
@roobre roobre merged commit 03a2f27 into main Nov 6, 2023
1 check passed
@dgzlopes dgzlopes deleted the unified-service-names branch November 6, 2023 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants