bugsnagperformance

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: MIT Imports: 19 Imported by: 0

README

SmartBear BugSnag logo

Performance monitoring for Go

Documentation Go Reference Build status

Convenience SDK for using the Go OpenTelemetry SDK with BugSnag.

Features

  • Simple configuration using BugSnag API key
  • Control sampling using BugSnag's probability-based sampler

Getting started

For integration instructions, see our online docs: docs.bugsnag.com/performance/go

Support

License

The BugSnag Go Performance SDK is free software released under the MIT License. See LICENSE.txt for details.

Documentation

Index

Constants

View Source
const (
	PROBABILITY_SCALE_FACTOR_32 float64 = 4_294_967_295 // (2 ** 32) - 1
)
View Source
const Version = "1.0.0"

Version defines the version of this Bugsnag performance module

Variables

View Source
var (
	PROBABILITY_SCALE_FACTOR_64 = new(big.Float).SetUint64(math.MaxUint64) // (2 ** 64) - 1
)
View Source
var REQUEST_HEADERS = map[string]string{/* contains filtered or unexported fields */}

Functions

func Configure

func Configure(config Configuration) ([]trace.TracerProviderOption, error)

Configure Bugsnag. The only required setting is the APIKey, which can be obtained by clicking on "Settings" in your Bugsnag dashboard. Returns OTeL sampler, probability attribute processor, trace exporter and error

Types

type Configuration

type Configuration struct {
	// Your Bugsnag API key, e.g. "c9d60ae4c7e70c4b6c4ebd3e8056d2b8". You can
	// find this by clicking Settings on https://bugsnag.com/.
	APIKey string

	// The currently running version of the app. This is used to filter errors
	// in the Bugsnag dasboard. If you set this then Bugsnag will only re-open
	// resolved errors if they happen in different app versions.
	AppVersion string

	// Address to which bugsnag will send traces to
	Endpoint string

	// The current release stage. This defaults to "production" and is used to
	// filter errors in the Bugsnag dashboard.
	// Should have the same value as "deployment.environment" otel resource attribute
	ReleaseStage string

	// The Release stages to send traces in. If you set this then bugsnag-go-performance will
	// only send traces to Bugsnag if the ReleaseStage is listed here.
	EnabledReleaseStages []string

	// Context created in the main program
	// Used in probability fetcher - after this context is marked Done
	// the goroutine will switch to a graceful shutdown
	// and stop querying for new probability values.
	MainContext context.Context

	// Provide custom sampler to use
	// If not provided, the default sampler will be used
	CustomSampler trace.Sampler

	// Resource to be merged with BugSnag resource data
	// If not provided, the default resource will be used
	Resource *resource.Resource

	// Sets the value of the service.name resource attribute
	// We also recommend you set it to the same name as your
	// BugSnag project name to identify spans on the dashboard
	// if Distributed Tracing is used.
	ServiceName string

	// The http Transport to use, defaults to the default http Transport. This
	// can be configured if you are in an environment
	// that has stringent conditions on making http requests.
	Transport http.RoundTripper

	// Logger to use for debug messages
	Logger *log.Logger
}
var Config Configuration

Config is the configuration for the default Bugsnag performance module

type ProbabilityAttributeProcessor

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

func (*ProbabilityAttributeProcessor) ForceFlush

func (pap *ProbabilityAttributeProcessor) ForceFlush(ctx context.Context) error

func (*ProbabilityAttributeProcessor) OnEnd

func (*ProbabilityAttributeProcessor) OnStart

func (*ProbabilityAttributeProcessor) Shutdown

type Sampler

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

func (*Sampler) Description

func (s *Sampler) Description() string

func (*Sampler) ShouldSample

func (s *Sampler) ShouldSample(parameters sdktrace.SamplingParameters) sdktrace.SamplingResult

type SpanExporter

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

func (*SpanExporter) ExportSpans

func (sp *SpanExporter) ExportSpans(ctx context.Context, spans []trace.ReadOnlySpan) error

func (*SpanExporter) Shutdown

func (sp *SpanExporter) Shutdown(ctx context.Context) error

Directories

Path Synopsis
features

Jump to

Keyboard shortcuts

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