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

[Tracing] Refactor DD_TAGS test cases for clarity #3954

Merged

Conversation

zacharycmontoya
Copy link
Contributor

Motivation

The tracing libraries are expected to parse DD_TAGS and assign them as span tags. Since this is both an agent setting and a tracer setting, the parsing logic is not trivial.

Changes

This PR refactors the test cases to indicate what the single DD_TAGS environment variable is and the resulting pairs of tags set on the spans.

Workflow

  1. ⚠️ Create your PR as draft ⚠️
  2. Work on you PR until the CI passes (if something not related to your task is failing, you can ignore it)
  3. Mark it as ready for review
    • Test logic is modified? -> Get a review from RFC owner. We're working on refining the codeowners file quickly.
    • Framework is modified, or non obvious usage of it -> get a review from R&P team

🚀 Once your PR is reviewed, you can merge it!

🛟 #apm-shared-testing 🛟

Reviewer checklist

  • If PR title starts with [<language>], double-check that only <language> is impacted by the change
  • No system-tests internal is modified. Otherwise, I have the approval from R&P team
  • CI is green, or failing jobs are not related to this change (and you are 100% sure about this statement)
  • A docker base image is modified?
    • the relevant build-XXX-image label is present
  • A scenario is added (or removed)?

@zacharycmontoya zacharycmontoya marked this pull request as ready for review February 1, 2025 00:11
@zacharycmontoya zacharycmontoya requested review from mabdinur and a team as code owners February 1, 2025 00:11
"key1:value1 key2:value2": [("key1", "value1"), ("key2", "value2")],
"env:test aKey:aVal bKey:bVal cKey:": [("env", "test"), ("aKey", "aVal"), ("bKey", "bVal"), ("cKey", "")],
"env:test,aKey:aVal,bKey:bVal,cKey:": [("env", "test"), ("aKey", "aVal"), ("bKey", "bVal"), ("cKey", "")],
"env:test,aKey:aVal bKey:bVal cKey:": [("env", "test"), ("aKey", "aVal bKey:bVal cKey:")],
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we also add some test scenarios for keys/values as numbers, booleans, special characters, and other edge cases?

Suggested change
"env:test,aKey:aVal bKey:bVal cKey:": [("env", "test"), ("aKey", "aVal bKey:bVal cKey:")],
"env:test,aKey:aVal bKey:bVal cKey:": [("env", "test"), ("aKey", "aVal bKey:bVal cKey:")],
"numKey:1,1:numVal,boolKey:true,true:boolVal": [("numKey", "1"), ("1", "numVal"), ("boolKey", "true"), ("true", "boolVal") ],
"": [],
"sp%key:value,key:sp#value": [], # I'm not sure what belongs here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, but I would prefer to do this in a separate PR. Some of the existing test cases are confusing to me, so I want to revisit the existing test cases and add to them as we build consensus

Copy link
Contributor

Choose a reason for hiding this comment

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

SGTM

@zacharycmontoya zacharycmontoya merged commit fc48211 into main Feb 4, 2025
289 of 292 checks passed
@zacharycmontoya zacharycmontoya deleted the zach.montoya/config-consistency-phase2-uptodate branch February 4, 2025 20:28
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