---
title: Query Pixie data
source: https://docs.newrelic.com/docs/kubernetes-pixie/auto-telemetry-pixie/understand-use-data/query-pixie-data
---

You can build your own dashboard charts and [query](https://docs.newrelic.com/docs/using-new-relic/data/understand-data/query-new-relic-data) your persisted Pixie telemetry data using the query builder and the NerdGraph API.

New Relic persists select Pixie telemetry data for long-term storage. Find out more about the hybrid storage model for the New Relic Pixie integration [here](https://docs.newrelic.com/docs/kubernetes-pixie/auto-telemetry-pixie/understand-use-data/overview).

## Metrics and specifications

### HTTP metrics

Query for duration of inbound HTTP request. For example:

```sql
FROM Metric SELECT average(http.server.duration)
WHERE instrumentation.provider='pixie'
FACET service.name
```

| Event type          | Metric                                                                                                                                                               |
| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Metric name         | `http.server.duration`                                                                                                                                               |
| Spec                | [OpenTelemetry HTTP metric spec](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/semantic_conventions/http-metrics.md) |
| Description         | Measures the duration of the inbound HTTP request.                                                                                                                   |
| OTEL data type      | `MetricDataTypeDoubleSummary` with `min(quantile=0)` and `max(quantile=1)`                                                                                           |
| Unit                | milliseconds                                                                                                                                                         |
| Required attributes | `service.name`                                                                                                                                                       |
| Static attributes   | `instrumentation.provider` = `pixie`                                                                                                                                 |
| HTTP attributes     | `http.status_code`                                                                                                                                                   |
| Entity attributes   | `service.instance.id`  `k8s.cluster.name`  `k8s.namespace.name`  `k8s.pod.name`  `k8s.container.name`                                                                |

### JVM metrics

Query to measure the time spent in a given JVM garbage collectors in milliseconds. For example:

```sql
FROM Metric SELECT average(runtime.jvm.gc.collection)
WHERE instrumentation.provider = 'pixie' FACET service.name, gc
```

| Event type          | Metric                                                                                                                                                                                                                                        |
| ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Metric name         | `runtime.jvm.gc.collection`                                                                                                                                                                                                                   |
| Spec                | [opentelemetry.jvm.gc.collection](https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/instrumentation/runtime-metrics/library/src/main/java/io/opentelemetry/instrumentation/runtimemetrics/GarbageCollector.java) |
| Description         | Time spent in a given JVM garbage collector in milliseconds.                                                                                                                                                                                  |
| Unit                | milliseconds                                                                                                                                                                                                                                  |
| Required attributes | `service.name`                                                                                                                                                                                                                                |
| Static attributes   | `instrumentation.provider` = `pixie`                                                                                                                                                                                                          |
| JVM attributes      | `gc` = `young|full`                                                                                                                                                                                                                           |
| Entity attributes   | `service.instance.id`  `k8s.cluster.name`  `k8s.namespace.name`  `k8s.pod.name`  `k8s.container.name`                                                                                                                                         |

Query to find out the number of bytes in a given JVM memory area. For example:

```sql
FROM Metric SELECT average(runtime.jvm.memory.area)
WHERE type = 'used' AND instrumentation.provider = 'pixie'
FACET service.name
```

| Event type          | Metric                                                                                                                                                                                                                                      |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Metric name         | `runtime.jvm.memory.area`                                                                                                                                                                                                                   |
| Spec                | [opentelemetry-java-instrumentation](https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/instrumentation/runtime-metrics/library/src/main/java/io/opentelemetry/instrumentation/runtimemetrics/MemoryPools.java) |
| Description         | Bytes of a given JVM memory area.                                                                                                                                                                                                           |
| Unit                | bytes                                                                                                                                                                                                                                       |
| Required attributes | `service.name`                                                                                                                                                                                                                              |
| Static attributes   | `instrumentation.provider` = `pixie`                                                                                                                                                                                                        |
| JVM attributes      | `type` = `used|total|max`  `area` = `heap`                                                                                                                                                                                                  |
| Entity attributes   | `service.instance.id`  `k8s.cluster.name`  `k8s.namespace.name`  `k8s.pod.name`  `k8s.container.name`                                                                                                                                       |

### HTTP server span

Example query:

```sql
FROM Span SELECT uniques(name)
WHERE span.kind = 'server'
AND instrumentation.provider = 'pixie'
AND service.name = 'orders'
```

| Spec                | Semantic conventions for HTTP spans                                                         |
| ------------------- | ------------------------------------------------------------------------------------------- |
| Event type          | Span                                                                                        |
| Required attributes | `name` = `normalized HTTP path`  `service.name`  `trace.id`  `span.id`                      |
| Static attributes   | `span.kind` = `server`  `instrumentation.provider` = `pixie`                                |
| HTTP attributes     | `http.host`  `http.method`  `http.path`  `http.status_code`  `http.url`  `http.user_agent`  |
