-
-
Notifications
You must be signed in to change notification settings - Fork 406
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
Merged
Merged
Changes from 38 commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
ba172c3
Apply cosmetics
2c6634d
Implement ugly telemetry POC
11d1bdb
Added prefix and moved Insrumentation inside the command package
bb6a490
Refactor the telemetry module
18cdce8
Implement configuration via Viper
1262ba6
Add stats flush in case of a not daemonized cli daemon proces
a9d1b31
Add repertory to store installation id and secret
74fe852
Repertory force write
ab0a98c
Cosmetics
315cf00
Use viper config for repertory dir
b961a48
Add test for repertory file creation
e1ea063
Add testing for telemetry deaemon and repertory
30e7a2b
Wait for repertory and kill daemon
eb33588
Updated pyinvoke to use async feature to test the daemon
8974523
Updated daemon test timeout
e98c271
Cosmetics
ead55a3
Set getDefaultArduinoDataDir as unexported
216303f
Cosmetics
18481c0
Cosmetics
c448704
Cosmetics
0aea65c
Lint on repertory module
855b377
Set SIGTERM as kill signal in case of win platform to overcome pyinvo…
b203b7e
Import platform as a module
d0f448c
Reverse platform if for signal value
dc61b78
Extract pid value
040dc85
Remove print leftover
2d0808a
Add better error handling in repertory creation
b3bbdc6
Update docs with old README extract
90477d5
Remove telemetry.pattern setting from docs
4d5af7a
Remove serverPattern config option for telemetry
0fdc125
Upgrade viper to 1.6.2
965a70f
Defer stats Increment in compile command and explicit set for success…
e1582e7
Fix board list help message
ce6f4fa
Implement stats flush anyway to leverage module no-op in case of no h…
4e7b4cf
Rename "repertory" module in "inventory" and refactor Sanitize function
aaed29d
Sanitize ExportFile in command/compile
8b425a7
Refactor daemon start fixture to include daemon process cleanup
0625b39
Use defer function to push success tag correctly updated
3300d4d
Use named return parameters to handle success tagging for a command stat
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -309,3 +309,40 @@ [email protected] downloaded | |
Installing [email protected]... | ||
Installed [email protected] | ||
``` | ||
|
||
|
||
Using the ``daemon`` mode and the gRPC interface | ||
------------------------------------------------ | ||
|
||
Arduino CLI can be launched as a gRPC server via the `daemon` command. | ||
|
||
The [client_example] folder contains a sample client code that shows how to | ||
interact with the gRPC server. Available services and messages are detailed | ||
in the [gRPC reference] pages. | ||
|
||
|
||
To provide observability for the gRPC server activities besides logs, | ||
the `daemon` mode activates and exposes by default a [Prometheus](https://prometheus.io/) | ||
endpoint (http://localhost:9090/metrics) that can be fetched for | ||
telemetry data like: | ||
|
||
```text | ||
# TYPE daemon_compile counter | ||
daemon_compile{buildProperties="",exportFile="",fqbn="arduino:samd:mkr1000",installationID="ed6f1f22-1fbe-4b1f-84be-84d035b6369c",jobs="0",libraries="",preprocess="false",quiet="false",showProperties="false",sketchPath="5ff767c6fa5a91230f5cb4e267c889aa61489ab2c4f70f35f921f934c1462cb6",success="true",verbose="true",vidPid="",warnings=""} 1 1580385724726 | ||
|
||
# TYPE daemon_board_list counter | ||
daemon_board_list{installationID="ed6f1f22-1fbe-4b1f-84be-84d035b6369c",success="true"} 1 1580385724833 | ||
``` | ||
|
||
The telemetry settings are exposed via the ``telemetry`` section | ||
in the CLI configuration: | ||
|
||
```yaml | ||
telemetry: | ||
enabled: true | ||
addr: :9090 | ||
``` | ||
|
||
[client_example]: https://github.com/arduino/arduino-cli/blob/master/client_example | ||
[gRPC reference]: /rpc/commands | ||
[Prometheus]: https://prometheus.io/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.