> ## Documentation Index
> Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Demo OTel Collector Extensions

> Guide to enabling and configuring OpenTelemetry Collector extensions such as health_check pprof and zpages with example configurations endpoints and security recommendations

This guide shows how to enable and configure extensions in the OpenTelemetry Collector. Extensions provide additional HTTP endpoints and runtime diagnostics (health, debug pages, pprof, etc.). You declare extensions in the top-level `extensions` section and activate them by listing them in `service.extensions`. Below we cover the minimal configuration, a more complete example with TLS/debug settings, example responses, and how to access each extension.

## Minimal configuration example

A compact configuration that enables three extensions together with log and metrics pipelines:

```yaml theme={null}
extensions: [health_check, pprof, zpages]

service:
  pipelines:
    logs:
      receivers: [filelog]
      exporters: [otlphttp/dynatrace, otlp/collector2]
      processors: [attributes, resourcedetection]
    metrics:
      receivers: [prometheus]
      processors: [resourcedetection, cumulativetodelta]
      exporters: [otlphttp/dynatrace, debug]

telemetry:
  logs:
    level: "INFO"  # DEBUG | INFO | WARN | ERROR
  metrics:
    level: detailed
  readers:
    - pull:
        exporter:
          prometheus:
            host: "0.0.0.0"
            port: 8888
```

## Full example showing TLS/debug and extension endpoints

This more complete configuration demonstrates TLS/debug settings, explicit extension endpoints, and enabling the extensions in the `service` block:

```yaml theme={null}
tls:
  insecure: true  # Configure proper TLS in production

debug:
  verbosity: basic  # basic | normal | detailed

extensions:
  health_check:
    endpoint: 0.0.0.0:13133
  pprof:
    endpoint: 0.0.0.0:1777
  zpages:
    endpoint: 0.0.0.0:55679

service:
  extensions: [health_check, pprof, zpages]
  pipelines:
    logs:
      receivers: [filelog]
      exporters: [otlphttp/dynatrace, otlp/collector2]
      processors: [attributes, resourcedetection]
    metrics:
      receivers: [prometheus]
      processors: [resourcedetection, cumulativetodelta]
      exporters: [otlphttp/dynatrace, debug]
```

<Callout icon="warning" color="#FF6B6B">
  `tls.insecure: true` is useful for local testing. Do NOT use it in production—configure TLS properly for production deployments.
</Callout>

<Callout icon="lightbulb" color="#1CB2FE">
  Extensions must be both declared under `extensions` and enabled by listing them in `service.extensions`. Declaring them alone does not activate them.
</Callout>

After updating the Collector configuration, restart the Collector process (or redeploy your Collector pod/container) so the configuration changes take effect.

## Common extensions and their default endpoints

|      Extension | Purpose                                                        | Example endpoint |
| -------------: | -------------------------------------------------------------- | ---------------- |
| `health_check` | Liveness / availability information                            | `0.0.0.0:13133`  |
|        `pprof` | Go runtime profiling endpoints (CPU, memory, goroutines, etc.) | `0.0.0.0:1777`   |
|       `zpages` | Runtime debug pages for collectors (servicez, tracez, etc.)    | `0.0.0.0:55679`  |

## Health check output example

When `health_check` is active, requesting the endpoint returns a short JSON payload showing availability, start time, and uptime:

```json theme={null}
{
  "status": "Server available",
  "upSince": "2025-11-17T13:06:55.882681836Z",
  "uptime": "3m17.886915133s"
}
```

Use the health check for liveness probes and basic operational checks in orchestration platforms (for example, Kubernetes liveness/readiness probes).

## zPages: runtime debug pages

The zPages extension exposes several debug pages. Use the Collector host/IP and the configured zPages port, then append the debug path. Examples:

* Service info: `http://collector-host:55679/debug/servicez`
* Traces: `http://collector-host:55679/debug/tracez`

The `servicez` page includes build/runtime information (start time, Go version, OS/arch, command used to run the Collector) and visualizes the configured/built pipelines.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/BBtH5GyNI0zR7M4h/images/Prep-Course-OpenTelemetry-Certified-Associate-OTCA-Certification/OpenTelemetry-Collector-Debugging-Operations-and-Scaling/Demo-OTel-Collector-Extensions/opentelemetry-collector-contrib-info-webpage.jpg?fit=max&auto=format&n=BBtH5GyNI0zR7M4h&q=85&s=951dab3c82caf4d89c9de8e6331ac86d" alt="The image shows a webpage with information about the OpenTelemetry Collector Contrib service, including build and runtime details such as the command, version, Go version, operating system, and architecture." width="1920" height="1080" data-path="images/Prep-Course-OpenTelemetry-Certified-Associate-OTCA-Certification/OpenTelemetry-Collector-Debugging-Operations-and-Scaling/Demo-OTel-Collector-Extensions/opentelemetry-collector-contrib-info-webpage.jpg" />
</Frame>

