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

# Exceptions

> OpenTelemetry connector for Exceptions

# Exceptions Connector

![Status](https://img.shields.io/badge/status-alpha-red)

**Available in:** `contrib`, `k8s`

**Maintainers:** [@marctc](https://github.com/marctc)

**Source:** [opentelemetry-collector-contrib](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/connector/exceptionsconnector)

## Overview

## Overview

Generate metrics and logs from recorded [application exceptions](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/exceptions/exceptions-spans.md/) associated with spans.

Each **metric** and **log** will have *at least* the following dimensions:

* Service name
* Span name
* Span kind
* Status code

With the provided default config, each **metric** and **log** will also have the following dimensions:

* Exception message
* Exception type

Each log will additionally have the following attributes:

* Exception stacktrace
* Span attributes. If you want to filter out some attributes (like only copying HTTP attributes starting with `http.`) use the [transform processor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/transformprocessor/).

## Configurations

If you are not already familiar with connectors, you may find it helpful to first visit the [Connectors README].

The following settings can be optionally configured:

* `dimensions`: the list of dimensions to add together with the default dimensions defined above.

  Each additional dimension is defined with a `name` which is looked up in the span's collection of attributes or resource attributes.

  The provided default config includes `exception.type` and `exception.message` as additional dimensions.

* `exemplars`:  Use to configure how to attach exemplars to metrics.
  * `enabled` (default: `false`): enabling will add spans as Exemplars.

## Examples

The following is a simple example usage of the `exceptions` connector.

```yaml theme={null}
receivers:
  nop:

exporters:
  nop:

connectors:
  exceptions:

service:
  pipelines:
    traces:
      receivers: [nop]
      exporters: [exceptions]
    metrics:
      receivers: [exceptions]
      exporters: [nop]
    logs:
      receivers: [exceptions]
      exporters: [nop]      
```

The following is a more complex example usage of the `exceptions` connector using Prometheus and Loki as exporters.

```yaml theme={null}
receivers:
  otlp:
    protocols:
      grpc:
      http:

exporters:
  prometheus_remote_write:
    endpoint: http://prometheus:9090/api/v1/write
  loki:
    endpoint: http://loki:3100/loki/api/v1/push

connectors:
  exceptions:

service:
  pipelines:
    traces:
      receivers: [otlp]
      exporters: [exceptions]
    metrics:
      receivers: [exceptions]
      exporters: [prometheus_remote_write]
    logs:
      receivers: [exceptions]
      exporters: [loki]
```

The full list of settings exposed for this connector are documented in [exceptionsconnector/config.go](../../connector/exceptionsconnector/config.go).

### More Examples

For more example configuration covering various other use cases, please visit the [testdata directory](../../connector/exceptionsconnector/testdata).

[Connectors README]: https://github.com/open-telemetry/opentelemetry-collector/blob/main/connector/README.md

## Configuration

### Example Configuration

```yaml theme={null}
# default configuration
exceptions/default:

# configuration with all possible parameters
exceptions/full:
  # Additional list of dimensions on top of:
  # - service.name
  # - span.name
  # - span.kind
  # - status.code
  # - exception.stacktrace (Only for log records)
  dimensions:
    - name: exception.type
    - name: exception.message
```

***

*Last generated: 2026-07-06*
