sentryexporter

package module
v0.100.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: Apache-2.0 Imports: 19 Imported by: 3

README

Sentry Exporter

Status
Stability beta: traces
Distributions contrib
Issues Open issues Closed issues
Code Owners @AbhiPrasad

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.
  • environment: When the value is set, it will set the event environment tag, so the event can be filtered accordingly in Sentry. Note that this applies to every single event that is processed by the Sentry Exporter.
  • insecure_skip_verify: If it is set to true, then ssl certificates will not be checked. Useful for test purposes, as well as for Sentry installations deployed in private clouds.

Example:

exporters:
  sentry:
    dsn: https://key@host/path/42
    environment: prod
    insecure_skip_verify: true

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 NewFactory

func NewFactory() exporter.Factory

NewFactory creates a factory for Sentry exporter.

Types

type Config

type Config struct {
	// DSN to report transaction to Sentry. If the DSN is not set, no trace will be sent to Sentry.
	DSN string `mapstructure:"dsn"`
	// The deployment environment name, such as production or staging.
	// Environments are case sensitive. The environment name can't contain newlines, spaces or forward slashes,
	// can't be the string "None", or exceed 64 characters.
	Environment string `mapstructure:"environment"`
	// InsecureSkipVerify controls whether the client verifies the Sentry server certificate chain
	InsecureSkipVerify bool `mapstructure:"insecure_skip_verify"`
}

Config defines the configuration for the Sentry Exporter.

func (*Config) Validate added in v0.72.0

func (cfg *Config) Validate() error

Validate checks if the exporter configuration is valid

type SentryExporter

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

SentryExporter defines the Sentry Exporter.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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