Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upExport Prometheus telemetry in daemon mode #573
Merged
Conversation
|
Added some change requests. I see that prometeus does not keep stats when terminated (so metrics are reset on each run), is this expected? |
|
Left few comments but looks good overall |
| ) | ||
|
|
||
| # we block here until the test function using this fixture has returned | ||
| yield runner |
This comment has been minimized.
This comment has been minimized.
|
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.


rsora commentedJan 31, 2020
•
edited
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 changeinventoryThis 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