Documentation
¶
Index ¶
- Constants
- Variables
- type Application
- func (r *Application) Logger(name string, opts ...otellog.LoggerOption) otellog.Logger
- func (r *Application) Meter(name string, opts ...otelmetric.MeterOption) otelmetric.Meter
- func (r *Application) MeterProvider() otelmetric.MeterProvider
- func (r *Application) Propagator() propagation.TextMapPropagator
- func (r *Application) Shutdown(ctx context.Context) error
- func (r *Application) Tracer(name string, opts ...oteltrace.TracerOption) oteltrace.Tracer
- func (r *Application) TracerProvider() oteltrace.TracerProvider
- type Config
- type ExporterDriver
- type ExporterEntry
- type KeyValue
- type LogsConfig
- type LogsProcessorConfig
- type MetricTemporality
- type MetricsConfig
- type MetricsReaderConfig
- type Protocol
- type SamplerConfig
- type ServiceConfig
- type ServiceProvider
- type ShutdownFunc
- func NewLoggerProvider(ctx context.Context, cfg Config, opts ...sdklog.LoggerProviderOption) (log.LoggerProvider, ShutdownFunc, error)
- func NewMeterProvider(ctx context.Context, cfg Config, opts ...sdkmetric.Option) (metric.MeterProvider, ShutdownFunc, error)
- func NewTracerProvider(ctx context.Context, cfg Config, opts ...sdktrace.TracerProviderOption) (oteltrace.TracerProvider, ShutdownFunc, error)
- func NoopShutdown() ShutdownFunc
- type TracesConfig
Constants ¶
Span status codes.
View Source
const ( SpanKindUnspecified = trace.SpanKindUnspecified SpanKindInternal = trace.SpanKindInternal SpanKindServer = trace.SpanKindServer SpanKindClient = trace.SpanKindClient SpanKindProducer = trace.SpanKindProducer SpanKindConsumer = trace.SpanKindConsumer )
SpanKind constants.
Variables ¶
View Source
var ( Bool = attribute.Bool BoolSlice = attribute.BoolSlice Float64 = attribute.Float64 Float64Slice = attribute.Float64Slice Int = attribute.Int Int64 = attribute.Int64 Int64Slice = attribute.Int64Slice IntSlice = attribute.IntSlice String = attribute.String StringSlice = attribute.StringSlice Stringer = attribute.Stringer )
Attribute functions for creating span attributes.
View Source
var ( WithAttributes = trace.WithAttributes WithLinks = trace.WithLinks WithSpanKind = trace.WithSpanKind WithTimestamp = trace.WithTimestamp )
Span start options.
View Source
var ( PropagationHeaderCarrier = func(h http.Header) propagation.HeaderCarrier { return propagation.HeaderCarrier(h) } PropagationMapCarrier = func(m map[string]string) propagation.MapCarrier { return propagation.MapCarrier(m) } )
Propagation carriers for context propagation.
View Source
var ( TelemetryFacade telemetry.Telemetry ConfigFacade config.Config )
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application struct {
// contains filtered or unexported fields
}
func NewApplication ¶
func NewApplication(cfg Config) (*Application, error)
func (*Application) Logger ¶
func (r *Application) Logger(name string, opts ...otellog.LoggerOption) otellog.Logger
func (*Application) Meter ¶
func (r *Application) Meter(name string, opts ...otelmetric.MeterOption) otelmetric.Meter
func (*Application) MeterProvider ¶
func (r *Application) MeterProvider() otelmetric.MeterProvider
func (*Application) Propagator ¶
func (r *Application) Propagator() propagation.TextMapPropagator
func (*Application) Tracer ¶
func (r *Application) Tracer(name string, opts ...oteltrace.TracerOption) oteltrace.Tracer
func (*Application) TracerProvider ¶
func (r *Application) TracerProvider() oteltrace.TracerProvider
type Config ¶
type Config struct {
Resource map[string]string
Service ServiceConfig
Propagators string
Logs LogsConfig
Metrics MetricsConfig
Traces TracesConfig
Exporters map[string]ExporterEntry
}
func (Config) GetExporter ¶
func (c Config) GetExporter(name string) (ExporterEntry, bool)
type ExporterDriver ¶
type ExporterDriver string
const ( LogExporterDriverCustom ExporterDriver = "custom" LogExporterDriverOTLP ExporterDriver = "otlp" LogExporterDriverConsole ExporterDriver = "console" )
const ( MetricsExporterDriverCustom ExporterDriver = "custom" MetricsExporterDriverOTLP ExporterDriver = "otlp" MetricsExporterDriverConsole ExporterDriver = "console" )
const ( TraceExporterDriverCustom ExporterDriver = "custom" TraceExporterDriverOTLP ExporterDriver = "otlp" TraceExporterDriverZipkin ExporterDriver = "zipkin" TraceExporterDriverConsole ExporterDriver = "console" )
type ExporterEntry ¶
type ExporterEntry struct {
Driver ExporterDriver
Endpoint string
Insecure bool
Timeout time.Duration
// OTLP-specific
Protocol Protocol
Headers map[string]string
// Metric Specific
MetricTemporality MetricTemporality `json:"metric_temporality"`
// Console Driver Specific
PrettyPrint bool `json:"pretty_print"`
// For custom Exporter
Via any
}
type LogsConfig ¶
type LogsConfig struct {
Exporter string
Processor LogsProcessorConfig
}
type LogsProcessorConfig ¶
type MetricTemporality ¶
type MetricTemporality string
const ( TemporalityCumulative MetricTemporality = "cumulative" TemporalityDelta MetricTemporality = "delta" )
type MetricsConfig ¶
type MetricsConfig struct {
Exporter string
Reader MetricsReaderConfig
}
type MetricsReaderConfig ¶
type SamplerConfig ¶
type ServiceConfig ¶
type ServiceProvider ¶
type ServiceProvider struct {
}
func (*ServiceProvider) Boot ¶
func (r *ServiceProvider) Boot(app foundation.Application)
func (*ServiceProvider) Register ¶
func (r *ServiceProvider) Register(app foundation.Application)
func (*ServiceProvider) Relationship ¶
func (r *ServiceProvider) Relationship() binding.Relationship
type ShutdownFunc ¶
func NewLoggerProvider ¶
func NewLoggerProvider(ctx context.Context, cfg Config, opts ...sdklog.LoggerProviderOption) (log.LoggerProvider, ShutdownFunc, error)
func NewMeterProvider ¶
func NewMeterProvider(ctx context.Context, cfg Config, opts ...sdkmetric.Option) (metric.MeterProvider, ShutdownFunc, error)
func NewTracerProvider ¶
func NewTracerProvider(ctx context.Context, cfg Config, opts ...sdktrace.TracerProviderOption) (oteltrace.TracerProvider, ShutdownFunc, error)
func NoopShutdown ¶
func NoopShutdown() ShutdownFunc
NoopShutdown returns a ShutdownFunc that does nothing and returns nil.
type TracesConfig ¶
type TracesConfig struct {
Exporter string
Sampler SamplerConfig
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.