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

ddtrace/tracer: add service version to tracer. #607

Merged
merged 13 commits into from
Mar 18, 2020
Merged

Conversation

knusbaum
Copy link
Contributor

@knusbaum knusbaum commented Mar 5, 2020

This PR adds the concept of a service version to the tracer. The service version should be the current version of the application (service). the service version will be picked up from the DD_VERSION environment variable, or can be set with the WithServiceVersion StartOption when starting the tracer. WithServiceVersion takes priority over the environment variable.

Spans that have a service name equal to the application's service name (set with DD_SERVICE or the WithServiceName StartOption) will be given a "version" tag with the service version as its value.

@knusbaum knusbaum added this to the 1.23.0 milestone Mar 5, 2020
@gbbr
Copy link
Contributor

gbbr commented Mar 10, 2020

This is massively confusing from an API standpoint. Not exactly sure what we're doing here (no PR description provided), but let's not do it like this.

Copy link
Contributor

@gbbr gbbr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is "service name" and "service" supposed to be the same thing? If yes, let's make sure that only one of them exists from a user standpoint. For example: change ext.ServiceName to have the value "service" but keep support for "service.name" to make sure there are no breaking changes for people using this string direclty.

ddtrace/tracer/tracer_test.go Outdated Show resolved Hide resolved
ddtrace/tracer/option.go Outdated Show resolved Hide resolved
@knusbaum knusbaum marked this pull request as ready for review March 13, 2020 00:30
@knusbaum knusbaum requested a review from gbbr March 13, 2020 00:30
ddtrace/tracer/option.go Outdated Show resolved Hide resolved
ddtrace/tracer/option.go Outdated Show resolved Hide resolved
@knusbaum knusbaum changed the title ddtrace/tracer: set service and version tags from environment variables DD_SERVICE and DD_VERSION. ddtrace/tracer: add service version to tracer. Mar 13, 2020
Copy link
Contributor

@gbbr gbbr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it looks good now.

ddtrace/tracer/tracer_test.go Outdated Show resolved Hide resolved
ddtrace/tracer/tracer_test.go Outdated Show resolved Hide resolved
ddtrace/tracer/tracer_test.go Outdated Show resolved Hide resolved
ddtrace/tracer/tracer_test.go Outdated Show resolved Hide resolved
ddtrace/tracer/option_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@gbbr gbbr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One last tiny thing :)

ddtrace/tracer/tracer_test.go Outdated Show resolved Hide resolved
jdgumz
jdgumz previously approved these changes Mar 16, 2020
Copy link
Contributor

@jdgumz jdgumz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

Copy link
Contributor

@gbbr gbbr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@knusbaum knusbaum merged commit abcb2fe into v1 Mar 18, 2020
@knusbaum knusbaum deleted the knusbaum/env-vars branch March 19, 2020 21:02
mingrammer pushed a commit to mingrammer/dd-trace-go that referenced this pull request Dec 22, 2020
This commit adds the concept of a service version to the tracer. The service version should be the current version of the application (service). the service version will be picked up from the DD_VERSION environment variable, or can be set with the WithServiceVersion StartOption when starting the tracer. WithServiceVersion takes priority over the environment variable.

Spans that have a service name equal to the application's service name (set with DD_SERVICE or the WithServiceName StartOption) will be given a "version" tag with the service version as its value.
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.

3 participants