opentelemetry-ruby-contrib icon indicating copy to clipboard operation
opentelemetry-ruby-contrib copied to clipboard

ActiveModelSerializer instrumentation does not make the span current

Open renchap opened this issue 1 year ago • 6 comments

Description of the bug

Spans occuring during a render call using AM:S are not set as children span of the AM:S render span

image

Here, the spans below the serializer are made by the serializer code.

Share details about your runtime

Operating system details: Linux, Ubuntu 20.04 LTS RUBY_ENGINE: "ruby" RUBY_VERSION: "3.2.2" RUBY_DESCRIPTION: "ruby 3.2.2 (2023-03-30 revision e51014f9c0) [arm64-darwin22]"

Share a simplified reproduction if possible

No reproduction, but the issue is that the event handler is setting itself as the current span here: https://github.com/open-telemetry/opentelemetry-ruby-contrib/blob/main/instrumentation/active_model_serializers/lib/opentelemetry/instrumentation/active_model_serializers/event_handler.rb#L14-L20

Pinging @robbkidd as he helped me on this

renchap avatar May 17 '24 17:05 renchap

Thanks for opening this, @renchap!

My hypothesis is that ActiveModelSerializers instrumentation is using an older style of AS::Notification event subscription and handling. It does not start the span in a way that makes the serialization span the current span while it is doing work. (And it should.)

robbkidd avatar May 17 '24 17:05 robbkidd

👋 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[bot] avatar Jun 17 '24 01:06 github-actions[bot]

Still a valid issue!

renchap avatar Jun 17 '24 07:06 renchap

👋 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[bot] avatar Jul 18 '24 01:07 github-actions[bot]

Still valid!

renchap avatar Jul 19 '24 09:07 renchap

👋 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[bot] avatar Aug 19 '24 01:08 github-actions[bot]