-
-
Notifications
You must be signed in to change notification settings - Fork 398
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
daemon
mode.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
telemetry
Leverages 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 ofcommands
input data instats.Tags
objects, using the installation id and secret generated by theinventory
module.The telemetry activation and endpoint config are available via CLI configuration.
Module
repertory
(feel free to ask for a name change 😄)inventory
This 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.yaml
file, polluting it.This is the case for the
installation
values stored in theinventory.yaml
file, 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.Data
folder.Instrumentation
Code instrumentation is done via standard
stats
apis for each command (only for thecompile
andboard list
in this PR):success
tag according to each casestats
engineTests
test_inventory_creation
: python integ testtest_inventory_prometheus_endpoint
: python integ testNotes