Collects detailed stats about step runtimes and reports them to datadog. Sends the following metrics for the step:
buildkite.steps.step.duration
- Distribution metric of the duration of the entire stepbuildkite.steps.checkout.duration
- Distrubution metric of the duration of the checkoutbuildkite.steps.command.duration
- Distrubution metric of the duration of the command
By default this tags each of those metrics with the following tags:
is_master
- Whether or not this branch ismaster
pipeline_slug
- The pipeline slug for the pipeline this step is running instep_label
- The label used for this particular stepretry_count
- The current retry countagent_queue
- The queue that the agent who ran this job came from
Add the following to your pipeline.yml
:
steps:
- command: ls
plugins:
- better/datadog-stats#v1.0.2:
dogstatsd_host: 'localhost'
This example assumes you set the PROJECT
environment variable to
something useful on your agents prior to the post-checkout
step. And
will add the tags project:<your PROJECT env var>
and
hard_coded_value:some_string
to all the metrics.
steps:
- command: ls
plugins:
- better/datadog-stats#v1.0.2:
dogstatsd_host: 'localhost'
additional_tags:
- tag: project
env_var: PROJECT
- tag: hard_coded_value
value: some_string
The host where this agent can reach a running instance of dogstatsd for reporting metrics to.
The port where this agent can reach dogstatsd on wherever is specified
in dogstatsd_host
. This defaults to the default port for dogstatsd
which is 8125
.
The base part of the metric that the plugin will report to datadog. This
defaults to buildkite.steps
.
This is an array of additional tags you want to send and where to find them in the environment variables. Each entry is an object with properties
tag
which is the tag name to send to datadogenv_var
which is the environment variable to pull the tag's value fromvalue
which is a static value to send for that tag
To run the tests:
docker-compose run --rm tests
To run shellcheck:
docker run --rm -v "$PWD:/mnt" koalaman/shellcheck:stable hooks/** lib/**
- Fork the repo
- Make the changes
- Run the tests
- Commit and push your changes
- Send a pull request