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

feat: opentelemetry integration #346

Closed
wants to merge 8 commits into from

Conversation

PacoDu
Copy link
Contributor

@PacoDu PacoDu commented Nov 11, 2020

Mercurius works with existing tools like @autotelic/fastify-opentelemetry and @opentelemetry/instrumentation-graphql. But it's missing some mercurius specific spans and attributes that we can add with the opentelemetry API.

As a reference, here is an example of a mercurius trace with a gateway and a service and without any additional opentelemetry integration:
image

And here is an example with a simple mercurius - graphql span added to the main fastifyGraphql function and a cached attribute (see PR changes):
image

We need to define what we want to expose in opentelemetry traces (spans and attributes). And maybe add a telemetry option to mercurius so user can enable/disable telemetry ?

@PacoDu
Copy link
Contributor Author

PacoDu commented Nov 11, 2020

Depends on #341

@mcollina
Copy link
Collaborator

mcollina commented Dec 5, 2020

@Pablodu any updates on this one?

@PacoDu
Copy link
Contributor Author

PacoDu commented Dec 6, 2020

This is a demonstration of a span usage inside the mercurius library, I don't have time right now to push it further unfortunately.
If you want I can cleanup this PR and just add the tracer and the base mercurius span.

@PacoDu
Copy link
Contributor Author

PacoDu commented Dec 14, 2020

superseded by #363

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

Successfully merging this pull request may close these issues.

2 participants