config

package
v0.0.0-...-f06bd48 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2022 License: MPL-2.0 Imports: 14 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	UserResourceAttributes   map[string]string
	Detector                 resource.Detector
	TraceEndpoint            string
	InAppExporter            *sdkTraceExporter
	SpanProcessor            func(sdktrace.SpanExporter) sdktrace.SpanProcessor
	HTTPOption               []otlptracehttp.Option
	GRPCOption               []otlptracegrpc.Option
	IsGRPCExporterConfigured bool
	Sampler                  sdktrace.Sampler
}

Config represents opentelemetry configurations

func NewConfig

func NewConfig() *Config

NewConfig returns new instance of config

type Option

type Option func(*Config)

Option option for configuring telemetry setup

func WithAWSEC2Detector

func WithAWSEC2Detector() Option

WithAWSEC2Detector returns a config option which sets config detector to ec2 detector

func WithAWSLambdaDetector

func WithAWSLambdaDetector() Option

WithAWSLambdaDetector returns a config option which sets config detector to ec2 detector

func WithAttributes

func WithAttributes(attributes map[string]string) Option

WithAttributes returns a config option which adds custom attributes to resource

func WithAzureFunctionDetector

func WithAzureFunctionDetector() Option

func WithAzureVMDetector

func WithAzureVMDetector() Option

func WithCustomHTTPHeaders

func WithCustomHTTPHeaders(headers map[string]string) Option

func WithDefaultInAppExporter

func WithDefaultInAppExporter() Option

func WithGCPcloudFunctionDetector

func WithGCPcloudFunctionDetector() Option

WithGCPcloudFunctionDetector returns a config option which sets config detector to gcloud function detector

func WithGRPCCredential

func WithGRPCCredential(cred credentials.TransportCredentials) Option

func WithGRPCEndpoint

func WithGRPCEndpoint(endpoint string) Option

func WithHTTPTraceEndpoint

func WithHTTPTraceEndpoint(endpoint string) Option

WithHTTPTraceEndpoint returns a config option which sets trace endpoint

func WithHTTPTraceURLPath

func WithHTTPTraceURLPath(url string) Option

func WithInAppExporter

func WithInAppExporter(endpoint string, headers map[string]string) Option

WithInAppExporter will send spans directly to HTTP destination of choice. Content-Type would be of application/x-protobuf

func WithInsecureHTTPEndpoint

func WithInsecureHTTPEndpoint() Option

func WithSimlpeSpanProcessor

func WithSimlpeSpanProcessor() Option

func WithTraceIDRatioBasedSampler

func WithTraceIDRatioBasedSampler(fraction float64) Option

Jump to

Keyboard shortcuts

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