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

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

dmehala
Copy link

@dmehala dmehala commented Feb 10, 2025

What does this PR do?

This is PR store the tracer configuration in an memfd file.

APMAPI-1070

Motivation

Process Discovery.

Note to reviewers

Sorry, I am not well-versed in Go. Please feel free to take over the pull request to ensure it aligns more closely with idiomatic practices and fits better within the codebase.

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.
  • For internal contributors, a matching PR should be created to the v2-dev branch and reviewed by @DataDog/apm-go.

Unsure? Have a question? Request a review!

@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Feb 10, 2025

Datadog Report

Branch report: dmehala/feat/process-discovery
Commit report: d3bd525
Test service: dd-trace-go

✅ 0 Failed, 5364 Passed, 73 Skipped, 1m 55.5s Total Time

@pr-commenter
Copy link

pr-commenter bot commented Feb 10, 2025

Benchmarks

Benchmark execution time: 2025-02-19 13:17:53

Comparing candidate commit 7bb75db in PR branch dmehala/feat/process-discovery with baseline commit e08fe35 in branch main.

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

scenario:BenchmarkOTelApiWithCustomTags/datadog_otel_api-24

  • 🟩 execution_time [-157.382ns; -121.618ns] or [-3.277%; -2.532%]

scenario:BenchmarkSetTagStringer-24

  • 🟥 execution_time [+4.419ns; +8.381ns] or [+3.154%; +5.980%]

@dmehala dmehala force-pushed the dmehala/feat/process-discovery branch from 9ba3247 to f6a9d79 Compare February 11, 2025 14:40
@dmehala dmehala marked this pull request as ready for review February 11, 2025 14:43
@dmehala dmehala requested review from a team as code owners February 11, 2025 14:43

metadata := TracerMetadata{
SchemaVersion: 1,
RuntimeId: "TBD", ///< Where to get it?
Copy link
Author

Choose a reason for hiding this comment

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

I need guidance here on how to get this the runtimeID.

Copy link
Member

Choose a reason for hiding this comment

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

globalconfig.RuntimeID()

Copy link
Author

Choose a reason for hiding this comment

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

addressed in 7bb75db

SchemaVersion: 1,
RuntimeId: "TBD", ///< Where to get it?
Language: "golang",
Version: "1.2.3",
Copy link
Author

Choose a reason for hiding this comment

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

ditto

Copy link
Member

Choose a reason for hiding this comment

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

For the tracer's version, it's in internal/version.Tag.

Copy link
Author

Choose a reason for hiding this comment

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

addressed in 7bb75db

Copy link
Member

@kakkoyun kakkoyun left a comment

Choose a reason for hiding this comment

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

Could you provide some context? What's the goal and intended use case for storing the config in an in-memory file?

@dmehala
Copy link
Author

dmehala commented Feb 12, 2025

@kakkoyun Process Discovery.

@dmehala dmehala requested a review from darccio February 13, 2025 16:42
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.

We should implement testing for this covering the different situations. You can use runtime.GOOS == "linux" to run the test only in Linux.


metadata := TracerMetadata{
SchemaVersion: 1,
RuntimeId: "TBD", ///< Where to get it?
Copy link
Member

Choose a reason for hiding this comment

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

globalconfig.RuntimeID()

SchemaVersion: 1,
RuntimeId: "TBD", ///< Where to get it?
Language: "golang",
Version: "1.2.3",
Copy link
Member

Choose a reason for hiding this comment

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

For the tracer's version, it's in internal/version.Tag.

ddtrace/tracer/tracer.go Outdated Show resolved Hide resolved
ddtrace/tracer/tracer.go Outdated Show resolved Hide resolved
internal/inmemoryfilelinux.go Outdated Show resolved Hide resolved
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