Skip to content

tracing: Support sampling on Elastic APM#2049

Merged
bwplotka merged 3 commits intothanos-io:masterfrom
igorwwwwwwwwwwwwwwwwwwww:elastic-sampling
Jan 27, 2020
Merged

tracing: Support sampling on Elastic APM#2049
bwplotka merged 3 commits intothanos-io:masterfrom
igorwwwwwwwwwwwwwwwwwwww:elastic-sampling

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.

2 participants