Queries a Github Api rate_limit to find out how close you are to hitting your rate limit. Great for build servers when your not sure why something broke.
Use to create graphs like: or you can display multiple values on a single graph:
Plugins come with a YAML file and a python file. The YAML file is the configuration, the python file is the custom check code.
- Copy the
github_api.yaml
file to/etc/dd-agent/conf.d/
- Copy the
github_api.py
file to/etc/dd-agent/checks.d/
- Test your plugin
sudo -u dd-agent dd-agent check github_api
- The metrics will be available on the datadog webpage after several runs. Running several times from the command line speeds up that process.
- To check more than one API key, pass multiple token_names and tokens into instances. The plugin should scale to however many API tokens you need to monitor
instances:
- git_token_name: git_token1
git_token: 1234567890
- git_token_name: git_token2
git_token: 0987654321
- The metrics created will be
github_api.core_remaining.{git_token_name}
,github_api.search_remaining.{git_token_name}
,github_api.core_remaining.{git_token_name}
. {git_token_name}
will be the string passed into the plugin via theInstances:
section.- The plugin will run as often as the datadog agent.
- By default, the agent runs every 15 seconds.
- You can add
min_collection_interval: X
to theinit_config:
section of the YAML file to make sure to only run the plugin if X seconds has elapsed since the last run. Depending on agent execution time, a value of 45 may not happen every 3rd run, but instead flap between every 3rd and every 4th run.