Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

Awesome Lists containing this project

README

        

# dd-metric

Send a datadog metric via the datadog api.

Builds a CLI client



Latest Commit


GitHub release (latest by date)



GitHub Workflow Status Test and Lint (branch)
GitHub Workflow Status Build and Docker (main)


GitHub all releases
Docker Pulls
Docker Image Size (latest by date)

# 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 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

OPTIONS:
-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
```