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

Tag spans from external services #934

Merged
merged 5 commits into from Sep 10, 2020

Conversation

marcotc
Copy link
Member

@marcotc marcotc commented Jan 23, 2020

This PR tags all spans created by ddtrace that represent work performed by a system outside of the application being traced.

This tag will be useful in the future, to allow for better grouping of traces belonging to different services.

@marcotc marcotc added the integrations Involves tracing integrations label Jan 23, 2020
@marcotc marcotc requested a review from a team January 23, 2020 22:39
@marcotc marcotc self-assigned this Jan 23, 2020
@@ -39,6 +40,9 @@ def process(span, event, _id, payload)
span.resource = payload.fetch(:sql)
span.span_type = Datadog::Ext::SQL::TYPE

# Tag as an external peer service
span.set_tag(Datadog::Ext::Integration::TAG_PEER_SERVICE, span.service)
Copy link
Member Author

Choose a reason for hiding this comment

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

I've deliberated if the peer service tag deserves its own first-class module, like analytics sampling rate has, but couldn't convince myself that having that module would add enough value to compensate for the creation of a trivial new file for us to maintain.
It would have simpler logic than analytics sampling rate: it would boil down to a getter and a setter on the already created constant Datadog::Ext::Integration::TAG_PEER_SERVICE.

I've leaned towards considering the constant, Datadog::Ext::Integration::TAG_PEER_SERVICE, as the main feature anchor for peer services and use it where needed, instead of creating a module.

But I'm still very much open to suggestions.

@ericmustin
Copy link
Contributor

@marcotc I brought this up to date with the repo and added the peer.service tag to some of the new external integrations that have been added since this PR was first made. Lmk what you think...same goes for #935

@ericmustin ericmustin merged commit 0574335 into master Sep 10, 2020
@ericmustin ericmustin added this to the 0.41.0 milestone Sep 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrations Involves tracing integrations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants