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

# Traefik proxy logs with OpenTelemetry

> Collect Traefik proxy access and error logs with the OpenTelemetry Collector and forward them to Bronto to analyze request latency, routing, and backend errors.

Collect Traefik access logs — routing decisions, backend responses, and latency — with the OpenTelemetry Collector. The same Collector can also forward traces and metrics from your apps — see [Connect OpenTelemetry Collector to Bronto](/agent-setup/open-telemetry).

## Prerequisites

* A Bronto account and API key ([how to create one](/Account-Management/API-Keys#create-a-new-api-key))
* Traefik writing access logs to a file in JSON format (Traefik logs to stdout by default — see below)
* An [OpenTelemetry Collector](https://opentelemetry.io/docs/collector/installation/) (recommended) or [Fluent Bit](https://docs.fluentbit.io/manual/installation/getting-started-with-fluent-bit) installed on the same host

Enable a JSON access log in `traefik.yaml`:

```yaml traefik.yaml theme={"dark"}
accessLog:
  filePath: /var/log/traefik/access.log
  format: json
```

## Configure the Collector

Traefik's JSON access log is one object per line — parse it with `json_parser`:

```yaml /etc/otel/config.yaml theme={"dark"}
receivers:
  filelog/traefik:
    include:
      - /var/log/traefik/access.log
    operators:
      - type: json_parser
    resource:
      service.name: traefik
      service.namespace: <YOUR_COLLECTION_NAME>

processors:
  batch:

exporters:
  otlphttp/brontologs:
    logs_endpoint: "https://ingestion.<REGION>.bronto.io/v1/logs"
    compression: gzip
    headers:
      x-bronto-api-key: <YOUR_API_KEY>

service:
  pipelines:
    logs:
      receivers: [filelog/traefik]
      processors: [batch]
      exporters: [otlphttp/brontologs]
```

Set `<REGION>` to `eu` or `us`.

## What you will see in Bronto

Open [Search](https://app.bronto.io/search) and filter by `service.name = traefik`. Each entry carries the client address (`ClientHost`), entrypoint, router and service names, method (`RequestMethod`), path (`RequestPath`), status (`DownstreamStatus`), duration (`Duration`), and backend URL. The JSON fields map directly to searchable attributes.

## Troubleshooting

* **No log file?** Traefik logs to stdout unless `accessLog.filePath` is set. Add the `accessLog` block above and set `format: json` for automatic field extraction.
* For general issues, see [OTel Collector troubleshooting](https://opentelemetry.io/docs/collector/troubleshooting/).

## Alternative: Fluent Bit

If you already run Fluent Bit, tail the Traefik access log and forward it over HTTP:

```ini fluent-bit.conf theme={"dark"}
[INPUT]
    name  tail
    path  /var/log/traefik/access.log
    tag   traefik

[OUTPUT]
    name        http
    match       traefik
    host        ingestion.<REGION>.bronto.io
    port        443
    tls         on
    format      json_lines
    compress    gzip
    header      x-bronto-api-key    <YOUR_API_KEY>
    header      x-bronto-dataset    traefik
    header      x-bronto-collection <YOUR_COLLECTION_NAME>
```

Set **Format** to `json_lines`, not `json`. See [Connect Fluent Bit to Bronto](/agent-setup/fluent-bit) for installation.
