Skip to content

feat(contrib/zap): add log/trace correlation for uber-go/zap#4781

Closed
darccio wants to merge 15 commits into
mainfrom
feat/contrib-zap-log-correlation
Closed

feat(contrib/zap): add log/trace correlation for uber-go/zap#4781
darccio wants to merge 15 commits into
mainfrom
feat/contrib-zap-log-correlation

Conversation

@darccio

@darccio darccio commented May 19, 2026

Copy link
Copy Markdown
Member

What does this PR do?

Clones #4610 to validate the PR's CI.

Motivation

Current security hardening policies don't allow to run workflows on external contributor PRs.

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.
  • New code is free of linting errors. You can check this by running make lint locally.
  • New code doesn't break existing tests. You can check this by running make test locally.
  • Add an appropriate team label so this PR gets put in the right place for the release notes.
  • All generated files are up to date. You can check this by running make generate locally.
  • Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild. Make sure all nested modules are up to date by running make fix-modules locally.

Unsure? Have a question? Request a review!

highlyavailable and others added 13 commits March 27, 2026 07:56
Add PackageGoUberOrgZap constant and PackageInfo entry to prepare
for the upcoming uber-go/zap logging contrib integration.
Add contrib/go.uber.org/zap with a TraceFields helper that extracts
Datadog trace and span IDs from context and returns them as zap fields.
Supports both 128-bit and 64-bit trace ID formats.

Usage: logger.Info("msg", ddzap.TraceFields(ctx)...)
Add go.uber.org/zap to the contribIntegrations map in tracer/option.go
so it shows up in startup diagnostics. Also add the package to
supported_integrations.md and update go.work.sum.
Adds an orchestrion.yml that marks go.uber.org/zap as imported when
Orchestrion auto-instrumentation is active. Full automatic context
injection isn't possible since zap's zapcore.Core.Write() doesn't
accept context.Context, but integration discovery is handled.
Was failing CI jobs, after reading through their logs I think I need to set the integration count (56 → 57) and register
DD_TRACE_ZAP_ANALYTICS_ENABLED as a supported config
…o v0.15.0 from feedback from failing CI check-modules
@github-actions github-actions Bot added the apm:ecosystem contrib/* related feature requests or bugs label May 19, 2026
@codecov

codecov Bot commented May 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.47%. Comparing base (3b88d5b) to head (8e4cac8).

Additional details and impacted files
Files with missing lines Coverage Δ
ddtrace/tracer/option.go 84.96% <ø> (-2.18%) ⬇️
instrumentation/packages.go 7.81% <ø> (-1.57%) ⬇️

... and 279 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@datadog-official

datadog-official Bot commented May 19, 2026

Copy link
Copy Markdown
Contributor

Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 61.82% (-0.04%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 308415e | Docs | Datadog PR Page | Give us feedback!

@pr-commenter

pr-commenter Bot commented May 19, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-05-19 09:06:00

Comparing candidate commit 308415e in PR branch feat/contrib-zap-log-correlation with baseline commit 3b88d5b in branch main.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 273 metrics, 2 unstable metrics, 1 flaky benchmarks without significant changes.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

Known flaky benchmarks

These benchmarks are marked as flaky and will not trigger a failure. Modify FLAKY_BENCHMARKS_REGEX to control which benchmarks are marked as flaky.

Known flaky benchmarks without significant changes:

  • scenario:BenchmarkOTLPTraceWriterFlush

@rarguelloF

Copy link
Copy Markdown
Contributor

Superseded by #4729 (includes orchestrion support)

@rarguelloF rarguelloF closed this May 19, 2026
@rarguelloF
rarguelloF deleted the feat/contrib-zap-log-correlation branch May 19, 2026 11:12
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.

3 participants