← Datadog

Post Metric Data with Datadog API

Pipedream makes it easy to connect APIs for Datadog and 900+ other apps remarkably fast.

Trigger workflow on
HTTP requests, schedules and app events
Next, do this
Post Metric Data with the Datadog API
No credit card required
Into to Pipedream
Watch us build a workflow
Watch us build a workflow
7 min
Watch now ➜
Trusted by 250,000+ developers from startups to Fortune 500 companies:
Trusted by 250,000+ developers from startups to Fortune 500 companies

Developers Pipedream

Getting Started

Create a workflow to Post Metric Data with the Datadog API. When you configure and deploy the workflow, it will run on Pipedream's servers 24x7 for free.

  1. Configure the Post Metric Data action
    1. Connect your Datadog account
    2. Select a Metric
    3. Configure Points
  2. Select a trigger to run your workflow on HTTP requests, schedules or app events
  3. Deploy the workflow
  4. Send a test event to validate your setup
  5. Turn on the trigger

Integrations

Post Metric Data with Datadog API on New Requests (Payload Only) from HTTP / Webhook API
HTTP / Webhook + Datadog
 
Try it
Post Metric Data with Datadog API on New Message from Discord API
Discord + Datadog
 
Try it
Post Metric Data with Datadog API on New Message In Channels from Slack API
Slack + Datadog
 
Try it
Post Metric Data with Datadog API on New Message in Channel from Discord Bot API
Discord Bot + Datadog
 
Try it
Post Metric Data with Datadog API on New Submission from Typeform API
Typeform + Datadog
 
Try it

Details

This is a pre-built, open source component from Pipedream's GitHub repo. The component is developed by Pipedream and the community, and verified and maintained by Pipedream.

To contribute an update to an existing component or create a new component, create a PR on GitHub. If you're new to Pipedream component development, you can start with quickstarts for trigger span and action development, and then review the component API reference.

Post Metric Data on Datadog
Description:The metrics end-point allows you to post time-series data that can be graphed on Datadog's dashboards. [See docs](https://docs.datadoghq.com/metrics)
Version:0.1.0
Key:datadog-post-metric-data

Code

import datadog from "../../datadog.app.mjs";

export default {
  key: "datadog-post-metric-data",
  name: "Post Metric Data",
  description: "The metrics end-point allows you to post time-series data that can be graphed on Datadog's dashboards. [See docs](https://docs.datadoghq.com/metrics)",
  version: "0.1.0",
  type: "action",
  props: {
    datadog,
    metric: {
      propDefinition: [
        datadog,
        "metric",
      ],
    },
    points: {
      type: "object",
      label: "Points",
      description: "Points relating to a metric. The `key` should be the an Unix timestamp in seconds and `value` should be the point value. Example: `{ \"1640995200\": 1.0 , \"1640998800\": 1.1, \"1641002400\": 1.2 }`. This field will be converted to the expected value for Datadog API",
    },
  },
  methods: {
    convertMetricPoints(points) {
      return Object.keys(points).map((point) => ([
        parseFloat(point),
        parseFloat(points[point]),
      ]));
    },
  },
  async run({ $ }) {
    const response = await this.datadog.postMetricData({
      $,
      data: {
        series: [
          {
            metric: this.metric,
            points: this.convertMetricPoints(this.points),
          },
        ],
      },
    });

    $.export("$summary", `Posted to ${this.metric} timeseries`);

    return response;
  },
};

Configuration

This component may be configured based on the props defined in the component code. Pipedream automatically prompts for input values in the UI and CLI.
LabelPropTypeDescription
DatadogdatadogappThis component uses the Datadog app.
MetricmetricstringSelect a value from the drop down menu.
Pointspointsobject

Points relating to a metric. The key should be the an Unix timestamp in seconds and value should be the point value. Example: { "1640995200": 1.0 , "1640998800": 1.1, "1641002400": 1.2 }. This field will be converted to the expected value for Datadog API

Authentication

Datadog uses API keys for authentication. When you connect your Datadog account, Pipedream securely stores the keys so you can easily authenticate to Datadog APIs in both code and no-code steps.

About Datadog

Cloud monitoring as a service

More Ways to Use Datadog

Triggers

New Monitor Event (Instant) [Updated] from the Datadog API

Emit new events captured by a Datadog monitor

 
Try it