DatadogHttp
A client for Datadog’s HTTP API, useful for building integrations.
This community library is not an official product or project of Datadog. Maintainers are not affiliated with Datadog in any way.
Supported endpoints
- [ ] Audit
- [ ] Authentication
- [ ] AuthN Mappings
- [ ] AWS Integration
- [ ] AWS Logs Integration
- [ ] Azure Integration
- [ ] Cloud Workload Security
- [ ] Dashboard Lists
- [ ] Dashboards
- [ ] Downtimes
- [ ] Embeddable Graphs
- [ ] Events
- [ ] GCP Integration
- [ ] Hosts
- [ ] Incident Services
- [ ] Incident Teams
- [ ] Incidents
- [ ] IP Ranges
- [ ] Key Management
- [ ] Logs
- [ ] Logs Archives
- [ ] Logs Indexes
- [ ] Logs Metrics
- [ ] Logs Pipelines
- [ ] Logs Restriction Queries
-
[ ] Metrics
- [ ] Create a tag configuration
- [ ] Get active metrics list
- [ ] Submit distribution points
- [x] Submit metrics
- [ ] Get metric metadata
- [ ] List tag configuration by name
- [ ] Edit metric metadata
- [ ] Update a tag configuration
- [ ] Delete a tag configuration
- [ ] Search metrics
- [ ] Get a list of metrics
- [ ] Query timeseries points
- [ ] List tags by metric name
- [ ] List active tags and aggregations
- [ ] List distinct metric volumes by metric name
- [ ] Configure tags for multiple metrics
- [ ] Tag Configuration Cardinality Estimator
- [ ] Monitors
- [ ] Notebooks
- [ ] Opsgenie Integration
- [ ] Organizations
- [ ] PagerDuty Integration
- [ ] Processes
- [ ] Roles
- [ ] RUM
- [ ] Screenboards
- [ ] Security Monitoring
- [ ] Service Accounts
- [ ] Service Checks
- [ ] Service Dependencies
- [ ] Service Level Objective Corrections
- [ ] Service Level Objectives
- [ ] Slack Integration
- [ ] Snapshots
- [ ] Synthetics
- [ ] Tags
- [ ] Timeboards
- [ ] Usage Metering
- [ ] Users
- [ ] Webhooks Integration
Installation
If available in Hex, the package can be installed
by adding datadog_http to your list of dependencies in mix.exs:
def deps do
[
{:datadog_http, "~> 0.0.1"}
]
endConfiguration
All calls to Datadog require an API key. Add the following configuration
to your project to set the values. This configuration is optional, see below for a
runtime configuration. The library will raise an error if the relevant credentials
are not provided either via config.exs or at runtime.
config :datadog_http,
base_url: "https://api.datadoghq.com",
api_key: "your_client_id",
adapter: Tesla.Adapter.Hackney, # optional
http_options: [timeout: 10_000, recv_timeout: 30_000] # optional
By default, base_url is set to the main datadog API endpoint (https://api.datadoghq.com).
Runtime configuration
Alternatively, you can provide the configuration at runtime. The configuration passed
as a function argument will overwrite the configuration in config.exs, if one exists.
For example, if you want to hit a different URL when calling the metrics submission endpoint, you could
pass in a configuration argument to DatadogHttp.Metrics.submit/2.
DatadogHttp.Metrics.submit(
[],
%{base_url: "https://api.datadoghq.eu", api_key: "an-api-key"}
)