-
Notifications
You must be signed in to change notification settings - Fork 19
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
Attach to subscription publish events #145
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, thanks for your contribution! This looks great, I'd be happy to merge this, there are just a few things that need to be done:
- update the changelog(feel free to do a minor version bump while you're at it, so I can release once merged)
- since we're now also covering subscriptions I'd like to have some tests using them, so we can make sure other attributes function as expected with them
If you don't feel up for making these changes let me know I can take over on this
lib/instrumentation.ex
Outdated
@@ -99,6 +115,7 @@ defmodule OpentelemetryAbsinthe.Instrumentation do | |||
{:"graphql.request.variables", Jason.encode!(variables)} | |||
) | |||
|> put_if(config.trace_request_query, {@graphql_document, document}) | |||
|> put_if(true, {:"graphql.event.type", config.type}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be
|> put_if(true, {:"graphql.event.type", config.type}) | |
|> List.insert_at(0, {:"graphql.event.type", config.type}) |
Thanks @MaeIsBad , that’s all great feedback. If you don’t mind could I ask you to take this over? That would be very much appreciated |
Hey @aej! We released a |
Merge primait origin
feat: Status function to set status not based on errors
I noticed that this library doesn't currently attach to the
[:absinthe, :subscription, :publish]
events. I'm not sure if this is the best way of doing it but wanted to put up a PR to at least start a discussion.As you can see in the code ive added a custom attribute called "graphql.event.type" which is either "operation" or "publish".
"publish" events are essentially any time absinthe telemetry executes
[:absinthe, :subscription, :publish]
.For now this solves the problem for me but I'd be very happy to hear alternative ideas or suggestions on this.
Thanks!