Skip to content

feat: store tracer configuration in an in-memory file#184

Merged
dmehala merged 7 commits intomainfrom
dmehala/feat/process-discovery
Feb 15, 2025
Merged

feat: store tracer configuration in an in-memory file#184
dmehala merged 7 commits intomainfrom
dmehala/feat/process-discovery

Conversation

@dmehala
Copy link
Copy Markdown
Collaborator

@dmehala dmehala commented Feb 9, 2025

Description

Resolves APMAPI-1066

@dmehala dmehala requested a review from a team as a code owner February 9, 2025 18:52
@dmehala dmehala requested review from dubloom and removed request for a team February 9, 2025 18:52
@pr-commenter
Copy link
Copy Markdown

pr-commenter bot commented Feb 9, 2025

Benchmarks

Benchmark execution time: 2025-02-11 13:24:28

Comparing candidate commit 6f71825 in PR branch dmehala/feat/process-discovery with baseline commit f590dce in branch main.

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

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Feb 9, 2025

Codecov Report

❌ Patch coverage is 80.70175% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.62%. Comparing base (f590dce) to head (6f71825).
⚠️ Report is 97 commits behind head on main.

Files with missing lines Patch % Lines
src/datadog/platform_util.cpp 75.86% 7 Missing ⚠️
src/datadog/tracer.cpp 82.60% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #184      +/-   ##
==========================================
- Coverage   93.80%   93.62%   -0.18%     
==========================================
  Files          73       73              
  Lines        4195     4252      +57     
==========================================
+ Hits         3935     3981      +46     
- Misses        260      271      +11     

☔ 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
Copy Markdown
Contributor

@pablomartinezbernardo pablomartinezbernardo left a comment

Choose a reason for hiding this comment

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

LGTM, because although there's a couple of questions, being aware of those concerns is enough

}

Expected<InMemoryFile> InMemoryFile::make(StringView name) {
int fd = memfd_create(name.data(), MFD_CLOEXEC | MFD_ALLOW_SEALING);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Question: The RFC suggest to use libdatadog for this. Is this temporary or will the cpp tracer now follow that advice?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It suggest, doesn't enforce. Since dd-trace-cpp has no dependency on libdatadog, it will not be that efficient to use it.

return config.dump();
}

void Tracer::store_config() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can this lead to incorrect usage? If store_config is called twice, will that result in multiple descriptors for this process? If so, what are the implications of that?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Every call to this method will result in N file descriptors. Since Tracer::store_config() is a private method and we control how it’s called, I believe we can ensure it’s used correctly and avoid any unintended issues.

@dmehala dmehala merged commit f3ebccc into main Feb 15, 2025
2 checks passed
@dmehala dmehala deleted the dmehala/feat/process-discovery branch February 15, 2025 13:37
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