For the complete documentation index, see llms.txt. This page is also available as Markdown.

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.

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:

{
  "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

Last updated

Was this helpful?