• Home
  • Dynatrace API
  • Environment
  • Metrics v2
  • POST ingest data points

Metrics API - POST ingest data points

Pushes custom data points to Dynatrace.

Provided data points must follow the Metrics ingestion protocol. You don't have to register the metric first. After Dynatrace has ingested and processed the data, you can use it just like any other metrics in Dynatrace, such as in charts or metric events. You can also provide metadata for the ingested metric via the Settings API.

Prefer to ingest metrics right on the host?

You can also push the data points directly from a OneAgent-monitored host to the Extensions Execution Controller (EEC) OneAgent module over a secure channel using the local http://localhost:<port>/metrics/ingest endpoint, which doesn't require token authentication. The default port is 14499. Using this method, the Dynatrace reserved dt.entity.host=<host-ID> dimension is added to each metric. For more information, see OneAgent metric API.

To view datapoints of the ingested metric, you can use:

  • Data explorer
  • GET metric data points request of the Metric v2 API.

The request consumes a plain/text payload. The payload is limited to 1,000 lines.

POSTManaged https://{your-domain}/e/{your-environment-id}/api/v2/metrics/ingest
SaaS https://{your-environment-id}.live.dynatrace.com/api/v2/metrics/ingest
Environment ActiveGate https://{your-activegate-domain}/e/{your-environment-id}/api/v2/metrics/ingest

Authentication

To execute this request, you need an access token with Ingest metrics (metrics.ingest) scope. To learn how to obtain and use it, see Tokens and authentication.

Parameters

ParameterTypeDescriptionInRequired
bodystring

Data points, provided in the line protocol. Each line represents a single data point.

bodyrequired

Response

Response codes

CodeDescription
202

The provided metric data points are accepted and will be processed in the background.

400

Some data points are invalid. Valid data points are accepted and will be processed in the background.

Example

With this curl command, you'll ingest the cpu.temperature metric assigned to the HOST-06F288EE2A930951 dimension.

shell
curl -L -X POST 'https://mySampleEnv.live.dynatrace.com/api/v2/metrics/ingest' \ -H 'Authorization: Api-Token dt0c01.abc123.abcdefjhij1234567890' \ -H 'Content-Type: text/plain' \ --data-raw 'cpu.temperature,dt.entity.host=HOST-06F288EE2A930951,cpu=1 55'
Related topics
  • Metric ingestion protocol

    Learn how the data ingestion protocol for Dynatrace Metrics API works.

  • Custom metric metadata

    Provide metadata for your custom metric.