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

profiler: use only one service version value #2322

Merged
merged 3 commits into from
Nov 1, 2023

Conversation

nsrip-dd
Copy link
Contributor

What does this PR do?

Users can set the version tag for profiles in three ways: via
WithVersion, the DD_VERSION environment variable, or via WithTags. A
service should only have one version tag at a time for profile
comparison with a "recent" version to work properly in the UI. Today,
all of these options can be used at once and the profiles for a service
can have multiple version tags.

To be consistent with the tracer, we should supply a single version and
it should be configured with the following priority order: first,
WithVersion is used. If that option is not set, then DD_VERSION will be
used. If either of those are used, then they get priority over any
version tags supplied via WithTags. That is, version tags are removed if
the version is explicity set.

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!

Users can set the version tag for profiles in three ways: via
WithVersion, the DD_VERSION environment variable, or via WithTags. A
service should only have one version tag at a time for profile
comparison with a "recent" version to work properly in the UI. Today,
all of these options can be used at once and the profiles for a service
can have multiple version tags.

To be consistent with the tracer, we should supply a single version and
it should be configured with the following priority order: first,
WithVersion is used. If that option is not set, then DD_VERSION will be
used. If either of those are used, then they get priority over any
version tags supplied via WithTags. That is, version tags are removed if
the version is explicity set.
@pr-commenter
Copy link

pr-commenter bot commented Oct 31, 2023

Benchmarks

Benchmark execution time: 2023-10-31 17:29:40

Comparing candidate commit 5e1aff9 in PR branch prof-8494-fix-version-priority with baseline commit b3f6536 in branch main.

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

@nsrip-dd nsrip-dd marked this pull request as ready for review October 31, 2023 17:32
@nsrip-dd nsrip-dd requested a review from a team as a code owner October 31, 2023 17:32
Copy link
Member

@felixge felixge left a comment

Choose a reason for hiding this comment

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

Thanks! LGTM, but see questions.

profiler/profiler.go Outdated Show resolved Hide resolved
profiler/profiler.go Outdated Show resolved Hide resolved
Tags are normalized somewhere along the profile intake path. Also,
WithTags can be used to provide multiple tags with the same key, which
is behavior we should keep for compatibility in most cases. But for the
version tag case in particular, we really only want one. So, keep only
the first one we see if a tag is only provided via WithTags.
@nsrip-dd nsrip-dd enabled auto-merge (squash) November 1, 2023 15:59
@nsrip-dd nsrip-dd merged commit d082416 into main Nov 1, 2023
51 of 52 checks passed
@nsrip-dd nsrip-dd deleted the prof-8494-fix-version-priority branch November 1, 2023 16:04
@darccio darccio restored the prof-8494-fix-version-priority branch November 16, 2023 16:16
@darccio darccio deleted the prof-8494-fix-version-priority branch November 16, 2023 16:19
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

2 participants