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: Support sampling on Elastic APM #2049

Merged
merged 3 commits into from
Jan 27, 2020

Conversation

igorwwwwwwwwwwwwwwwwwwww
Copy link
Contributor

@igorwwwwwwwwwwwwwwwwwwww igorwwwwwwwwwwwwwwwwwwww commented Jan 27, 2020

This is a patch to address #2039.

Tracing every request can be quite expensive. By introducing a sample rate (similar to what stackdriver and jaeger already support), the overhead and trace storage cost can be controlled.

This patch adds sampling for Elastic APM tracing.

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

  • tracing: Support sampling on Elastic APM with new sample_rate setting

Verification

  • I still need to run a proper integration test. Is there a standalone-ish way of running thanos locally that would enable such testing?
  • Since the default value for sample rate is 0, this will break anyone currently using the elastic APM backend. It might make sense to have a proper default value of 1 -- this applies to various settings on other tracing backends.

fixes thanos-io#2039

Signed-off-by: Igor Wiedler <iwiedler@gitlab.com>
Signed-off-by: Igor Wiedler <iwiedler@gitlab.com>
Signed-off-by: Igor Wiedler <iwiedler@gitlab.com>
Copy link
Member

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

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

That was kind of easy (((:

LGTM!

Thanks 👍

@bwplotka bwplotka merged commit 4a23b36 into thanos-io:master Jan 27, 2020
@igorwwwwwwwwwwwwwwwwwwww
Copy link
Contributor Author

Managed to verify that this works.

Surprisingly, the APM library will still emit empty traces for non-sampled events (basically a root span without children), but that appears to be by design.

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.

None yet

2 participants