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

Fix span error tagging in grpc server interceptor #980

Merged
merged 8 commits into from Sep 9, 2019

Conversation

marcoferrer
Copy link
Contributor

At the moment there is a discrepancy with how spans are tagged in the client interceptor vs the server interceptor. This PR is meant to synchronize the behavior between the two.

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.

I don't think this will work this way. Unfortunately, grpc doesn't seem to expose the status for the listener. If we want the status, I think we'd need a more significant change to the instrumentation.

I appreciate the attempt and encourage you to keep trying. I think it's valuable information to collect.

@marcoferrer
Copy link
Contributor Author

@tylerbenson Sorted out ide issues and pushed the proper implementation. Will update tests if everything looks agreeable.

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.

I'm ok with your changes thus far. Go ahead and add more tests as you suggested. Thanks for your contributions!

((TraceScope) scope).setAsyncPropagation(false);
}
} catch (final Throwable e) {
DECORATE.onError(span, e);
Copy link
Contributor

Choose a reason for hiding this comment

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

Any example of an error here that wouldn't be caught elsewhere? (Sorry, I'm not an expert with grpc, so I'm not sure what kinds of exceptions would be thrown here.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the call was already closed by some external hook or client cancellation then this method will throw an IllegalStateException

Copy link
Contributor

Choose a reason for hiding this comment

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

Is that a state we really want reported to the span? Is that useful for troubleshooting?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After some testing it seems that if an error were to occur here it could possibly overwrite the the true source error. Ill remove the catch and push

@tylerbenson tylerbenson added the tag: community Community contribution label Sep 6, 2019
@tylerbenson
Copy link
Contributor

If you'd like to ping me on slack (https://chat.datadoghq.com) to discuss, let me know. I can also try to answer questions to help you fix your IDE setup. It is a pretty complicated project and can be difficult to get working well.

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.

Looks good. Just need to run ./gradlew googleJavaFormat to get check to pass.
(Also minor nit in the comment)

@tylerbenson tylerbenson added this to the 0.33.0 milestone Sep 9, 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.

Thanks again for your contribution!

@tylerbenson tylerbenson merged commit 0681739 into DataDog:master Sep 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tag: community Community contribution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants