# APM using OpenTelemetry Collector with Kubernetes

Copy as Markdown[Open in ChatGPT](https://chatgpt.com/?q=Read%20https%3A%2F%2Fcoralogix.com%2Fdocs%2Fopentelemetry%2Fintegrations%2Fapm-kubernetes.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)[Open in Claude](https://claude.ai/new?q=Read%20https%3A%2F%2Fcoralogix.com%2Fdocs%2Fopentelemetry%2Fintegrations%2Fapm-kubernetes.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)

Coralogix [application performance monitoring](https://coralogix.com/docs/user-guides/apm/getting-started/apm-onboarding-tutorial.md) can attach pod and host context to every pillar of your [observability](https://coralogix.com/blog/what-is-observability/) data, so a slow span shows you the pod that served it and what that pod's memory was doing at the time.

The mechanism is resource attributes: the OpenTelemetry Collector's Kubernetes processor stamps each signal with the pod and node it came from, and Coralogix joins on those.

## What you need [​](#what-you-need- "Direct link to what-you-need-")

* [Kubernetes](https://kubernetes.io/) with [kubectl](https://kubernetes.io/docs/tasks/tools/#kubectl).
* [Helm](https://helm.sh/) installed and configured.
* A [metrics bucket](https://coralogix.com/docs/user-guides/data-flow/s3-archive/connect-s3-archive.md).
* [OpenTelemetry for Kubernetes](https://coralogix.com/docs/opentelemetry/kubernetes-observability/kubernetes-complete-observability-basic-configuration.md) installed and configured.

Note

Send logs, metrics, **and** traces. APM correlates across all three, with any one missing, the joins this page relies on do not resolve.

## View the correlated data [​](#view-the-correlated-data- "Direct link to view-the-correlated-data-")

1

<!-- -->

.

Open a trace

Select **Explore**, then **Tracing**, and select the trace you want to investigate.

2

<!-- -->

.

Open the pod and host panels

In the span detail pane, select the **POD** and **HOST** tabs, alongside **RELATED LOGS** and **SPAN LOGS**. Both **Spans view** and **Dependencies view** carry them.

[![Coralogix trace waterfall with the HOST tab open, showing memory used, total, free, and available charts for the node](/docs/assets/images/Untitled-23-1024x571-b0ae47c72acf4dcee15cb833c4d3cb39.webp)](https://coralogix.com/docs/assets/images/Untitled-23-1024x571-b0ae47c72acf4dcee15cb833c4d3cb39.webp)

Shows a span alongside the memory behavior of the node that ran it.

## Validate the correlation [​](#validate-the-correlation- "Direct link to validate-the-correlation-")

If any check below returns empty or unexpected results, the data being sent needs review.

### Resource attributes on spans[​](#resource-attributes-on-spans "Direct link to Resource attributes on spans")

Coralogix APM looks for `k8s.pod.name` and `k8s.node.name` on each span and uses them to find matching metrics and logs. If either is unset, correlation does not work.

Open a span in the Tracing UI and expand its resources.

[![Coralogix span resources panel listing Kubernetes deployment, namespace, node name, pod IP, pod name, start time, and UID](/docs/assets/images/Screenshot-2023-03-22-at-15.20.38-1024x726-f38eaa6573640aaa8a0fb2ede5974dde.webp)](https://coralogix.com/docs/assets/images/Screenshot-2023-03-22-at-15.20.38-1024x726-f38eaa6573640aaa8a0fb2ede5974dde.webp)

Shows the attribute set a correctly configured Collector produces.

### Host metrics[​](#host-metrics "Direct link to Host metrics")

APM needs metrics from [Kube State Metrics](https://github.com/kubernetes/kube-state-metrics) and the [Node Exporter](https://github.com/prometheus/node_exporter). Both ship with the [Coralogix Prometheus Operator](https://github.com/coralogix/telemetry-shippers/tree/master/metrics/prometheus/operator).

Run these in the Coralogix Grafana console, in order, each one's output feeds the next.

1

<!-- -->

.

Check Kube State Metrics reach the node

Confirm the KSM labels match the `k8s.node.name` attribute on your spans. The result carries an `internal_ip` label you need next.

```
kube_node_info{node="<your node name>"}
```

2

<!-- -->

.

Check Node Exporter metrics

Use the `internal_ip` from the previous result:

```
count(node_cpu_seconds_total{instance=~"<internal_ip>.+"}) by (instance)
```

3

<!-- -->

.

Check pod metrics

Confirm pod metrics arrive from KSM, and that the Collector's own pod metrics arrive in the expected format:

```
kube_pod_info{pod=~"<partialpodname>.*"}
```

```
k8s_pod_cpu_time_total{k8s_pod_name=~"<partialpodname>.*"}
```

## Related resources[​](#related-resources "Direct link to Related resources")

[Kubernetes complete observability: basic configuration](https://coralogix.com/docs/opentelemetry/kubernetes-observability/kubernetes-complete-observability-basic-configuration.md)[APM onboarding tutorial](https://coralogix.com/docs/user-guides/apm/getting-started/apm-onboarding-tutorial.md)[Kubernetes observability troubleshooting](https://coralogix.com/docs/opentelemetry/kubernetes-observability/troubleshooting.md)
