> For the complete documentation index, see [llms.txt](https://docs.ionos.com/cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ionos.com/cloud/observability/monitoring-service/overview/metric-formats.md).

# Metric Formats

Various metric formats are employed in monitoring systems to measure performance, consumption, and other software properties. These formats serve as standardized ways to represent and transmit metric data. Here are some notable metric formats used in monitoring systems:

### Prometheus format

Prometheus, a widely used monitoring system, defines its format for metrics, including types like Counter, Gauge, Histogram, and Summary.

### JSON format

JSON is a lightweight, human-readable data-interchange format.

{% hint style="warning" %}
**Warning:** Compress JSON data using the Snappy protocol. Snappy provides fast compression and decompression, making storing and transmitting JSON data more efficient.
{% endhint %}

### OTLP format

The OpenTelemetry Protocol (OTLP) is the native format used by the OpenTelemetry Collector and SDKs. Metrics pushed to a pipeline's `/otlp/v1/metrics` endpoint are ingested directly, without conversion to the Prometheus remote-write format. OTel exponential histograms sent over OTLP are queryable as Prometheus native histograms in Grafana.

The following is a sample OTLP metrics payload:

```json
{
  "resourceMetrics": [
    {
      "resource": {
        "attributes": [
          { "key": "service.name", "value": { "stringValue": "my-service" } },
          { "key": "host.name", "value": { "stringValue": "my-host" } }
        ]
      },
      "scopeMetrics": [
        {
          "scope": { "name": "my-instrumentation-library" },
          "metrics": [
            {
              "name": "http_requests_total",
              "description": "Total HTTP requests",
              "sum": {
                "dataPoints": [
                  {
                    "attributes": [
                      { "key": "method", "value": { "stringValue": "GET" } },
                      { "key": "status", "value": { "stringValue": "204" } }
                    ],
                    "startTimeUnixNano": "1780673896711309000",
                    "timeUnixNano": "1780673896711309000",
                    "asDouble": 60
                  }
                ],
                "aggregationTemporality": 2,
                "isMonotonic": true
              }
            }
          ]
        }
      ]
    }
  ]
}
```

## Metric source classification

From a technical standpoint, there is no distinct categorization of metric sources. The group includes any device, software, or application. Each can generate and present metrics compatible with Prometheus. Nonetheless, in most instances, the Prometheus agent emerges as the optimal solution. Some common agents that are capable of producing Prometheus-compatible metrics are as follows:

* Prometheus
* Grafana Agent
* OpenTelemetry
* FluentBit

## Metrics examples

{% tabs %}
{% tab title="JSON" %}

```json
{
  "input": {
    "cpu.0": {
      "records": 8,
      "bytes": 2536
    }
  },
  "output": {
    "stdout.0": {
      "proc_records": 5,
      "proc_bytes": 1585,
      "errors": 0,
      "retries": 0,
      "retries_failed": 0
    }
  }
}
```

{% endtab %}

{% tab title="Prometheus (Metric Format)" %}

```prometheus
fluentbit_input_records_total{name="cpu.0"} 57 1509150350542
fluentbit_input_bytes_total{name="cpu.0"} 18069 1509150350542
fluentbit_output_proc_records_total{name="stdout.0"} 54 1509150350542
fluentbit_output_proc_bytes_total{name="stdout.0"} 17118 1509150350542
fluentbit_output_errors_total{name="stdout.0"} 0 1509150350542
fluentbit_output_retries_total{name="stdout.0"} 0 1509150350542
fluentbit_output_retries_failed_total{name="stdout.0"} 0 1509150350542
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.ionos.com/cloud/observability/monitoring-service/overview/metric-formats.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
