https://github.com/suzuki-shunsuke/dd-time
CLI tool to post the command execution time as time-series data to DataDog
https://github.com/suzuki-shunsuke/dd-time
cli datadog oss
Last synced: 3 months ago
JSON representation
CLI tool to post the command execution time as time-series data to DataDog
- Host: GitHub
- URL: https://github.com/suzuki-shunsuke/dd-time
- Owner: suzuki-shunsuke
- License: mit
- Created: 2019-11-28T11:56:50.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-11-20T21:14:10.000Z (over 2 years ago)
- Last Synced: 2024-06-20T11:13:51.094Z (11 months ago)
- Topics: cli, datadog, oss
- Language: Go
- Size: 119 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dd-time
[](https://cloud.drone.io/suzuki-shunsuke/dd-time)
[](https://codecov.io/gh/suzuki-shunsuke/dd-time)
[](https://goreportcard.com/report/github.com/suzuki-shunsuke/dd-time)
[](https://github.com/suzuki-shunsuke/dd-time)
[](https://raw.githubusercontent.com/suzuki-shunsuke/dd-time/master/LICENSE)CLI tool to post the command execution time as time-series data to DataDog.
`dd-time` is inspired to [circle-dd-bench](https://github.com/yuya-takeyama/circle-dd-bench).
## Install
Download the binary from [GitHub Release](https://github.com/suzuki-shunsuke/dd-time/releases).
## Getting Started
At first, please [prepare a Datadog API key](https://docs.datadoghq.com/account_management/api-app-keys/) and set the key as the environment variable `DATADOG_API_KEY`.
Let's try to use `dd-time`.
```
$ dd-time -t command:tutorial-dd-time -- sleep 5
```## Usage
```
$ dd-time --help
dd-time - post the command execution time as time-series data to DataDoghttps://github.com/suzuki-shunsuke/dd-time
USAGE:
dd-time [options] -- commandENVIRONMENT VARIABLE
DATADOG_API_KEY - DataDog API Key. If DATADOG_API_KEY isn't set, the metrics can't be sent to DataDog but the command is run normally
OPTIONS:
--help, -h show help
--version, -v print the version
--metric-name value, -m value (default: "command_execution_time") The name of the time series
--host value The name of the host that produced the metric
--tag value, -t value A tag associated with the metric
--output value, -o value The file path where the dd-time's standard error output is written
--append, -a Write the dd-time's standard error output by the appended mode
```## Tags for CircleCI
In CircleCI, there are many built-in environment variables.
https://circleci.com/docs/2.0/env-vars/#built-in-environment-variables
`dd-time` sets the following environment variables as tags automatically.
* CIRCLECI
* CIRCLE_BRANCH
* CIRCLE_BUILD_NUM
* CIRCLE_BUILD_URL
* CIRCLE_JOB
* CIRCLE_NODE_INDEX
* CIRCLE_NODE_TOTAL
* CIRCLE_PR_NUMBER
* CIRCLE_PR_REPONAME
* CIRCLE_PR_USERNAME
* CIRCLE_PROJECT_REPONAME
* CIRCLE_PROJECT_USERNAME
* CIRCLE_REPOSITORY_URL
* CIRCLE_SHA1
* CIRCLE_TAG
* CIRCLE_USERNAME
* CIRCLE_WORKFLOW_ID## License
[MIT](LICENSE)