Send a datadog metric via the datadog api.
Builds a CLI client
Download the appropriate binary from a release. Builds are available for Linux, OSX, and Windows in amd64 and arm64 arch.
Set your datadog API in your environment
export DD_API_KEY=yourapikey
dd-metric 0.1.0
Andrew Herrington <[email protected]>
Send a metric to datadog via the api
Uses 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] --name <NAME>
OPTIONS:
-h, --help
Print help information
-n, --name <NAME>
Name of the metric to send
-o, --outputs <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>
Type of the metric to send
[default: counter]
--tags <TAGS>
Optional tags to add to sent metric in the format key:value,key2:value2
[default: ]
-v, --value <VALUE>
Metric value
[default: 1]
-V, --version
Print version information
--verbose
Will print verbose output to stdout
Send a counter metric with a value of 7 named test.test_counter
dd-metric --value 7 --name test.test_counter
Tag a histogram metric
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
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