Skip to content

Conversation

@dmehala
Copy link
Collaborator

@dmehala dmehala commented May 12, 2025

Description

Origin Detection allows to detect where the contaienr traces come from, and add container tags automatically to the local root span.

Resolves #193

Motivation

Feature request #193

Additional Notes

Jira ticket: APMAPI-1404

@dmehala dmehala requested a review from a team as a code owner May 12, 2025 12:35
@dmehala dmehala requested review from cataphract, dubloom, pablomartinezbernardo and wdhif and removed request for a team May 12, 2025 12:35
result.metadata[ConfigName::AGENT_URL] =
ConfigMetadata(ConfigName::AGENT_URL, url, origin);

/// Starting Agent X, the admission controller inject a unique identifier
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

  • find the datadog agent version

@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented May 12, 2025

Datadog Summary

✅ Code Quality    ✅ Code Security    ✅ Dependencies


Was this helpful? Give us feedback!

Origin Detection allows to detect where the contaienr traces come from,
and add container tags automatically to the local root span.
@pr-commenter
Copy link

pr-commenter bot commented May 12, 2025

Benchmarks

Benchmark execution time: 2025-05-13 10:01:06

Comparing candidate commit 29f6a50 in PR branch dmehala/origin-detection with baseline commit e14a5a4 in branch main.

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

@dmehala dmehala force-pushed the dmehala/origin-detection branch from 462041e to fdb6393 Compare May 12, 2025 12:37
@codecov-commenter
Copy link

codecov-commenter commented May 12, 2025

Codecov Report

Attention: Patch coverage is 72.72727% with 21 lines in your changes missing coverage. Please review.

Project coverage is 86.79%. Comparing base (e14a5a4) to head (29f6a50).

Files with missing lines Patch % Lines
src/datadog/platform_util.cpp 66.66% 18 Missing ⚠️
src/datadog/datadog_agent.cpp 85.71% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #214      +/-   ##
==========================================
- Coverage   87.02%   86.79%   -0.23%     
==========================================
  Files          80       80              
  Lines        5140     5210      +70     
==========================================
+ Hits         4473     4522      +49     
- Misses        667      688      +21     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@dubloom dubloom left a comment

Choose a reason for hiding this comment

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

Most of my comments are nit/picky ones.
However there is one env variable that is not set according to the specifications.

}
},
{
"name": "dev",
Copy link
Contributor

@dubloom dubloom May 13, 2025

Choose a reason for hiding this comment

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

I will be annoying but that would be cool to add documentation somewhere on how to use that (if it is supposed to be used by devs).
It does not need to be in that PR.

Co-authored-by: Louis Tricot <75956635+dubloom@users.noreply.github.com>
@dmehala dmehala requested a review from dubloom May 13, 2025 13:07
Copy link
Contributor

@dubloom dubloom left a comment

Choose a reason for hiding this comment

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

LGTM

#endif
} // namespace

Optional<std::string> find_docker_container_id(std::istream& source) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Optional<std::string> find_docker_container_id(std::istream& source) {
// this function only exists for testing purposes
Optional<std::string> find_docker_container_id(std::istream& source) {

Copy link
Collaborator Author

@dmehala dmehala May 15, 2025

Choose a reason for hiding this comment

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

That's litterally mentionned in the header file:

/// This function is exposed mainly for testing purposes.

@dmehala dmehala merged commit 6a724a4 into main May 15, 2025
22 checks passed
@dmehala dmehala deleted the dmehala/origin-detection branch May 15, 2025 15:01
@dmehala dmehala mentioned this pull request May 15, 2025
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.

[FEATURE]: Support origin discovery via entity-id or container-id

5 participants