-
Notifications
You must be signed in to change notification settings - Fork 140
Add ability to configure sampling rate based on transaction span name #1531
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 ability to configure sampling rate based on transaction span name #1531
Conversation
44add6f to
a6e3e78
Compare
a6e3e78 to
5b0fc25
Compare
|
I have this deployed in production. I thought everything was working until I realized that transactions that are under Requests in Rails seem to have their throughput heavily increased. For Sidekiq related transactions, everything seems fine though. @estolfo any suggestions? |
5b0fc25 to
74bc922
Compare
|
I think I found the issue. I wasn't setting the |
74bc922 to
a88baed
Compare
|
@estolfo any chance you could give some input on this? This is the only solution for moving to serverless if you rely on tail-based sampling. |
|
Hi @jclusso I'll be able to take a look within the next week. In the meantime, can you please rebase? Tests are passing on main now so they should be reliable for this PR as well. |
a88baed to
54bda9d
Compare
|
@estolfo i rebased it and the tests seem to be passing if I did everything correctly. |
|
Hi @jclusso thanks for this contribution. I've taken a look but I was wondering if you could explain a bit more what the goals are of this feature. The description says that you'd like to have different sample rates based on transaction name. But the code shows that the span name determines the sample rate on the transaction. |
The goal of the feature is to be able to sample based on transaction name. In Rails this commonly is a controller or worker name.
For Rails controllers, the transaction name appears to be set on the first span and the transaction name itself is Rack. Later on it gets set to the first span though. That is why this needs to look at the first span. |
|
Might also be worth noting that we're using this in production in two applications since early April. From what we can tell it appears to be working as described in my example config. |
|
run docs-build |
|
Hello, This is not available on gem 4.8.0. Is there a way to release it? Thanks |
What does this pull request do?
Adds new configuration option so you can set the sampling rate by transaction name. I'm not 100% certain this is the correct way to do this, so please let me know if I should be going about this in a different manner.
Why is it important?
When you have an application with certain portions that get a significant amount of traffic, there is currently no good way to control the sampling. Either you are blind to low volume transactions or have to collect a lot more samples than you need. You can currently get around this with Tail-based sampling, but this is not available on serverless. This also still requires you send a ton of data to your APM server that you may not need to.
Checklist
.rubocop.yml)Related issues
Resolves #1334