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

contrib/google.golang.org/grpc: add hostname tag #2361

Merged
merged 7 commits into from Dec 11, 2023

Conversation

rarguelloF
Copy link
Contributor

@rarguelloF rarguelloF commented Nov 16, 2023

What does this PR do?

Adds peer.hostname tag to the google.golang.org/grpc client integration containing the hostname of the server.

Motivation

The existing out.host tag actually contains the resolved hostname, so its always an IP address. We want to have a separate tag that contains the actual hostname.

Reviewer's Checklist

  • Changed code has unit tests for its functionality at or near 100% coverage.
  • There is a benchmark for any new code, or changes to existing code.
  • If this interacts with the agent in a new way, a system test has been added.

For Datadog employees:

  • If this PR touches code that handles credentials of any kind, such as Datadog API keys, I've requested a review from @DataDog/security-design-and-guidance.
  • This PR doesn't touch any of that.

Unsure? Have a question? Request a review!

@github-actions github-actions bot added the apm:ecosystem contrib/* related feature requests or bugs label Nov 16, 2023
@pr-commenter
Copy link

pr-commenter bot commented Nov 16, 2023

Benchmarks

Benchmark execution time: 2023-12-11 13:30:02

Comparing candidate commit 862878a in PR branch rarguelloF/grpc-add-hostname-tag with baseline commit ef3fbf1 in branch main.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 39 metrics, 2 unstable metrics.

@rarguelloF rarguelloF marked this pull request as ready for review November 30, 2023 11:55
@rarguelloF rarguelloF requested a review from a team November 30, 2023 11:55
Comment on lines 185 to 187
if host, _, err := net.SplitHostPort(cc.Target()); err == nil {
span.SetTag(ext.PeerHostname, host)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Any way that cc could be nil? If so, this could panic.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think cc should be nil in any case where this code is being executed, but added a check just in case.

@rarguelloF rarguelloF merged commit aada6eb into main Dec 11, 2023
48 of 49 checks passed
@rarguelloF rarguelloF deleted the rarguelloF/grpc-add-hostname-tag branch December 11, 2023 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apm:ecosystem contrib/* related feature requests or bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants