-
-
Couldn't load subscription status.
- Fork 431
Export Prometheus telemetry in daemon mode #573
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
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.
Added some change requests.
I see that prometeus does not keep stats when terminated (so metrics are reset on each run), is this expected?
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.
Left few comments but looks good overall
…andler configured
| ) | ||
|
|
||
| # we block here until the test function using this fixture has returned | ||
| yield runner |
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.
🍰
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.
🚀
This PR implements the basis for a telemetry feature for the CLI in
daemonmode.Rationale:
Enhance the observability of the CLI internals at runtime, as we are proceeding internally to integrate the CLI as a gRPC server in all our services.
Module
telemetryLeverages https://github.com/segmentio/stats library to configure and expose a Prometheus endpoint when activated (in
cli/daemon/daemon.go). It also provides helpers for transformation ofcommandsinput data instats.Tagsobjects, using the installation id and secret generated by theinventorymodule.The telemetry activation and endpoint config are available via CLI configuration.
Module
repertory(feel free to ask for a name change 😄)inventoryThis module leverages an additional Viper instance, in order to create a configuration repository that contains values that may create confusion in the user-facing
arduino-cli.yamlfile, polluting it.This is the case for the
installationvalues stored in theinventory.yamlfile, that are used to generate server specific UUIDs that help the monitoring tools to perform statistics aggregation, when monitoring multiple CLI gRPC server instances.The inventory file is created at the CLI first launch and it is stored in the
directories.Datafolder.Instrumentation
Code instrumentation is done via standard
statsapis for each command (only for thecompileandboard listin this PR):successtag according to each casestatsengineTests
test_inventory_creation: python integ testtest_inventory_prometheus_endpoint: python integ testNotes