Glossary · E

Exporter (Prometheus)

Small program that reads metrics from a system without native Prometheus support and exposes them in the Prometheus format over HTTP.

By Obseria TeamUpdated

Definition

An exporter is a program that collects metrics from a system that does not expose Prometheus metrics itself, such as an operating system, database or hardware device, and translates them into the Prometheus exposition format. It serves them on an HTTP endpoint, usually /metrics, where Prometheus or a compatible agent scrapes them.

What is a Prometheus exporter?

An exporter is a bridge between a system and Prometheus. Many systems you want to monitor, such as the Linux kernel, MySQL, PostgreSQL, a load balancer or a network switch, have their own way of reporting statistics: /proc files, SQL status queries, SNMP or a JSON admin API. An exporter reads these statistics, converts them into Prometheus metrics with names, labels and types, and publishes them on an HTTP endpoint. Prometheus then scrapes this endpoint like any other target.

Exporters exist because you cannot add a client library to software you do not control. Your own applications usually expose metrics directly through a Prometheus or OpenTelemetry client library; exporters cover everything else.

How an exporter works

  1. Prometheus sends an HTTP GET request to the exporter, for example http://db-host:9104/metrics.
  2. The exporter queries the underlying system at that moment, for example by running SHOW GLOBAL STATUS on MySQL.
  3. It converts the results into the text-based exposition format and returns them.
  4. Prometheus stores the samples with the target labels job and instance.

A response looks like this:

# HELP node_filesystem_avail_bytes Filesystem space available to non-root users in bytes.
# TYPE node_filesystem_avail_bytes gauge
node_filesystem_avail_bytes{device="/dev/sda1",mountpoint="/"} 4.2e+10

Most well-written exporters collect data synchronously during the scrape instead of caching it, so every value is as fresh as the scrape. Expensive checks can be cached or moved to separate collectors.

Because the exporter runs on demand, the scrape interval effectively decides how often the monitored system is queried. A database exporter scraped every 15 seconds by two redundant Prometheus servers runs its status queries eight times per minute. For most systems this is negligible, but for very large schemas or slow management APIs it is worth checking the exporter's own duration metric and disabling collectors you do not need. Most exporters let you switch individual collectors on or off with command-line flags.

Common exporters

ExporterMonitorsTypical metrics
node_exporterLinux and Unix hostsCPU, memory, disk, filesystem, network
blackbox_exporterEndpoints from outsideHTTP, TCP, DNS and ICMP probe results and durations
mysqld_exporterMySQL and MariaDBConnections, queries, replication lag, InnoDB stats
postgres_exporterPostgreSQLConnections, transactions, locks, replication
JMX exporterJava applicationsJVM heap, GC, threads, MBeans
kube-state-metricsKubernetes objectsDeployment, pod and node status

Exporter metrics are only as useful as the context around them. Make sure each exporter is scraped with labels that identify the monitored system, not just the exporter process, for example the database cluster or the host role. Otherwise a sidecar exporter and a central probe can produce series that are hard to tell apart.

The Prometheus project maintains several exporters itself, the prometheus-community organization many more, and the Prometheus documentation lists a large number of third-party exporters.

Deployment patterns

  • Per host: node_exporter runs on every machine, in Kubernetes as a DaemonSet.
  • Sidecar: a database exporter runs next to the database in the same pod.
  • Central probe: a single blackbox_exporter or SNMP exporter queries many remote targets, which are passed as URL parameters.
  • Embedded: some software ships a built-in /metrics endpoint, which removes the need for a separate exporter.

Writing your own exporter

If no exporter exists for a system, writing one is straightforward with the official client libraries for Go, Java, Python or Ruby. Follow the Prometheus guidelines:

  • Use base units and suffixes: _seconds, _bytes, and _total for counters.
  • Prefix metrics with the exporter or system name, for example myapp_.
  • Expose raw counters, not pre-computed rates; Prometheus calculates rates itself.
  • Keep label values bounded. Labels with user IDs or URLs create high cardinality.
  • Expose an up-style metric for the backend, so a failing connection is visible.
  • Check the default port allocation list on the Prometheus wiki to avoid port collisions.

Exporters and OpenTelemetry

In OpenTelemetry, the word "exporter" means something different: a component in an SDK or the OpenTelemetry Collector that sends data out to a backend, for example the OTLP exporter. The Prometheus-style role is filled by Collector receivers, such as the host metrics receiver or database receivers. The Collector's Prometheus receiver can also scrape existing Prometheus exporters, so they can be reused in an OpenTelemetry pipeline.

How Obseria helps

The Obseria Agent and any OpenTelemetry Collector can scrape your existing Prometheus exporters and send the metrics to Obseria, where they are linked to the hosts, databases and services they describe. Prebuilt views for database monitoring and metrics monitoring work with common exporters. Details are in the Prometheus integration.

Frequently asked questions

A client library is built into your own application code and exposes its metrics directly. An exporter runs as a separate process and translates metrics from software you cannot instrument, such as a database or the operating system.

node_exporter is the official Prometheus exporter for Linux and Unix hosts. It exposes hardware and kernel metrics such as CPU, memory, disk, filesystem and network usage, by default on port 9100.

No. An exporter only serves metrics on an HTTP endpoint. Prometheus or another compatible agent pulls them at its configured scrape interval.

Yes. The OpenTelemetry Collector's Prometheus receiver scrapes exporter endpoints and converts the metrics into OpenTelemetry format, so existing exporters can stay in place.

Put these concepts into practice

Try Obseria free for 14 days, with OpenTelemetry and no proprietary agents.