-
Notifications
You must be signed in to change notification settings - Fork 157
Add tracing to plugin mode and improve config management #602
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 tracing to plugin mode and improve config management #602
Conversation
|
||
if (this.config.rendering.tracing.url) { | ||
const output: TraceCarrier = {}; | ||
propagation.inject(context.active(), output); |
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.
You are referencing this manual propagationcorrect?
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.
Yes
"timingMetrics": true, | ||
|
||
"tracing": { | ||
"url": "" |
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 we set url to http://localhost:4318/v1/traces for dev.json automatically in dev
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.
We could as this is not generating errors when you don't have Tempo set up. We should update the doc though to explain how to set up the environment to get traces. We could add this URL there as well.
@@ -118,6 +126,9 @@ const envConfig: Record<Mode, Keys<RenderingConfig>> = { | |||
verboseLogging: 'GF_PLUGIN_RENDERING_VERBOSE_LOGGING', | |||
dumpio: 'GF_PLUGIN_RENDERING_DUMPIO', | |||
timingMetrics: 'GF_PLUGIN_RENDERING_TIMING_METRICS', | |||
tracing: { | |||
url: 'GF_PLUGIN_RENDERING_TRACING_URL', |
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.
How is this linked to
[plugin.grafana-image-renderer]
rendering_tracing_url
? Where is it being set?
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.
In the Grafana codebase, the config fields for plugins (so in sections starting with plugin.
) are automatically converted to env variables to be used by plugins. They follow the syntax GF_PLUGIN_<config field in upper case>
I tested as a remote server and as a plugin and they look good. |
To make it work in Docker, you need to update the URL to |
* Add tracing * changed url ingestion and tried to extract traceparent * removing unused code * remove unused packages and add logs * add tracing info to logs and tracing configuration * fix config override * fix argv.config * fix trace initialization and starting * remove custom log format * update json * change url to env * Apply suggestions from code review Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com> * fix yarn file * prettier lint * add custom trace for browser * propagate traces back to Grafana * Add tracing to plugin mode and improve config management (#602) * add tracing to plugin mode * update dev.json * update imports * add tracing in CSV endpoints * fix tests * fix and simplify config * fix test * update config for docker * add to readme * update readme * update readme * prettier * update tracing * change config and docs * Update src/plugin/v2/grpc_plugin.ts Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com> * create new docker-compose for tracing * add serviceName to config * update yarn * Apply suggestions from code review Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com> * remove env servicename --------- Co-authored-by: Ezequiel Victorero <ezequiel.victorero@grafana.com> Co-authored-by: AgnesToulet <35176601+AgnesToulet@users.noreply.github.com>
* Add tracing * changed url ingestion and tried to extract traceparent * removing unused code * remove unused packages and add logs * add tracing info to logs and tracing configuration * fix config override * fix argv.config * fix trace initialization and starting * remove custom log format * update json * change url to env * Apply suggestions from code review Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com> * fix yarn file * prettier lint * add custom trace for browser * propagate traces back to Grafana * Add tracing to plugin mode and improve config management (#602) * add tracing to plugin mode * update dev.json * update imports * add tracing in CSV endpoints * fix tests * fix and simplify config * fix test * update config for docker * add to readme * update readme * update readme * prettier * update tracing * change config and docs * Update src/plugin/v2/grpc_plugin.ts Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com> * create new docker-compose for tracing * add serviceName to config * update yarn * Apply suggestions from code review Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com> * remove env servicename --------- Co-authored-by: Ezequiel Victorero <ezequiel.victorero@grafana.com> Co-authored-by: AgnesToulet <35176601+AgnesToulet@users.noreply.github.com>
This PR adds tracing to the plugin mode and update a few things from the original PR:
tracer
variable if tracing is disabledWhat remains:
To test the plugin on Mac:
Makefile
to setARCH = darwin-arm64-unknown
make build_package
dist
foldergrafana-image-renderer
[rendering]
section