# OpenTelemetry Collector

Send everything your OpenTelemetry Collector receives to Flowhawk, and collect host and container metrics on the way.

If your services already send to a collector, Flowhawk is one more exporter. The collector keeps batching, retrying and any processing you do. Only the destination changes.

## What you get

- Traces, logs and metrics from every service behind the collector, matched to your [business flows](https://flowhawk.dev/docs/flows) by service and route.
- Host CPU, memory, disk and network, and Docker container stats, with ready-made dashboards for hosts and containers.
- Alerts, incidents and the on-call agent, which reads all of it when something breaks.

## Set it up

First create an ingest key: in the app, open **Settings > API keys** and pick **Services**. In the examples below, `KEY` stands for that key. Keep it out of your repository, like any other secret.

### 1. Add the exporter

```
exporters:
  otlphttp/flowhawk:
    endpoint: https://ingest.flowhawk.dev
    headers:
      Authorization: Bearer ${env:FLOWHAWK_API_KEY}

service:
  pipelines:
    traces:  { receivers: [otlp], processors: [batch], exporters: [otlphttp/flowhawk] }
    logs:    { receivers: [otlp], processors: [batch], exporters: [otlphttp/flowhawk] }
    metrics: { receivers: [otlp], processors: [batch], exporters: [otlphttp/flowhawk] }
```

Set `FLOWHAWK_API_KEY` in the collector's environment. gRPC works too: the `otlp` exporter with `endpoint: ingest.flowhawk.dev:443` and the same header.

### 2. Add host and container metrics (optional)

These receivers are in the contrib distribution (`otel/opentelemetry-collector-contrib`):

```
receivers:
  hostmetrics:
    collection_interval: 30s
    scrapers: { cpu: {}, memory: {}, disk: {}, filesystem: {}, network: {}, load: {} }
  docker_stats:
    endpoint: unix:///var/run/docker.sock

processors:
  resourcedetection:
    detectors: [env, system]

service:
  pipelines:
    metrics:
      receivers: [otlp, hostmetrics, docker_stats]
      processors: [resourcedetection, batch]
      exporters: [otlphttp/flowhawk]
```

A container reaches a service's page when it is named after the service.

### 3. Point your services at the collector

Each service's OpenTelemetry SDK sends to the collector (`OTEL_EXPORTER_OTLP_ENDPOINT=http://collector:4318`) and needs no key. Set `OTEL_SERVICE_NAME` on every service.

## Check it arrived

Open **Setup** in the app. It lists each service that sent data in the last 15 minutes. If yours isn't there, [Help and troubleshooting](https://flowhawk.dev/docs/help) says why telemetry can be refused (a wrong key, an empty balance) and how to see it.

## Common questions

### Can I keep sending to another backend?

Yes. List both exporters in a pipeline and the collector sends to each, which is the easy way to try Flowhawk next to what you have.

### Do I need the collector at all?

No. Services can send straight to `https://ingest.flowhawk.dev` ([language guides](https://flowhawk.dev/docs/languages)). A collector helps when you have many services, want host metrics, or keep secrets out of the services.

## Related

[**Kubernetes monitoring**Pod logs, node and pod metrics and your services' traces from a Kubernetes cluster, with two Helm charts you may already know.](https://flowhawk.dev/integrations/kubernetes-monitoring) [**Prometheus Remote Write**Send metrics you already collect with Prometheus or Grafana Alloy to Flowhawk with Remote Write 2.0.](https://flowhawk.dev/integrations/prometheus-remote-write) [**Docker container logs**Collect the logs of every container on a Docker host and send them to Flowhawk, named by container.](https://flowhawk.dev/integrations/docker-logs)

[Try it free for 14 days](https://app.flowhawk.dev/signup?trial=1) [Read the getting started guide](https://flowhawk.dev/docs/getting-started)

---

URL: https://flowhawk.dev/integrations/opentelemetry-collector
