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

Trace all Oban telemetry events #437

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

danschultzer
Copy link

@danschultzer danschultzer commented Dec 15, 2024

Stacked on #435 which needs to get in first. Check the latest commit for the changes here.

Oban triggers a lot of the ecto otel spans. I think we should set up spans for all internal events so we can have oban parent spans for these ecto spans.

The span names is just the telemetry event joined with ., e.g. oban.peer.election. Maybe there is a better convention for span names for these internal processes, or there may be some these telemetry events that should have a specific span names (and attributes).

I've also changed the telemetry handler id, I usually see tuples being used rather than binary.

Sidenote: I think a good future refactor would be to combine all the handlers into just one module instead, I don't think it is necessary to have this concept of Handler.attach vs just calling attach_many with all the oban events we want to listen to.

@danschultzer danschultzer changed the title Trace all Oban telemtry events Trace all Oban telemetry events Dec 16, 2024

case op do
:start ->
OpentelemetryTelemetry.start_telemetry_span(__MODULE__, Enum.join(Enum.reverse(rest), "."), metadata, %{kind: :consumer})
Copy link
Author

@danschultzer danschultzer Dec 16, 2024

Choose a reason for hiding this comment

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

Probably should add messaging.system attribute here to make it easy to filter?

Copy link
Author

Choose a reason for hiding this comment

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

Same goes for the plugin handler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant