<commit_before>---
title: Metrics
---

Post time series data.

### Authentication

Reporting access. (see [Authentication](/authentication/))

## Post a time series

### Request

<%= request 'POST', '/api/v1/series' %>

<%= request_headers 'Content-Type' => 'application/json' %>
<%= http_body <<eos
{
  "series": [
    {
      "metric": "metric.name",
      "points": [
         [ 
           POSIX timestamp,
           numeric value
         ], ...
      ],
      "type": "gauge",
      "host": "myhost.mydomain",
      "device": "eth0"
    }, ... ]
}
eos
%>

`host` and `device` are optional. The only currently supported `type` is "gauge".

### Response

<%= response_headers 201 %>
<commit_msg>Spell out metric types.<commit_after>---
title: Metrics
---

Post time series data.

### Authentication

Reporting access. (see [Authentication](/authentication/))

## Post a time series

### Request

<%= request 'POST', '/api/v1/series' %>

<%= request_headers 'Content-Type' => 'application/json' %>
<%= http_body <<eos
{
  "series": [
    {
      "metric": "metric.name",
      "points": [
         [ 
           POSIX timestamp,
           numeric value
         ], ...
      ],
      "type": "metric_type",
      "host": "myhost.mydomain",
      "device": "eth0"
    }, ... ]
}
eos
%>

`host` and `device` are optional.

`metric_type` must be one of `gauge` or `counter`.

### Response

<%= response_headers 201 %>

### Metric types & Numeric Values

Datadog supports two types of metrics: **gauges** and **counters**.

#### Counters

Use a **counter** when you are measuring a _positive integer_ that keeps increasing,
for instance the number of unique page views since the beginning of the month.

Usually the interesting measure is the rate of change of that counter and
Datadog can compute that rate for you. The rate will always be a positive number.

The numeric values will be cast as unsigned 64-bit integers.

#### Gauges

Use a **gauge** for values that can be measured independently of each other,
for instance wind speed, temperature, cpu utilization and free memory.

Most metric are gauges.

The numeric values will be cast as a signed, 64-bit floating point numbers.


{'fraction_non_alphanumeric': 0.1403107861060329, 'fraction_numerical': 0.006398537477148081, 'mean_word_length': 2.9229390681003586, 'pattern_counts': {'":': 12, '<': 15, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6470156', 'n_tokens_mistral': 694, 'n_tokens_neox': 652, 'n_words': 234}