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

WIP: contrib/google.golang.org/grpc: trace grpc encoding #2959

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rarguelloF
Copy link
Contributor

What does this PR do?

Motivation

Reviewer's Checklist

  • Changed code has unit tests for its functionality at or near 100% coverage.
  • System-Tests covering this feature have been added and enabled with the va.b.c-dev version tag.
  • 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.
  • Add an appropriate team label so this PR gets put in the right place for the release notes.
  • Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild.

Unsure? Have a question? Request a review!

@github-actions github-actions bot added the apm:ecosystem contrib/* related feature requests or bugs label Oct 31, 2024
@rarguelloF rarguelloF force-pushed the rarguelloF/trace-grpc-encoding branch from c5d00c6 to 6028bfe Compare October 31, 2024 16:06
@pr-commenter
Copy link

pr-commenter bot commented Oct 31, 2024

Benchmarks

Benchmark execution time: 2024-10-31 16:54:21

Comparing candidate commit 3081731 in PR branch rarguelloF/trace-grpc-encoding with baseline commit 3cb8ab2 in branch main.

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

scenario:BenchmarkTracerAddSpans-24

  • 🟥 execution_time [+87.268ns; +137.932ns] or [+2.230%; +3.525%]

google.golang.org/grpc v1.64.1 // indirect
google.golang.org/protobuf v1.34.2 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241021214115-324edc3d5d38 // indirect
google.golang.org/grpc v1.67.1 // indirect
Copy link
Member

Choose a reason for hiding this comment

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

@rarguelloF Is this upgrade (and related) needed? If yes, we'll have to clearly state we support this integration from a specific version.

Copy link
Contributor Author

@rarguelloF rarguelloF Nov 5, 2024

Choose a reason for hiding this comment

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

Is this upgrade (and related) needed?

encoding.RegisterCodecV2 was not available on the previous version (in the one we were using, there was encoding.RegisterCodec). I am unsure what happens in someone uses the latest grpc, which registers the default codec using the V2 function, and we register ours using the V1.

we'll have to clearly state we support this integration from a specific version.

I think this is implicit from the go.mod right? since user's grpc version will automatically upgrade when they use this dd-trace-go version.

Copy link
Member

Choose a reason for hiding this comment

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

We could add a comment just to make sure we also know from which version is available. WDYT?

Comment on lines +39 to +47
var (
clientMarshalSpan = spans[0]
clientUnmarshalSpan = spans[1]
serverSpan = spans[2]
serverMarshalSpan = spans[3]
serverUnmarshalSpan = spans[4]
clientSpan = spans[5]
rootSpan = spans[6]
)
Copy link
Member

Choose a reason for hiding this comment

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

Is this order always stable? It looks like a potential flaky test.

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 think it should be, the sequence of the operations should be this. The existing tests assume the order of the server / client spans and don't seem to be flaky, but if it turns out to be flaky we can change this to find the spans by name.

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.

2 participants