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

Add resource name to the @Trace annotation #925

Merged
merged 3 commits into from Jul 19, 2019

Conversation

randomanderson
Copy link
Contributor

This add resourceName to the @Trace annotation to be used alone or in tandem with operationName.

Most of the actual code changes are added tests.

@randomanderson randomanderson requested a review from a team as a code owner July 19, 2019 14:13
@randomanderson randomanderson added this to the 0.31.0 milestone Jul 19, 2019
Copy link
Contributor

@tylerbenson tylerbenson left a comment

Choose a reason for hiding this comment

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

Minor change requested to how you set the resource name, but otherwise looks good to me.

if (resourceName != null
&& !resourceName.isEmpty()
&& spanBuilder instanceof DDTracer.DDSpanBuilder) {
spanBuilder = ((DDTracer.DDSpanBuilder) spanBuilder).withResourceName(resourceName);
Copy link
Contributor

Choose a reason for hiding this comment

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

Integrations should only reference classes in dd-trace-api or OpenTracing, not dd-trace-ot. The better way to set the resource name is via setting a tag:

spanBuilder = spanBuilder.withTag(DDTags.RESOURCE_NAME, resourceName);

Copy link
Contributor

Choose a reason for hiding this comment

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

(If you make this change, you wouldn't need to add the builder as a helper)

@randomanderson randomanderson merged commit 22dc305 into master Jul 19, 2019
@randomanderson randomanderson deleted the landerson/resourcename-on-annotation branch July 19, 2019 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants