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

ddtrace/opentelemetry: added support for special attributes mapping #2333

Merged
merged 4 commits into from
Nov 6, 2023

Conversation

dianashevchenko
Copy link
Contributor

@dianashevchenko dianashevchenko commented Nov 6, 2023

What does this PR do?

This PR adds support special span attributes, to match OTLP behavior.
Specifically, name, service, resource, type and analytics.event.

For example:

  • if service.name attribute is set on the span, it will be remapped to Datadog's service tag.
  • if analytics.event attribute is set on the span, it will be remapped to Datadog's _dd1.sr.eausr tag.

Motivation

Matching OTLP support behaviour.

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!

@dianashevchenko dianashevchenko requested a review from a team November 6, 2023 15:24
@dianashevchenko dianashevchenko requested a review from a team as a code owner November 6, 2023 15:24
@@ -9,6 +9,7 @@ import (
"context"
"encoding/binary"
"encoding/hex"
"gopkg.in/DataDog/dd-trace-go.v1/ddtrace/ext"
Copy link

Choose a reason for hiding this comment

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

🚫 [golangci] reported by reviewdog 🐶
File is not gci-ed with --skip-generated -s standard,prefix(gopkg.in/DataDog/dd-trace-go.v1),default (gci)

@darccio
Copy link
Contributor

darccio commented Nov 6, 2023

@dianashevchenko Do you need to update the system tests? If you want, I can take care of them. Your PR looks good.

@pr-commenter
Copy link

pr-commenter bot commented Nov 6, 2023

Benchmarks

Benchmark execution time: 2023-11-06 15:46:39

Comparing candidate commit c6c6d13 in PR branch shevchenko/reserved-attributes with baseline commit 6ec6751 in branch main.

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

@dianashevchenko dianashevchenko merged commit 49273df into main Nov 6, 2023
50 of 51 checks passed
@dianashevchenko dianashevchenko deleted the shevchenko/reserved-attributes branch November 6, 2023 15:58
@darccio darccio restored the shevchenko/reserved-attributes branch November 16, 2023 10:08
@darccio darccio deleted the shevchenko/reserved-attributes branch November 16, 2023 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants