Skip to content

instrument rhai requests#1598

Merged
garypen merged 9 commits intomainfrom
garypen/rhai-tracing
Aug 24, 2022
Merged

instrument rhai requests#1598
garypen merged 9 commits intomainfrom
garypen/rhai-tracing

Conversation

@garypen
Copy link
Contributor

@garypen garypen commented Aug 24, 2022

If we add a tracing span to our rhai plugin, we can now reason (from a tracing span point of view) about requests within our rhai plugin. See the screenshot for what this looks like in jaeger.

Screenshot 2022-08-24 at 12 25 12

If your router doesn't have an active rhai script, then this trace won't appear.

I've set the trace at info level. I think that's reasonable, but happy to change that if people think that's the wrong level.

also: tidy up the rhai code a little to reflect recent renaming and to make this simpler.

Gary Pennington added 5 commits August 24, 2022 11:09
The rhai code had got a bit out of shape recently. This cleans things up
a bit. I've also added a couple of tracing spans for tracing request and
response processing.
to make it clearer what the span measures.
to see what that looks like in jaeger.
The rhai span doesn't need to duplicate the data from the supergraph
span. That means, it doesn't really have any useful information, but
that's what it is for now.
instrument looks like the right way to go, so get rid of the commented
out _span commands.
@garypen garypen self-assigned this Aug 24, 2022
@github-actions

This comment has been minimized.

Gary Pennington added 2 commits August 24, 2022 12:33
If you are processing multiple services in your rhai script, it will be
helpful to have an attribute which identifies which service the span
relates to.

It's already fairly clear from the position in the processing pipeline,
but a bit of extra information won't hurt.
Copy link
Contributor

@o0Ignition0o o0Ignition0o left a comment

Choose a reason for hiding this comment

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

Super neat! I feel like this kinda opens new possibilities wrt telemetry in rhai, which we can explore... soon ™️ !

@garypen garypen merged commit 5cb0065 into main Aug 24, 2022
@garypen garypen deleted the garypen/rhai-tracing branch August 24, 2022 16:33
@abernix abernix mentioned this pull request Aug 29, 2022
@abernix abernix added this to the v1.0.0-alpha.0 milestone Aug 29, 2022
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.

4 participants