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

[data streams] Track high watermark offsets #2511

Merged
merged 4 commits into from Jan 25, 2024

Conversation

piochelepiotr
Copy link
Collaborator

@piochelepiotr piochelepiotr commented Jan 16, 2024

What does this PR do?

Track high watermark offsets along with produce and commit offsets.
This information can be used to determine Kafka lag of consumers.
So we can now get the Kafka lag by only instrumenting the consumer service, with no instrumentation on the producer side.
This also makes the Kafka lag more reliable, since we don't rely on stitching commit & produce offsets later on, but are doing it directly in the application.

Motivation

The main motivation is improving the accuracy and reliability of the data_streams.kafka.lag_seconds metric.
Right now, the metric has edge cases in which it doesn't work great. For example when multiple Kafka topics have the same name.

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.

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 Jan 16, 2024
@pr-commenter
Copy link

pr-commenter bot commented Jan 16, 2024

Benchmarks

Benchmark execution time: 2024-01-25 16:23:41

Comparing candidate commit cab3120 in PR branch piotr-wolski/test-high-watermark with baseline commit c03c56b in branch main.

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

scenario:BenchmarkTracerAddSpans-24

  • 🟩 execution_time [-147.693ns; -111.107ns] or [-3.578%; -2.691%]

@piochelepiotr piochelepiotr force-pushed the piotr-wolski/test-high-watermark branch 2 times, most recently from 19d2c22 to 5648716 Compare January 18, 2024 21:54
@piochelepiotr piochelepiotr force-pushed the piotr-wolski/test-high-watermark branch from 5648716 to 0538d5d Compare January 18, 2024 22:07
@piochelepiotr piochelepiotr marked this pull request as ready for review January 18, 2024 22:10
@piochelepiotr piochelepiotr requested review from a team as code owners January 18, 2024 22:10
@dianashevchenko
Copy link
Contributor

Hi, please fill out the PR description. We rely on that information during release process 🙌

@katiehockman katiehockman enabled auto-merge (squash) January 25, 2024 21:37
@katiehockman katiehockman merged commit a3176e0 into main Jan 25, 2024
154 checks passed
@katiehockman katiehockman deleted the piotr-wolski/test-high-watermark branch January 25, 2024 21:37
darccio added a commit that referenced this pull request Feb 5, 2024
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

4 participants