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

Add missing tracing sampling APM config section #5211

Closed
1pkg opened this issue Jul 29, 2024 · 5 comments · Fixed by #5492
Closed

Add missing tracing sampling APM config section #5211

1pkg opened this issue Jul 29, 2024 · 5 comments · Fixed by #5492
Assignees
Labels
Team:Elastic-Agent Label for the Agent team

Comments

@1pkg
Copy link
Member

1pkg commented Jul 29, 2024

Describe the enhancement:

APM tracing config should additionally include a section for trace sampling to enable APM Server monitoring be configured with custom sampling rate when managed by Elastic Agent.

Describe a specific use case for the enhancement or feature:

Allow to specify a custom trace sampling rate to control the ingestion rate when self monitoring running APM Server.

What is the definition of done?

The custom sampling APM config section is handled correctly and used to configure tracing in APM Server.

@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent (Team:Elastic-Agent)

@pchila
Copy link
Member

pchila commented Sep 9, 2024

@1pkg Could you provide a sample configuration you would like elastic-agent to support?

There's also something else that is unclear: is tracing sampling a setting on the APM agent side or APM server side?
I assume you already know that all the components running under elastic-agent will receive the same settings if those are added to APM tracing config

/cc @ycombinator

@1pkg
Copy link
Member Author

1pkg commented Sep 9, 2024

@pchila sorry for the confusing sampling link in the description, what we really need is an additional config property in APM tracing config so we can control self-tracing head-based sampling rate.

A hypothetical configuration can look like this in yaml:

agent:
  monitoring:
    enabled: true
    traces: true
    apm:
      environment: test
      global_labels:
        k1: v1
        k2: v2
      sampling_rate: 0.2 # new property

@pchila
Copy link
Member

pchila commented Sep 10, 2024

@1pkg thanks for the clarification :)
Is sampling rate an optional config or will it be always set along with the other properties ?

@1pkg
Copy link
Member Author

1pkg commented Sep 10, 2024

@pchila, I'd say sampling_rate should be an optional field - yes, with a value in the range of [0.0, 1.0]. On our end if sampling rate is set, we'll then apply ratio sampler in the self-instrumentation tracer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Elastic-Agent Label for the Agent team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants