> ## Documentation Index
> Fetch the complete documentation index at: https://docs.honeycomb.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Send Metrics from Prometheus Clients

> Scrape metrics from your Prometheus client endpoints using the OpenTelemetry Collector and send them to a Honeycomb dataset for analysis.

If you have a system that is instrumented as a [Prometheus client](https://prometheus.io/docs/instrumenting/clientlibs/), you can use OpenTelemetry Collector to scrape metrics data from that client's endpoint and send it to a Honeycomb dataset.

## How It Works

Prometheus is a widely adopted open source metrics server with its own API and client libraries.
Prometheus clients expose their metrics on an HTTP endpoint.
Prometheus servers can then connect to that endpoint and store the metrics they provide.
OpenTelemetry Collector acts like a Prometheus server, and will transform Prometheus metrics signals into OpenTelemetry Metrics signals, which can then be forwarded to Honeycomb over the OpenTelemetry Line Protocol (OTLP).

```mermaid actions={false} theme={}
flowchart LR
  subgraph S["Instrumented App"]
    A("Prometheus Metrics Endpoint")
  end
  A <-->|Scrape| B("OpenTelemetry Collector")
  B -->|OTLP| C("Honeycomb")
```

1. Instrumented app exposes a Prometheus endpoint, which is being scraped by OpenTelemetry Collector.
2. OpenTelemetry Collector sends data to Honeycomb over OTLP.

## Instrumenting Your Application as a Prometheus Client

Refer to the [Prometheus documentation](https://prometheus.io/docs/instrumenting/clientlibs/) to find details about the appropriate client library for your application.

## Installing and Running OpenTelemetry Collector

Find and download a recent release of OpenTelemetry Collector from the [Releases page on GitHub](https://github.com/open-telemetry/opentelemetry-collector/releases).

OpenTelemetry Collector requires a configuration file to run (find more details below).
If your configuration file exists in the current working directory at `otel_collector_config.yaml`, you can then run it using the following command:

```shell theme={}
otel-collector --config $(pwd)/otel_collector_config.yaml
```

[See more about using OpenTelemetry Collector with Honeycomb](/send-data/opentelemetry/collector/).

## Configuring OpenTelemetry Collector

To scrape Prometheus endpoints, you will need to configure OpenTelemetry Collector with a pipeline that starts with a [`prometheus` receiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/prometheusreceiver/README.md).
To forward scraped metrics to Honeycomb, your pipeline should end with an [`otlp` exporter](https://github.com/open-telemetry/opentelemetry-collector/blob/main/exporter/otlpexporter/README.md).
Pipelines are specified in an OpenTelemetry Collector configuration file.
Here is a bare bones example of a configuration file configured to scrape prometheus metrics and send them to Honeycomb:

```yaml theme={}
receivers:
  prometheus:
    config:
      scrape_configs:
        - job_name: "prometheus"
          scrape_interval: 15s
          static_configs:
            - targets: ["0.0.0.0:9100"] # this is the endpoint to scrape

exporters:
  otlp/metrics:
    endpoint: "api.honeycomb.io:443" # US instance
    #endpoint: "api.eu1.honeycomb.io:443" # EU instance
    headers:
      "x-honeycomb-team": "YOUR_API_KEY"
      "x-honeycomb-dataset": "DESTINATION_DATASET_NAME"

service:
  pipelines:
    metrics:
      receivers: [prometheus]
      processors: []
      exporters: [otlp/metrics]
```
