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

internal/globalconfig: make statsTags un-changeable from outside of the globalconfig package #2842

Merged
merged 3 commits into from
Sep 6, 2024

Conversation

mtoffl01
Copy link
Contributor

@mtoffl01 mtoffl01 commented Sep 3, 2024

What does this PR do?

  • globalconfig.SetStatsTags(tags []string) now makes a copy of tags before setting it as the value of cfg.statsTags
  • globalconfig.StatsTags() now returns a copy of cfg.statsTags

Motivation

Failure to perform the copying specified above resulted in pollution of the globalconfig statsTags.
#2836

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.

Unsure? Have a question? Request a review!

@mtoffl01 mtoffl01 marked this pull request as ready for review September 3, 2024 17:52
@mtoffl01 mtoffl01 requested a review from a team as a code owner September 3, 2024 17:52
@pr-commenter
Copy link

pr-commenter bot commented Sep 3, 2024

Benchmarks

Benchmark execution time: 2024-09-03 18:17:12

Comparing candidate commit ec94a25 in PR branch mtoff/global-statstags with baseline commit 2c85bdc in branch main.

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

scenario:BenchmarkSetTagString-24

  • 🟥 execution_time [+2.661ns; +4.759ns] or [+2.376%; +4.249%]

@rolandhawk
Copy link

@mtoffl01 how is this PR going on? 🙏

Copy link
Member

@darccio darccio left a comment

Choose a reason for hiding this comment

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

LGTM

@rolandhawk It'll be merged after my approval, and it'll get released during September.

@darccio darccio merged commit 2e876ef into main Sep 6, 2024
164 of 165 checks passed
@darccio darccio deleted the mtoff/global-statstags branch September 6, 2024 17:16
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.

3 participants