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

fix: use AS::N subscriber for serialize events #1075

Conversation

robbkidd
Copy link
Member

Resolves #992

This mimicks a fair amount of the current ActionMailer and ActionView instrumentation.

The details for Context management (i.e. setting current span) are already handled by the OTel ActiveSupport instrumentation. Reuse the notifications subscriber here for ActiveModel serialization events.

Reworked the example app into two: one Rails which works with the usual SDK configuration and one standalone (no Rails) to demonstrate that the subscription needs to be made after the SDK configuration is complete. If the subscription is created during instrumentation install, the subscription's tracer will be a NO-OP API tracer and won't produce spans.

TODO:

  • review/update README and doc comments for accurate usage steps

The details for Context management (i.e. setting current span) are
already handled by the OTel ActiveSupport instrumentation. Reuse
the notifications subscriber here for ActiveModel serialization events.

Reworked the example app into two: one Rails which works with the usual
SDK configuration and one standalone (no Rails) to demonstrate that the
subscription needs to be made after the SDK configuration is complete.
If the subscription is created during instrumentation install, the
subscription's tracer will be a NO-OP API tracer and won't produce
spans.
@robbkidd robbkidd requested review from a team July 19, 2024 15:44
@robbkidd robbkidd added ruby Pull requests that update Ruby code fix labels Jul 19, 2024
@robbkidd robbkidd self-assigned this Jul 19, 2024
Copy link
Contributor

github-actions bot commented Sep 8, 2024

👋 This pull request 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 pull request will be closed eventually by the stale bot

@github-actions github-actions bot added the stale Marks an issue/PR stale label Sep 8, 2024
@arielvalentin
Copy link
Collaborator

@robbkidd mind taking a look at @kaylareopelle comments?

@github-actions github-actions bot removed the stale Marks an issue/PR stale label Sep 9, 2024
Copy link
Contributor

👋 This pull request 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 pull request will be closed eventually by the stale bot

@github-actions github-actions bot added the stale Marks an issue/PR stale label Oct 19, 2024
@arielvalentin arielvalentin added keep Ensures stale-bot keeps this issue/PR open and removed fix stale Marks an issue/PR stale labels Oct 19, 2024
robbkidd and others added 3 commits November 25, 2024 17:38
... but leave OTLP exporter gem in dependencies so that a curious person
can override without code changes to send to some OTLP receiver by
setting the appropriate environment variables.
@robbkidd robbkidd requested review from a team as code owners November 26, 2024 18:18
@kaylareopelle
Copy link
Contributor

@robbkidd - Example code is cleared from me!

It looks like there's a few other things you and @arielvalentin chatted about related to the subscriber and Railties. Is there more you'd like to do to address those questions? I'm not 100% following with a quick read, but happy to take a deeper look if that would help.

Copy link
Collaborator

@arielvalentin arielvalentin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A fast follow up to this would be adding some details in the README about what semantic attributes to expect being emitted by this instrumentation.

Otherwise I think we are good to go.

@arielvalentin
Copy link
Collaborator

@kaylareopelle I'm good merge if you are

@robbkidd
Copy link
Member Author

@kaylareopelle I think the ideas @arielvalentin and I had in conversations in this PR are not blockers to this PR and can/ought to be done in follow-ups.

@arielvalentin arielvalentin enabled auto-merge (squash) December 2, 2024 21:51
@arielvalentin arielvalentin merged commit 92d59eb into open-telemetry:main Dec 2, 2024
56 of 57 checks passed
@github-actions github-actions bot mentioned this pull request Dec 2, 2024
@robbkidd robbkidd deleted the ams-set-current-span-during-serialization-event branch December 3, 2024 02:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
keep Ensures stale-bot keeps this issue/PR open ruby Pull requests that update Ruby code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ActiveModelSerializer instrumentation does not make the span current
3 participants