The `servicez` view also shows built pipelines with details such as full name, input type, whether the pipeline mutates data, receivers, ordered processors, and exporters.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/BBtH5GyNI0zR7M4h/images/Prep-Course-OpenTelemetry-Certified-Associate-OTCA-Certification/OpenTelemetry-Collector-Debugging-Operations-and-Scaling/Demo-OTel-Collector-Extensions/builtpipelines-data-processing-table.jpg?fit=max&auto=format&n=BBtH5GyNI0zR7M4h&q=85&s=e6d51ed57f0c29a32a7feae43b31ba3e" alt="The image shows a web page displaying a table titled &#x22;builtPipelines,&#x22; detailing data processing pipelines with columns for FullName, InputType, MutatesData, Receivers, Processors, and Exporters." width="1920" height="1080" data-path="images/Prep-Course-OpenTelemetry-Certified-Associate-OTCA-Certification/OpenTelemetry-Collector-Debugging-Operations-and-Scaling/Demo-OTel-Collector-Extensions/builtpipelines-data-processing-table.jpg" />
</Frame>

There is also a `featurez` section that lists feature gates and their current state. Example entries you might see:

| Feature gate                                      | State   |
| ------------------------------------------------- | ------- |
| `cloudfoundry.resourceAttributes.allow`           | `true`  |
| `confilhttp.framedSnappy`                         | `true`  |
| `conflmap.enableMergeAppendOption`                | `false` |
| `connector.datadogconnector.NativeIngest`         | `true`  |
| `connector.servicegraph.legacyLatencyMetricNames` | `false` |
| `connector.servicegraph.legacyLatencyUnitMs`      | `false` |
| `connector.servicegraph.virtualNode`              | `true`  |
| `connector.spanmetrics.legacyMetricNames`         | `false` |
| `connector.EnableOperationAndResourceV2`          | `true`  |

## tracez: inspect traces and spans

To view a live trace/span overview, open:

`http://collector-host:55679/debug/tracez`

`tracez` shows incoming and sampled spans grouped by span name and request path. You can inspect span counts, latency buckets, error samples, and drill into sampled trace IDs and span IDs. Sampled traces are commonly highlighted (for example, in blue).

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/BBtH5GyNI0zR7M4h/images/Prep-Course-OpenTelemetry-Certified-Associate-OTCA-Certification/OpenTelemetry-Collector-Debugging-Operations-and-Scaling/Demo-OTel-Collector-Extensions/trace-spans-http-requests-table.jpg?fit=max&auto=format&n=BBtH5GyNI0zR7M4h&q=85&s=98fd04d605470aacf8e373e48bf73195" alt="The image shows a table from a web page labeled &#x22;Trace Spans,&#x22; displaying data on different spans, latency samples, and error samples for various HTTP requests. It includes details on running processes and latency buckets ranging from microseconds to minutes." width="1920" height="1080" data-path="images/Prep-Course-OpenTelemetry-Certified-Associate-OTCA-Certification/OpenTelemetry-Collector-Debugging-Operations-and-Scaling/Demo-OTel-Collector-Extensions/trace-spans-http-requests-table.jpg" />
</Frame>

## pprof: Go runtime profiling

If you enable `pprof` (for example on port 1777), the pprof index is available at:

`http://collector-host:1777/debug/pprof/`

The index lists profiles such as `allocs`, `heap`, `block`, `mutex`, `cpu` (profiling for a duration), and `goroutine` (stack traces). Clicking a profile endpoint (for example a 30-second CPU profile) downloads a pprof file that you can analyze locally with the `pprof` tool or upload to web viewers like Speedscope.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/BBtH5GyNI0zR7M4h/images/Prep-Course-OpenTelemetry-Certified-Associate-OTCA-Certification/OpenTelemetry-Collector-Debugging-Operations-and-Scaling/Demo-OTel-Collector-Extensions/profiling-data-debug-pprof-webpage.jpg?fit=max&auto=format&n=BBtH5GyNI0zR7M4h&q=85&s=1cd9c1d19b015a16ad5d39fb7558561b" alt="The image shows a web page displaying profiling data from the /debug/pprof/ endpoint, listing types of profiles available and their respective descriptions. The profiles include allocations, goroutines, heap, and others, with associated counts." width="1920" height="1080" data-path="images/Prep-Course-OpenTelemetry-Certified-Associate-OTCA-Certification/OpenTelemetry-Collector-Debugging-Operations-and-Scaling/Demo-OTel-Collector-Extensions/profiling-data-debug-pprof-webpage.jpg" />
</Frame>

Typical pprof visualizations:

* Graph view: call graph showing relationships between functions during the profiling window.
* Flame graph: highlights hot paths; width corresponds to CPU time consumed by the call stack.

pprof helps diagnose CPU hotspots, contention, blocking, and memory allocation patterns—useful for advanced debugging and performance tuning.

## Useful links and references

* zPages extension: [https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/extension/zpages](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/extension/zpages)
* pprof tool: [https://github.com/google/pprof](https://github.com/google/pprof)
* Speedscope (online profile viewer): [https://speedscope.app](https://speedscope.app)
* OpenTelemetry Collector docs: [https://opentelemetry.io/docs/collector/](https://opentelemetry.io/docs/collector/)

This page focused on enabling and accessing the Collector extensions. For production use, ensure you secure debug endpoints, configure TLS correctly, and restrict access to diagnostic endpoints.

<CardGroup>
  <Card title="Watch Video" icon="video" cta="Learn more" href="https://learn.kodekloud.com/user/courses/prep-course-opentelemetry-certified-associate-certification-otca/module/9c72c1a7-4e0b-4541-8811-755843e69659/lesson/b1ff1d0d-674b-42f4-90c1-dc6ca407c8ef" />
</CardGroup>
