Skip to content
Download

Send OpenTelemetry from Kubernetes to your Mac

A pod cannot open a connection to your Mac, and your Mac is not on the cluster network. So nothing in Kubernetes points at Loggerhead directly. One collector inside the cluster does the crossing.

pods ──▶ collector in the cluster ──▶ tunnel ──▶ Loggerhead on your Mac

The pods send to a service name, which never changes. Only the collector knows about the tunnel.

Step 1: point the pods at the in-cluster collector

Section titled “Step 1: point the pods at the in-cluster collector”
deployment.yaml
env:
- name: OTEL_SERVICE_NAME
value: my-api
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: http://otel-collector.observability:4318
- name: OTEL_EXPORTER_OTLP_PROTOCOL
value: http/protobuf
- name: OTEL_RESOURCE_ATTRIBUTES
value: deployment.environment.name=staging

The environment tag decides which Loggerhead environment holds the records. A cluster is rarely your Local environment, so name it. See Workspaces and environments.

The branch collector in the cluster needs a route to your laptop. A mesh network such as Tailscale gives the Mac a stable address the cluster can reach.

The whole collector configuration, the route, and the check are on one page: Kubernetes branch.

  1. Open Collectors in Loggerhead. The branch appears with the count of records it forwarded.
  2. Open Logs and filter by the service name you set.

Connect your coding agent once, and it reads the same data as the window. See Claude Code.