---
title: Collect Linkerd proxy logs
source: https://docs.newrelic.com/docs/opentelemetry/integrations/linkerd/proxy-logs
---

This adds the `linkerd-proxy` sidecar container's own logs to New Relic, separate from the metrics and traces collected during install. It's scoped to just the proxy container, not your application's logs.

**NRDOT collector**

The NRDOT chart ships a `filelog` receiver enabled by default (`receivers.filelog.enabled: true`) that already collects every container's logs, including `linkerd-proxy`, from `/var/log/pods` on the node. Nothing to add to `values.yaml`.

**OpenTelemetry Collector Contrib**

Install a **second** Helm release in `mode: daemonset`. Save the following as `filelog-values.yaml`. Set `<YOUR_CLUSTER_NAME>` and `<YOUR_NR_INGEST_LICENSE_KEY>`, then install:

**Customise before applying:**

| Field              | Location               | What to set                                                   |
| ------------------ | ---------------------- | ------------------------------------------------------------- |
| `extraEnvs`        | `K8S_CLUSTER_NAME`     | Your Kubernetes cluster name                                  |
| `extraEnvs`        | `NEWRELIC_LICENSE_KEY` | Your New Relic ingest license key                             |
| `filter/onlyproxy` | processor              | Drops every log record except the `linkerd-proxy` container's |
| `resource/cluster` | processor              | Attaches `k8s.cluster.name` to every log record               |

```yaml
mode: daemonset
image:
  repository: otel/opentelemetry-collector-contrib

podSecurityContext:
  runAsNonRoot: true
  runAsUser: 10001
securityContext:
  allowPrivilegeEscalation: false
  readOnlyRootFilesystem: true
  capabilities:
    drop: [ALL]

extraVolumes:
  - name: varlogpods
    hostPath:
      path: /var/log/pods
extraVolumeMounts:
  - name: varlogpods
    mountPath: /var/log/pods
    readOnly: true

extraEnvs:
  - name: K8S_CLUSTER_NAME
    value: "<YOUR_CLUSTER_NAME>"
  - name: NEWRELIC_LICENSE_KEY
    value: "<YOUR_NR_INGEST_LICENSE_KEY>"

config:
  receivers:
    filelog:
      include: [/var/log/pods/*/*/*.log]
      include_file_path: true
      start_at: end
      operators:
        - type: container
          add_metadata_from_filepath: true

  processors:
    filter/onlyproxy:
      error_mode: ignore
      logs:
        log_record:
          - 'resource.attributes["k8s.container.name"] != "linkerd-proxy"'
    resource/cluster:
      attributes:
        - key: k8s.cluster.name
          value: "${env:K8S_CLUSTER_NAME}"
          action: insert
    batch: {}

  exporters:
    otlp_http/newrelic:
      endpoint: "https://otlp.nr-data.net:4318"
      headers:
        api-key: "${env:NEWRELIC_LICENSE_KEY}"

  service:
    pipelines:
      logs:
        receivers: [filelog]
        processors: [filter/onlyproxy, resource/cluster, batch]
        exporters: [otlp_http/newrelic]
```

```bash
helm upgrade my-opentelemetry-collector-logs open-telemetry/opentelemetry-collector \
  -f filelog-values.yaml -n newrelic --create-namespace --install
```

## Related documentation [#related]

[Install and configure Linkerd monitoring with NRDOT and Helm](https://docs.newrelic.com/docs/opentelemetry/integrations/linkerd/nrdot-helm)

Base install and configuration for metrics with the NRDOT Collector and Helm.

[Linkerd distributed tracing with OpenTelemetry](https://docs.newrelic.com/docs/opentelemetry/integrations/linkerd/distributed-tracing)

Enable proxy trace export and instrument your application pods.

[Find and query your data](https://docs.newrelic.com/docs/opentelemetry/integrations/linkerd/find-data)

Dashboard walkthrough, NRQL queries, and troubleshooting steps.
