exceptionsconnector

package module
v0.99.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 17 Imported by: 2

README

Exceptions Connector

Status
Distributions contrib
Issues Open issues Closed issues
Code Owners @jpkrohling, @marctc

Supported Pipeline Types

Exporter Pipeline Type Receiver Pipeline Type Stability Level
traces metrics alpha
traces logs alpha

Overview

Generate metrics and logs from recorded application exceptions associated with spans.

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

  • Service 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.

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.

Examples

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

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.

receivers:
  otlp:
    protocols:
      grpc:
      http:

exporters:
  prometheusremotewrite:
    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: [prometheusremotewrite]
    logs:
      receivers: [exceptions]
      exporters: [loki]

The full list of settings exposed for this connector are documented here.

More Examples

For more example configuration covering various other use cases, please visit the testdata directory.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFactory

func NewFactory() connector.Factory

NewFactory creates a factory for the exceptions connector.

Types

type Config

type Config struct {
	// Dimensions defines the list of additional dimensions on top of the provided:
	// - service.name
	// - span.kind
	// - status.code
	// The dimensions will be fetched from the span's attributes. Examples of some conventionally used attributes:
	// https://github.com/open-telemetry/opentelemetry-collector/blob/main/model/semconv/opentelemetry.go.
	Dimensions []Dimension `mapstructure:"dimensions"`
}

Config defines the configuration options for exceptionsconnector

func (Config) Validate

func (c Config) Validate() error

Validate checks if the connector configuration is valid

type Dimension

type Dimension struct {
	Name    string  `mapstructure:"name"`
	Default *string `mapstructure:"default"`
}

Dimension defines the dimension name and optional default value if the Dimension is missing from a span attribute.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL