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

[exporter/datadog] Use statswriter, client aggregator is for tracer stats only #31173

Merged
merged 17 commits into from Feb 14, 2024

Conversation

ajgajg1134
Copy link
Contributor

@ajgajg1134 ajgajg1134 commented Feb 9, 2024

Description:

The ProcessStats function receives "tracer stats" payloads, by looping through the payload and breaking it apart this drastically increases the number of stats payloads being emitted. Instead, let's write directly to the StatsWriter, which reduces duplicated work and keeps the payload together as a single payload.

Link to tracking Issue:

Testing:
I tested this locally with the otel example calendar app verifying stats were calculated correctly as well, the logs also showed the reduction in the number of payloads being emitted.

TODO: I will add a test to prevent future regression Done!

Documentation:

Copy link

linux-foundation-easycla bot commented Feb 9, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@ajgajg1134 ajgajg1134 changed the title use statswriter, client aggregator is for tracer stats only [exporter/datadog] Use statswriter, client aggregator is for tracer stats only Feb 9, 2024
@ajgajg1134 ajgajg1134 marked this pull request as ready for review February 9, 2024 21:16
@ajgajg1134 ajgajg1134 requested a review from a team as a code owner February 9, 2024 21:16
Copy link
Member

@songy23 songy23 left a comment

Choose a reason for hiding this comment

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

Copy link

@jdgumz jdgumz left a comment

Choose a reason for hiding this comment

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

✅ the fundamental change looks right to me

@songy23
Copy link
Member

songy23 commented Feb 12, 2024

Please fix lint https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/7878438470/job/21496937483?pr=31173#step:8:333

Copy link
Member

@dineshg13 dineshg13 left a comment

Choose a reason for hiding this comment

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

The statswriter code isn't setting the tracer version as done for clientstatsAggregator(

statsv := exp.params.BuildInfo.Command + exp.params.BuildInfo.Version
) . Can you please validate if it is necessary / what its value is with the PR.

@github-actions github-actions bot added the cmd/otelcontribcol otelcontribcol command label Feb 13, 2024
@ajgajg1134
Copy link
Contributor Author

The statswriter code isn't setting the tracer version as done for clientstatsAggregator(

statsv := exp.params.BuildInfo.Command + exp.params.BuildInfo.Version

) . Can you please validate if it is necessary / what its value is with the PR.

It looks like tracer version is just an "informative" field, I ran it locally and did verify that the new code gave an empty string. So to keep the previous behavior I just added a commit that will attach the tracer version to the client stats payload if it's not already there

Copy link
Member

@songy23 songy23 left a comment

Choose a reason for hiding this comment

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

Toolchain is having issue right now #31213. Should be fixed in #31214

Copy link

@knusbaum knusbaum left a comment

Choose a reason for hiding this comment

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

Looks great.

@mx-psi mx-psi merged commit 44fa082 into open-telemetry:main Feb 14, 2024
142 checks passed
@github-actions github-actions bot added this to the next release milestone Feb 14, 2024
XinRanZhAWS pushed a commit to XinRanZhAWS/opentelemetry-collector-contrib that referenced this pull request Mar 13, 2024
…tats only (open-telemetry#31173)

**Description:** <Describe what has changed.>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
The `ProcessStats` function receives "tracer stats" payloads, by looping
through the payload and breaking it apart this drastically increases the
number of stats payloads being emitted. Instead, let's write directly to
the StatsWriter, which reduces duplicated work and keeps the payload
together as a single payload.

**Link to tracking Issue:** <Issue number if applicable>

**Testing:** <Describe what testing was performed and which tests were
added.>
I tested this locally with the otel example calendar app verifying stats
were calculated correctly as well, the logs also showed the reduction in
the number of payloads being emitted.

~TODO: I will add a test to prevent future regression~ Done!

**Documentation:** <Describe the documentation added.>

---------

Co-authored-by: Pablo Baeyens <pbaeyens31+github@gmail.com>
nslaughter pushed a commit to nslaughter/opentelemetry-collector-contrib that referenced this pull request May 23, 2024
…tats only (open-telemetry#31173)

**Description:** <Describe what has changed.>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
The `ProcessStats` function receives "tracer stats" payloads, by looping
through the payload and breaking it apart this drastically increases the
number of stats payloads being emitted. Instead, let's write directly to
the StatsWriter, which reduces duplicated work and keeps the payload
together as a single payload.

**Link to tracking Issue:** <Issue number if applicable>

**Testing:** <Describe what testing was performed and which tests were
added.>
I tested this locally with the otel example calendar app verifying stats
were calculated correctly as well, the logs also showed the reduction in
the number of payloads being emitted.

~TODO: I will add a test to prevent future regression~ Done!

**Documentation:** <Describe the documentation added.>

---------

Co-authored-by: Pablo Baeyens <pbaeyens31+github@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmd/otelcontribcol otelcontribcol command cmd/oteltestbedcol exporter/datadog Datadog components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants