-
Notifications
You must be signed in to change notification settings - Fork 197
Additional low-level instrumentation spans created for some instrumentation libraries #1502
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
Comments
There are many discussion about this challenges of having multiple client spans, which is likely why we have not attempted to address these: open-telemetry/opentelemetry-specification#110
The SDK does not have a good mechanism built in for sorting dependencies, and AFAIK libraries like Faraday do not have a way to let its middleware know which driver it is currently using let alone know if it is being instrumented or not. I think the best we are able to offer at the moment is to configure Faraday to create an Line 29 in c64487d
Of course if that has changed then yes, I would be happy to support that. As for the AWS SDK is concerned, I would have to ask from the AWS Ruby maintainers to see if they have any insights to share with us. cc: @jterapin @alextwoods |
Hi there! AWS SDK for Ruby here. From what I observed, when using both opentelemetry-instrumentation's To demonstrate: require 'aws-sdk-s3'
require 'opentelemetry-instrumentation-net_http'
require 'opentelemetry-instrumentation-aws_sdk'
require 'opentelemetry-exporter-otlp'
ENV['OTEL_TRACES_EXPORTER'] ||= 'console'
OpenTelemetry::SDK.configure do |c|
c.use 'OpenTelemetry::Instrumentation::Net::HTTP'
c.use 'OpenTelemetry::Instrumentation::AwsSdk', {
suppress_internal_instrumentation: true
}
end
otel_provider = Aws::Telemetry::OTelProvider.new
client = Aws::S3::Client.new(telemetry_provider: otel_provider)
client.list_buckets And its output:
I want to say this behavior only applies to AWS SDK V3 when using AWS service gems released after |
Hi @jterapin, Thanks for the follow up - I noticed this suppression config mechanism when checking out the implementation for AWS SDK instrumentation. I'm curious, could it be possible to have this be the default behavior? Currently the additional low-level instrumentation generates additional dependency metrics which affects costs for customers often unknowingly. We could document this better for new users but it seems less intuitive to have to manually suppress the internal spans, especially if the customer wants to use |
Hi @ezhang6811! Sorry for the delay. I wanted to circle back with my team to discuss and we all are in agreement that this is reasonable to change the default to I have been meaning to update this gem for unrelated changes so I will include this work to that backlog as well. |
Hi @jterapin, thanks for the update! Great to hear, I will update the Faraday instrumentation as well and discuss separately. Thanks! |
👋 This issue has been marked as stale because it has been open with no activity. You can: comment on the issue or remove the stale label to hold stale off for a while, add the |
Some instrumentation libraries, when enabled along with Net:Http instrumentation, generate multiple spans for a single request.
For example, both Faraday and AWS SDK instrumentation libraries generate multiple client spans (and thus multiple metrics) due to the underlying Net:Http instrumentation that is also invoked.
Would it be possible to suppress the Net:Http instrumentation in these higher level libraries such as Faraday and AWS SDK to prevent these extra spans when both libraries are enabled?
The text was updated successfully, but these errors were encountered: