sentryexporter

package module
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2020 License: Apache-2.0 Imports: 12 Imported by: 2

README

Sentry Exporter

The Sentry Exporter allows you to send traces to Sentry.

For more details about distributed tracing in Sentry, please view our documentation.

The following configuration options are supported:

  • dsn: The DSN tells the exporter where to send the events. You can find a Sentry project DSN in the “Client Keys” section of the “Project Settings” section of a Sentry project.

Example:

exporters:
  sentry:
    dsn: https://key@host/path/42

See the docs for more details on how this transformation is working.

Known Limitations

Currently, Sentry Tracing leverages a transaction-based system, where a transaction contains one or more spans. The exporter will try to group spans from a trace under one or more transactions based on internal heuristics, but this may lead to the creation of transactions that contain only one or two spans. These transactions will still be viewable and associated under a single trace in the Sentry UI.

One consequence of this result is that very large traces with a large number of spans (500+) and only one root span might be split up into a large number of transactions. There are no current ways to work around this.

Associating with Sentry Errors

To associate OpenTelemetry spans with Sentry errors, you can set a trace context on the error event. Whenever you start a new trace, you can update the scope to reference a new trace_id.

An example with Python but applies to any language that supports a Sentry SDK.

from sentry_sdk import configure_scope

with start_otel_span("start") as span:
  ctx = span.get_context()
  with configure_scope() as scope:
    scope.set_context("trace", {"trace_id": ctx.trace_id})

  with start_otel_span("child"):
    # ...

Now if traces are ingested into Sentry, you can associate them to errors that occurred during the trace using the trace_id. For a full list of the Sentry SDKs and platforms, please check the Sentry documentation.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateSentryExporter

func CreateSentryExporter(config *Config) (component.TraceExporter, error)

CreateSentryExporter returns a new Sentry Exporter.

func NewFactory

func NewFactory() component.ExporterFactory

NewFactory creates a factory for Sentry exporter.

Types

type Config

type Config struct {
	configmodels.ExporterSettings `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct.
	// DSN to report transaction to Sentry. If the DSN is not set, no trace will be sent to Sentry.
	DSN string `mapstructure:"dsn"`
}

Config defines the configuration for the Sentry Exporter.

type SentryExporter

type SentryExporter struct {
	// contains filtered or unexported fields
}

SentryExporter defines the Sentry Exporter.

Jump to

Keyboard shortcuts

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