Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andrewthetechie/dd-metric
Rust binary that emits a metric to Datadog from cli args.
https://github.com/andrewthetechie/dd-metric
Last synced: about 1 month ago
JSON representation
Rust binary that emits a metric to Datadog from cli args.
- Host: GitHub
- URL: https://github.com/andrewthetechie/dd-metric
- Owner: andrewthetechie
- License: mit
- Created: 2022-07-14T02:47:29.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-01T19:37:39.000Z (5 months ago)
- Last Synced: 2024-08-02T00:13:26.691Z (5 months ago)
- Language: Rust
- Size: 161 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# dd-metric
Send a datadog metric via the datadog api.
Builds a CLI client
# Installation
Download the appropriate binary from a release. Builds are available for Linux, OSX, and Windows in amd64 and arm64 arch.
# Usage
Set your datadog API in your environment
```shell
export DD_API_KEY=yourapikey
``````shell
dd-metric 0.1.0
Andrew Herrington
Send a metric to datadog via the apiUses the datadog API to send either a gauge, counter, or histogram to the datadog api Sends one
metric per invocation Requires DD_API_KEY to be set in the environment to function.USAGE:
dd-metric [OPTIONS] --nameOPTIONS:
-h, --help
Print help information-n, --name
Name of the metric to send-o, --outputs
Optional places to output the metric to as a comma separated list of destinations. Valid
destinations are: stdout, api[default: api]
-t, --type
Type of the metric to send[default: counter]
--tags
Optional tags to add to sent metric in the format key:value,key2:value2[default: ]
-v, --value
Metric value[default: 1]
-V, --version
Print version information--verbose
Will print verbose output to stdout
```## Example
Send a counter metric with a value of 7 named test.test_counter
```shell
dd-metric --value 7 --name test.test_counter
```Tag a histogram metric
```shell
dd-metric --value 22 --type histogram --name test.test_historgram --tags 'tag1:value1,tag2:value2'
```Output only to stdout, no API calls. Good for testing
```shell
dd-metric --value 7 --name test.test_counter --outputs stdout
{"m":"test.test_counter","v":7,"e":1657943168,"t":[]}
counter test.test_counter sent to Datadog with value 7.0
```