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

Rails Data Export #832

Closed
leoluchini opened this issue Jan 22, 2024 · 2 comments
Closed

Rails Data Export #832

leoluchini opened this issue Jan 22, 2024 · 2 comments
Labels
help wanted Extra attention is needed instrumentation stale Marks an issue/PR stale

Comments

@leoluchini
Copy link

Hi everyone,

I'm currently working on implementing opentelemetry-instrumentation-rails ~> 0.30, and while it is functional, I would like to modify the way the data is exported.

Currently, when I check the dashboard with the data, it is grouped by controller name and action, as shown in the attached screenshot:

Screenshot 2024-01-22 at 09 08 27
This is the trace
Screenshot 2024-01-22 at 09 09 51

My current configuration is

OpenTelemetry::SDK.configure do |c|
  c.service_name = ENV.fetch('OTEL_SERVICE_NAME')
  c.use_all( {'OpenTelemetry::Instrumentation::Rack' => { url_quantization: lambda { |path, _env|  path.to_s } }})
end

Instead of displaying the controller name and action, I would prefer to have the HTTP action and the path, such as GET /ping. Is this customization possible? Any assistance would be greatly appreciated.

Feel free to let me know if you have any specific preferences or if there are additional details you'd like to include in the message.

@leoluchini leoluchini added the bug Something isn't working label Jan 22, 2024
@arielvalentin arielvalentin transferred this issue from open-telemetry/opentelemetry-ruby Jan 23, 2024
@arielvalentin arielvalentin added instrumentation help wanted Extra attention is needed and removed bug Something isn't working labels Jan 23, 2024
@arielvalentin
Copy link
Collaborator

Thanks again for reporting this issue.

I see here that the span name is being rewritten and I see why this is causing trouble for you, especially since it is not well documented.

Here is where the span name is being overridden and ignoring quantized span names:

rack_span.name = "#{payload[:controller]}##{payload[:action]}" unless request.env['action_dispatch.exception']

This is not compliant with the specification either so I think this needs to change but I think I need to discuss this with other maintainers today at the SIG and see what we think is the best direction to go here. When I have those details I will update this issue.

You will have to manually overwrite the span name in custom code as part of ActionController Base for now until we address this issue.

Copy link
Contributor

👋 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 keep label to hold stale off permanently, or do nothing. If you do nothing this issue will be closed eventually by the stale bot.

@github-actions github-actions bot added the stale Marks an issue/PR stale label Feb 23, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed instrumentation stale Marks an issue/PR stale
Projects
None yet
Development

No branches or pull requests

2 participants