> For the complete documentation index, see [llms.txt](https://docs.groundcover.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.groundcover.com/collect-data/data-sources/profiling-endpoints.md).

# Profiling Endpoints

Send or scrape application profiles and uncover performance bottlenecks

Profiles show which functions in your application spend CPU time, allocate memory, or wait on locks. groundcover can receive profiles in two ways:

| Method                                                  | How it works                                                                    | Use it for                                    | Default  | Minimum sensor version |
| ------------------------------------------------------- | ------------------------------------------------------------------------------- | --------------------------------------------- | -------- | ---------------------- |
| [Push profiles](#push-profiles)                         | Your application sends pprof, OTLP Profiles, Pyroscope, JFR or Datadog profiles | Any application, inside or outside Kubernetes | Enabled  | 1.13.1                 |
| [Scrape Go pprof endpoints](#scrape-go-pprof-endpoints) | The sensor pulls pprof from annotated pods                                      | Go applications in Kubernetes                 | Disabled | 1.13.114               |

Both methods use the same profiling pipeline and attribute profiles to the source workload.

## Push profiles

Send profiles generated inside your Kubernetes cluster to the sensor. Send profiles generated outside the cluster to your BYOC endpoint.

### Where to send profiles

| Profiles generated             | Endpoint                                           | Authentication |
| ------------------------------ | -------------------------------------------------- | -------------- |
| Inside the Kubernetes cluster  | `groundcover-sensor.groundcover.svc.cluster.local` | Not required   |
| Outside the Kubernetes cluster | `{BYOC_ENDPOINT}`                                  | Ingestion key  |

Replace the service name or `groundcover` namespace if you use a different Helm release name or namespace. See [Ingestion Endpoints](/collect-data/byoc/ingestion-endpoints.md) for authentication methods and instructions for finding your BYOC endpoint.

### Accepted formats

* **Raw pprof:** A Google pprof protobuf body, uncompressed or gzip-compressed. Send it with `POST /profiling/upload` over HTTP port `8028` in-cluster or HTTPS port `443` externally. Include either the `workload` or `serviceName` query parameter.
* **OTLP Profiles over HTTP:** A protobuf-encoded OTLP `ExportProfilesServiceRequest` with `Content-Type: application/x-protobuf`. Send it with `POST /v1development/profiles` over HTTP port `4318` in-cluster or HTTPS port `443` externally.
* **OTLP Profiles over gRPC:** An OTLP Profiles export using `opentelemetry.proto.collector.profiles.v1development.ProfilesService/Export` on port `4317` in-cluster or port `443` externally.
* **Pyroscope Push:** A Pyroscope `PushRequest` with pprof profiles, as sent by Pyroscope SDKs that use the Push API, such as the Python SDK. The SDK sends it with `POST /push.v1.PusherService/Push` over HTTP port `8028`. Pyroscope Push is accepted only by the sensor, not by the BYOC endpoint, and requires sensor version 1.13.252 or later. See [Send profiles from Pyroscope SDKs](#send-profiles-from-pyroscope-sdks).
* **JFR:** A Java Flight Recorder recording, uncompressed or gzip-compressed, as uploaded by the Pyroscope Java agent. The agent sends it with `POST /ingest?format=jfr` over HTTP port `8028`. JFR is accepted only by the sensor, not by the BYOC endpoint, and requires sensor version 1.13.143 or later. See [Send JFR from the Pyroscope Java agent](#send-jfr-from-the-pyroscope-java-agent).
* **Datadog profiles:** The multipart upload that Datadog tracers and the Datadog Agent send, with pprof or JFR attachments, uncompressed or compressed with gzip, zstd or lz4. Datadog profiles are accepted only by the sensor, not by the BYOC endpoint. See [Send Datadog profiles](#send-datadog-profiles).

{% hint style="info" %}
The sensor on a [standalone Linux host](/getting-started/installation-and-updating/connect-linux-hosts.md) accepts Pyroscope Push, JFR and Datadog profiles too. Send them to `localhost` on the same ports. A standalone host has no pods, so each profile's workload is the service name your profiler sends.
{% endhint %}

{% hint style="info" %}
Raw pprof, Pyroscope Push, JFR and Datadog uploads are limited to 32 MiB before and after decoding. Each pprof can contain up to 64 sample types and 10,000 decoded sample rows. For Pyroscope Push, JFR and Datadog uploads, the size and row limits apply to all the profiles in one upload together.
{% endhint %}

### Send profiles from Pyroscope SDKs

Pyroscope SDKs that use the Push API, such as the Python SDK, can send their profiles to the sensor without code changes other than the server address. Point the SDK at the sensor and tag the profiles with the pod's namespace and name:

```python
import os
import pyroscope

pyroscope.configure(
    application_name="checkout",
    server_address="http://groundcover-sensor.groundcover.svc.cluster.local:8028",
    tags={
        "namespace": os.environ["POD_NAMESPACE"],
        "pod": os.environ["POD_NAME"],
    },
)
```

Set `POD_NAME` and `POD_NAMESPACE` from the pod's `metadata.name` and `metadata.namespace` fields, as in the [JFR example](#send-jfr-from-the-pyroscope-java-agent) below.

The sensor uses the `namespace` and `pod` tags to attribute the profiles to the pod's workload, such as its Deployment. Without them, the workload is the application name. On a standalone host, set `server_address` to `http://localhost:8028` and leave out the two tags. The other tags are stored as profile attributes, so you can filter flame graphs by them.

All the profiles in one request share the size and row limits, and a request over a limit is rejected whole.

#### Troubleshoot Pyroscope Push

The SDK logs rejected requests with the sensor's response. The sensor also logs each kind of rejection, at most once a minute, with the reason and the sender's tags:

```bash
kubectl logs -n groundcover -l app=sensor -c sensor --tail=-1 \
  | grep "Pyroscope Push"
```

On a standalone host, read the logs of the `groundcover-sensor` service:

```bash
sudo journalctl -u groundcover-sensor | grep "Pyroscope Push"
```

| Status | Message                                  | Meaning                                                                                               |
| ------ | ---------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| `404`  |                                          | The sensor doesn't support the Push API. Upgrade the sensor.                                          |
| `400`  | `invalid profile`                        | A profile in the request couldn't be decoded.                                                         |
| `400`  | `invalid series labels`                  | The request has no `service_name`, which the SDK sets from the application name, or has invalid tags. |
| `400`  | `profile is too large`                   | The request's profiles exceed 32 MiB.                                                                 |
| `400`  | `profile batch exceeds sample row limit` | The request's profiles together exceed the sample row limit.                                          |
| `429`  | `too many concurrent profile uploads`    | The sensor was processing another profile upload.                                                     |
| `503`  | `failed to write profiles`               | The sensor couldn't store the profiles.                                                               |

### Send JFR from the Pyroscope Java agent

[Set up the Pyroscope Java agent](https://grafana.com/docs/pyroscope/latest/configure-client/language-sdks/java/) in your JVM, then point it at the sensor, set the format to JFR, and label the profiles with the pod's namespace and name:

```yaml
env:
  - name: POD_NAME
    valueFrom:
      fieldRef:
        fieldPath: metadata.name
  - name: POD_NAMESPACE
    valueFrom:
      fieldRef:
        fieldPath: metadata.namespace
  - name: PYROSCOPE_SERVER_ADDRESS
    value: "http://groundcover-sensor.groundcover.svc.cluster.local:8028"
  - name: PYROSCOPE_FORMAT
    value: "jfr"
  - name: PYROSCOPE_LABELS
    value: "namespace=$(POD_NAMESPACE),pod=$(POD_NAME)"
```

The sensor uses the `namespace` and `pod` labels to attribute the profiles to the pod's workload, such as its Deployment. Without them, the workload is `PYROSCOPE_APPLICATION_NAME`. If you already set `PYROSCOPE_LABELS`, add the two labels to it. Keep `POD_NAME` and `POD_NAMESPACE` above `PYROSCOPE_LABELS`, because Kubernetes expands `$(VAR)` only for variables defined earlier in the list.

The sensor stores each JFR event as its own profile type. The agent records CPU (`cpu`) by default. The other events need agent settings: `PYROSCOPE_PROFILER_ALLOC` for allocations (`alloc_space`), `PYROSCOPE_ALLOC_LIVE=true` with it for the live heap (`inuse_sampled_objects`), and `PYROSCOPE_PROFILER_LOCK` for `synchronized` monitors (`mutex_*`) and `java.util.concurrent` locks (`block_*`).

#### Troubleshoot JFR uploads

The agent logs rejected uploads with the sensor's response, for example `Error uploading snapshot: 400 {"message":"invalid profile"}`.

| Status | Message                               | Meaning                                                                  |
| ------ | ------------------------------------- | ------------------------------------------------------------------------ |
| `400`  | `profile form file is required`       | The sensor doesn't support JFR. Upgrade the sensor.                      |
| `400`  | `invalid profile`                     | The recording couldn't be converted, or it exceeds the sample row limit. |
| `413`  | `profile is too large`                | The recording exceeds 32 MiB.                                            |
| `429`  | `too many concurrent profile uploads` | The sensor was processing another profile upload.                        |

The agent retries `429` and `5xx` responses and drops uploads rejected with any other status.

### Send Datadog profiles

The sensor accepts the profiles that Datadog's profilers upload, directly from the tracer or through the Datadog Agent, so you can keep your Datadog instrumentation and see its profiles in groundcover. This requires sensor version 1.13.250 or later, in Kubernetes or on a standalone Linux host. The BYOC endpoint doesn't accept Datadog profiles.

Profiles from the Go, Java, Python, Node.js, Ruby, .NET and PHP tracers and from the native `ddprof` profiler are supported.

#### Configure the tracer

A Datadog tracer sends profiles to the same agent address it sends traces to. For services that already profile with Datadog, point the tracer at the sensor:

```yaml
env:
  - name: DD_TRACE_AGENT_URL
    value: "http://groundcover-sensor.groundcover.svc.cluster.local:8126"
```

On a standalone host, use `http://localhost:8126`. Services that already [send traces directly to groundcover](/collect-data/data-sources/datadog/sending-directly-from-instrumented-services.md) need no change.

The sensor serves two Datadog routes:

| Route                      | Ports             | Sent by           |
| -------------------------- | ----------------- | ----------------- |
| `POST /profiling/v1/input` | `8126` and `8028` | Datadog tracers   |
| `POST /api/v2/profile`     | `8028`            | The Datadog Agent |

Port `8126` serves profiles only while `agent.sensor.apmIngestor.dataDog.enabled` and `agent.sensor.receivers.profiles.enabled` are both `true`, which is the default.

#### How profiles are attributed

The sensor attributes each upload to the pod that sent it, and from the pod to its workload, such as its Deployment. It finds the pod in this order:

1. The Kubernetes tags on the upload, which the Datadog Agent adds when it forwards it.
2. The container ID the tracer sends with the upload.
3. The pod at the sender's IP address.

If none of them names a pod, the profile is stored with the Datadog `service` as its workload. Pods on the host network share their node's address, so they are found only by the first two. A standalone host has no pods, so there the workload is always the Datadog `service`.

The tracer's own tags, such as the ones you set with `DD_TAGS`, are stored as profile attributes. `service`, `env`, `host` and `language` are stored as `service.name`, `deployment.environment.name`, `host.name` and `telemetry.sdk.language`.

#### Profile types

Datadog's tracers name the same measurement differently per language. The sensor stores them under common names, so one query works across languages:

| Measurement | Stored as                      |
| ----------- | ------------------------------ |
| CPU time    | `cpu`                          |
| Wall time   | `wall`                         |
| Allocations | `alloc_objects`, `alloc_space` |
| Live heap   | `inuse_objects`, `inuse_space` |

Other sample types keep the name the tracer gives them.

The Java tracer uploads JFR recordings. On top of the types above, Java can store:

| Stored as                                      | Recorded from                                                                                                                          |
| ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| `inuse_sampled_objects`, `inuse_sampled_space` | Live objects sampled by the JDK, stored when Datadog's profiler doesn't record the live heap. They aren't scaled up to the whole heap. |
| `mutex_*`, `block_*`                           | Time spent blocked on `synchronized` monitors and on `java.util.concurrent` locks, when the recording has these events.                |
| `monitor_wait_count`, `monitor_wait_time`      | `Object.wait()` calls longer than the tracer's threshold. Idle background threads show up here too.                                    |
| `file_io_count`, `file_io_time`                | File reads and writes longer than the tracer's threshold.                                                                              |
| `socket_io_count`, `socket_io_time`            | Socket reads and writes longer than the tracer's threshold.                                                                            |
| `exceptions`                                   | Thrown exceptions, with the class in the `exception.type` attribute. The message isn't stored.                                         |

When Datadog's profiler doesn't record allocations, the JDK's allocation events are stored instead, as `alloc_space` only.

#### Limits

* All the profiles in one upload share the 32 MiB limit, before and after decoding. An upload over it is rejected whole.
* All the profiles in one upload share the 10,000 sample row limit. A profile that exceeds it on its own is dropped and the upload's other profiles are stored. If the profiles exceed it only together, the upload is rejected whole.
* An upload can have up to 16 attachments.
* Datadog profiles aren't sampled. The trace `samplingRatio` doesn't apply to them.

To raise the row limit, set `agent.sensor.receivers.profiles.maxDecodedSampleRows`. Higher limits use more sensor memory.

#### Troubleshoot Datadog uploads

The tracer logs rejected uploads with the sensor's response. The sensor also logs the uploads it refuses and the profiles it can't decode or store:

```bash
kubectl logs -n groundcover -l app=sensor -c sensor --tail=-1 \
  | grep -E "Datadog (profile|JFR)"
```

On a standalone host, read the logs of the `groundcover-sensor` service:

```bash
sudo journalctl -u groundcover-sensor | grep -E "Datadog (profile|JFR)"
```

| Status | Message                                                                                               | Meaning                                                                                                            |
| ------ | ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| `404`  |                                                                                                       | The sensor doesn't serve the Datadog routes. Upgrade the sensor, and send to the sensor, not to the BYOC endpoint. |
| `400`  | `invalid profile attachments`                                                                         | None of the upload's profiles could be decoded, or each exceeds the sample row limit.                              |
| `413`  | `profile upload produces too many samples`                                                            | The upload's profiles together exceed the sample row limit.                                                        |
| `413`  | `profile upload is too large`, `profile attachments are too large`, `profile attachment is too large` | The upload exceeds 32 MiB.                                                                                         |
| `413`  | `too many profile attachments`                                                                        | The upload has more than 16 attachments.                                                                           |
| `413`  | `profile attachments decompress past the upload size limit`                                           | The upload exceeds 32 MiB after decompression.                                                                     |
| `503`  | `too many concurrent profile uploads`                                                                 | The sensor was processing another profile upload. Tracers that retry failed uploads, such as Go's, send it again.  |

## Scrape Go pprof endpoints

The sensor can periodically pull pprof profiles from Go applications that expose the standard `net/http/pprof` handlers. Each sensor scrapes only the annotated pods on its own node, at the pod IP, so a pod is never scraped by more than one sensor. The scraped profiles go through the same pipeline as raw pprof uploads and keep the source pod's namespace, pod, container and workload.

Scraping is disabled by default. To use it, expose pprof in your application, enable scraping in Helm, and annotate the pods to scrape.

### Expose pprof in your application

Import `net/http/pprof` and serve it on a dedicated port. Listen on all interfaces: the sensor connects to the pod IP, so a server bound to `localhost` can't be scraped.

```go
package main

import (
	"log"
	"net/http"
	_ "net/http/pprof" // registers the /debug/pprof/ handlers
)

func main() {
	go func() {
		log.Println(http.ListenAndServe(":6060", nil))
	}()

	// ... the rest of your application
}
```

{% hint style="info" %}
Go records block and mutex profiles only after your application enables them, for example with `runtime.SetBlockProfileRate(10000)` and `runtime.SetMutexProfileFraction(10)`. Until then those profiles have no samples and nothing is stored for them.
{% endhint %}

### Enable scraping

```yaml
agent:
  sensor:
    receivers:
      profiles:
        scrape:
          enabled: true
          interval: 1m
```

All settings are under `agent.sensor.receivers.profiles.scrape`:

| Setting                   | Default | Description                                                                                                                                                                                                                                                                                                 |
| ------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `enabled`                 | `false` | Scrape annotated pods.                                                                                                                                                                                                                                                                                      |
| `interval`                | `1m`    | How often each target is scraped, unless the pod sets its own. See [Change the scrape interval](#change-the-scrape-interval). The minimum is `10s`. A profile type whose timeout is longer than the interval isn't scraped on any pod: `cpu` needs at least `20s`, `block` and `mutex` need at least `40s`. |
| `defaultPort`             | `0`     | Port to scrape when a pod sets neither `<type>.port` nor `<type>.port_name`. See [Choose the port](#choose-the-port).                                                                                                                                                                                       |
| `extraAnnotationPrefixes` | `[]`    | Additional annotation prefixes to read. See [Use your own annotation prefix](#use-your-own-annotation-prefix).                                                                                                                                                                                              |

Only the sensor DaemonSet scrapes. Ingestor replicas never do.

### Annotate your pods

Opt pods in per profile type by adding annotations to the pod template:

```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: checkout
  namespace: shop
spec:
  selector:
    matchLabels:
      app: checkout
  template:
    metadata:
      labels:
        app: checkout
      annotations:
        profiles.groundcover.com/cpu.scrape: "true"
        profiles.groundcover.com/cpu.port: "6060"
        profiles.groundcover.com/memory.scrape: "true"
        profiles.groundcover.com/memory.port: "6060"
        profiles.groundcover.com/goroutine.scrape: "true"
        profiles.groundcover.com/goroutine.port: "6060"
    spec:
      containers:
        - name: checkout
          image: <YOUR_IMAGE>
          ports:
            - name: pprof
              containerPort: 6060
```

Each annotation is `profiles.groundcover.com/<type>.<setting>`. Settings don't carry over between profile types, so repeat `.port` and any other setting for each type you scrape.

| Annotation            | Description                                                                                                                                                                                 |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `<type>.scrape`       | Set to `"true"` to scrape this profile type. Any other value is ignored.                                                                                                                    |
| `<type>.port`         | Port number the pprof server listens on.                                                                                                                                                    |
| `<type>.port_name`    | Name of a TCP container port to scrape instead of a number.                                                                                                                                 |
| `<type>.path`         | Request path and query. Defaults to the type's path in the table below.                                                                                                                     |
| `<type>.scheme`       | `http` (default) or `https`. HTTPS targets are scraped without certificate verification, because pod IPs never match a serving certificate.                                                 |
| `<type>.sample_types` | Comma-separated pprof sample types to keep, for example `inuse_space,inuse_objects`. Unset keeps every sample type. A name the profile doesn't contain fails the scrape.                    |
| `<type>.interval`     | How often to scrape this profile type, for example `5m`. Defaults to the Helm `interval`. Requires sensor 1.13.130 or later. See [Change the scrape interval](#change-the-scrape-interval). |

The profile types and the requests the sensor sends by default:

| Type        | Default request                   | Profile    | Timeout |
| ----------- | --------------------------------- | ---------- | ------- |
| `cpu`       | `/debug/pprof/profile?seconds=10` | 10s window | 20s     |
| `memory`    | `/debug/pprof/heap`               | Snapshot   | 10s     |
| `goroutine` | `/debug/pprof/goroutine`          | Snapshot   | 10s     |
| `block`     | `/debug/pprof/block?seconds=30`   | 30s window | 40s     |
| `mutex`     | `/debug/pprof/mutex?seconds=30`   | 30s window | 40s     |

A windowed profile covers only its window once per interval. With the defaults, a CPU profile covers 10 seconds of every minute.

The sensor picks up new pods and annotation changes automatically.

{% hint style="warning" %}
Go runs only one CPU profile at a time. If another profiler already profiles the same process, such as a continuous profiling SDK or Grafana Alloy, CPU scrapes fail with `target_busy`. groundcover doesn't read Grafana's `profiles.grafana.com` annotations for this reason.
{% endhint %}

### Choose the port

The sensor picks the port for each profile type in this order:

1. The `<type>.port` annotation.
2. The `<type>.port_name` annotation.
3. The `defaultPort` Helm setting, if it isn't `0`.
4. A container port whose name ends with `-profiles`, then one whose name ends with `-metrics`, then one named `http2`.

If none applies, the target is skipped. To scrape without port annotations, give the pprof port a name ending with `-profiles`:

```yaml
spec:
  template:
    metadata:
      annotations:
        profiles.groundcover.com/cpu.scrape: "true"
        profiles.groundcover.com/memory.scrape: "true"
    spec:
      containers:
        - name: checkout
          image: <YOUR_IMAGE>
          ports:
            - name: go-profiles
              containerPort: 6060
```

Profiles are attributed to the running container that declares the scraped port, including native sidecars. If the port isn't declared, the profile is attributed to a container only when the pod has a single container. Declare the pprof port as a `containerPort` so profiles are attributed to the right container.

### Customize requests

Override the path, scheme or sample types for a profile type:

```yaml
annotations:
  profiles.groundcover.com/cpu.scrape: "true"
  profiles.groundcover.com/cpu.port_name: "pprof"
  profiles.groundcover.com/cpu.path: "/internal/pprof/profile?seconds=15"
  profiles.groundcover.com/cpu.scheme: "https"
  profiles.groundcover.com/memory.scrape: "true"
  profiles.groundcover.com/memory.port_name: "pprof"
  profiles.groundcover.com/memory.sample_types: "inuse_space,inuse_objects"
```

A path must start with `/`. For `cpu`, `block` and `mutex`, a path without `seconds` gets the type's default window. A `seconds` value must be at least `1` and leave 5 seconds of the type's timeout: up to `15` for `cpu` and `35` for `block` and `mutex`. Otherwise the target is skipped. The sensor masks every query value except `seconds` in its logs.

Redirects aren't followed. Request headers and authentication aren't supported.

### Change the scrape interval

Set `<type>.interval` to scrape a profile type more or less often than the Helm `interval`, for example to profile a critical workload more often:

```yaml
annotations:
  profiles.groundcover.com/cpu.scrape: "true"
  profiles.groundcover.com/cpu.port: "6060"
  profiles.groundcover.com/cpu.interval: "20s"
  profiles.groundcover.com/memory.scrape: "true"
  profiles.groundcover.com/memory.port: "6060"
  profiles.groundcover.com/memory.interval: "5m"
```

The value is a duration such as `20s`, `5m` or `1h`. It must be at least `10s` and at least the type's timeout: `20s` for `cpu`, `40s` for `block` and `mutex`. Otherwise the target is skipped.

`<type>.interval` requires sensor 1.13.130 or later. Older sensors ignore it and scrape at the Helm `interval`.

`<type>.interval` can't bring back a profile type that the Helm `interval` disabled. To scrape a few pods every `20s`, set `cpu.interval: "20s"` on those pods instead of lowering the Helm `interval`, which would stop `block` and `mutex` on every pod.

{% hint style="info" %}
`cpu`, `block` and `mutex` profiles record a fixed window on each scrape, so their totals grow with the scrape rate. Over the same time range, a pod scraped every `20s` shows about three times the CPU time it would show if scraped every minute. Compare totals only between pods scraped at the same interval.
{% endhint %}

### Use your own annotation prefix

To annotate pods under your own domain, add it to `extraAnnotationPrefixes`:

```yaml
agent:
  sensor:
    receivers:
      profiles:
        scrape:
          enabled: true
          extraAnnotationPrefixes:
            - profiles.acme.com
```

Pods can then use `profiles.acme.com/cpu.scrape`, `profiles.acme.com/cpu.port`, and so on. `profiles.groundcover.com` is always read. A pod annotated under several prefixes is scraped once per profile type, with all settings for that type taken from the first prefix it uses: `profiles.groundcover.com`, then the list in order.

{% hint style="warning" %}
Don't add `profiles.grafana.com` if Grafana Alloy also profiles your pods. Both would request CPU profiles from the same process and one of them would fail.
{% endhint %}

### Limits

* Each response is limited to 8 MiB compressed and 32 MiB decompressed.
* Each profile is limited to 10,000 decoded sample rows, counted after `<type>.sample_types` is applied. A Go heap profile has four sample types, so a large heap profile can exceed the limit. Keep fewer sample types with `memory.sample_types`, or raise `agent.sensor.receivers.profiles.maxDecodedSampleRows`. Higher limits use more sensor memory.
* Each sensor runs up to 64 scrapes at a time. Scrapes beyond that are skipped until the next interval.
* A failing or slow target doesn't delay other targets. It's retried on the next interval.

### Troubleshoot scraping

The sensor logs scraping problems. To find them, run the following command, replacing `groundcover` if you installed groundcover in a different namespace:

```bash
kubectl logs -n groundcover -l app=sensor -c sensor --tail=-1 \
  | grep -E "profile scrap|profile types with invalid"
```

| Log message                                                  | Meaning                                                                                                                                                                                                                                                                                         |
| ------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `profile scrape targets skipped`                             | Targets the sensor won't scrape, with an example pod and the cause. The `reason` field is `no_port` (no port found), `invalid_port` (`<type>.port` isn't a port number) or `invalid_target` (invalid path, scheme, `seconds`, interval or sample types). Logged when the problem first appears. |
| `profile scrape failed`                                      | A scrape failed. The `result` field gives the reason, and `namespace` and `pod` name the target. Logged on the first failure and every 10th consecutive failure.                                                                                                                                |
| `profile scrape target recovered`                            | A failing target succeeded again.                                                                                                                                                                                                                                                               |
| `profile types with invalid scrape settings are not scraped` | `interval` is too short for some profile types. Those types aren't scraped and the others are.                                                                                                                                                                                                  |
| `profile scraping is disabled`                               | The scrape settings are invalid, for example an `interval` below `10s` or an invalid `extraAnnotationPrefixes` entry.                                                                                                                                                                           |

Common `result` values:

| Result                | What to check                                                                                                     |
| --------------------- | ----------------------------------------------------------------------------------------------------------------- |
| `connection_error`    | The pprof server isn't reachable at the pod IP and port. Make sure it listens on all interfaces, not `localhost`. |
| `timeout`             | The target didn't respond within the type's timeout.                                                              |
| `http_4xx`            | The path is wrong or the endpoint requires authentication.                                                        |
| `http_3xx`            | The endpoint redirects. Set `<type>.path` to the final path.                                                      |
| `target_busy`         | Another profiler holds Go's CPU profiler.                                                                         |
| `validation_error`    | `<type>.sample_types` names a type the profile doesn't have, or the profile exceeds the sample row limit.         |
| `too_large`           | The response exceeds the size limits.                                                                             |
| `skipped_concurrency` | More than 64 scrapes were running on the node.                                                                    |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.groundcover.com/collect-data/data-sources/profiling-endpoints.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
