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

Add caller information to main API for improved telemetry #103

Merged
merged 1 commit into from
Jul 10, 2023
Merged

Conversation

kzu
Copy link
Member

@kzu kzu commented Jul 10, 2023

The message bus will already produce activity start/stop for key API invocations (Execute/Notify). This telemetry currently includes the recommended span code attributes, but it will log the Merq locations for those.

This means that monitoring the activities for a message bus Execute/Notify invocation will reveal source attributes that belong to Merq, rather than the actual place where those invocations happened. It would be much more useful to have the telemetry attributes be associated with the caller than the bus itself in these cases. By propagating these automatically (for example, a bus.Execute where the command handler performs bus.Notify) we can precisely know where a given event handler delivery action originated in the actual upstream call to the bus itself, revealing a key codepath that can be invaluable for diagnostics.

From the point of view of the activity and telemetry, at least with regards to these source code attributes, the bus becomes "transparent" in a way. This is more useful than monitoring method and line # for the bus implementation itself.

Closes #102

The message bus will already produce activity start/stop for key API invocations (Execute/Notify). This telemetry currently includes the [recommended span code attributes](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/span-general.md#source-code-attributes), but it will log the Merq locations for those.

This means that monitoring the activities for a message bus Execute/Notify invocation will reveal source attributes that belong to Merq, rather than the actual place where those invocations happened. It would be much more useful to have the telemetry attributes be associated with the caller than the bus itself in these cases. By propagating these automatically (for example, a bus.Execute where the command handler performs bus.Notify) we can precisely know where a given event handler delivery action originated in the actual upstream call to the bus itself, revealing a key codepath that can be invaluable for diagnostics.

From the point of view of the activity and telemetry, at least with regards to these source code attributes, the bus becomes "transparent" in a way. This is more useful than monitoring method and line # for the bus implementation itself.

Closes #102
@kzu kzu added the enhancement New feature or request label Jul 10, 2023
@kzu kzu enabled auto-merge (rebase) July 10, 2023 18:48
@kzu kzu merged commit 7f03d95 into main Jul 10, 2023
7 checks passed
@kzu kzu deleted the dev/caller branch July 10, 2023 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Observability: add caller information to main API for improved telemetry
1 participant