Documentation
¶
Index ¶
- Constants
- func GetHostname() string
- type Config
- type Event
- type EventOption
- func WithEventError(err error) EventOption
- func WithEventFingerprint(fingerprint []string) EventOption
- func WithEventLevel(level Level) EventOption
- func WithEventTag(key, value string) EventOption
- func WithEventTags(tags map[string]string) EventOption
- func WithEventUser(id, email, username string) EventOption
- type EventSpanBuilder
- type Level
- type MetricDefinition
- type MetricType
- type MetricsConfig
- type MetricsProvider
- type MetricsProviderType
- type MiddlewareConfig
- type MockEvent
- func (_m *MockEvent) Capture()
- func (_m *MockEvent) EXPECT() *MockEvent_Expecter
- func (_m *MockEvent) SetError(err error)
- func (_m *MockEvent) SetFingerprint(fingerprint []string)
- func (_m *MockEvent) SetLevel(level Level)
- func (_m *MockEvent) SetTag(key string, value string)
- func (_m *MockEvent) SetTags(tags map[string]string)
- func (_m *MockEvent) SetUser(id string, email string, username string)
- type MockEventOption
- type MockEventOption_ApplyEvent_Call
- type MockEventOption_Expecter
- type MockEvent_Capture_Call
- type MockEvent_Expecter
- func (_e *MockEvent_Expecter) Capture() *MockEvent_Capture_Call
- func (_e *MockEvent_Expecter) SetError(err interface{}) *MockEvent_SetError_Call
- func (_e *MockEvent_Expecter) SetFingerprint(fingerprint interface{}) *MockEvent_SetFingerprint_Call
- func (_e *MockEvent_Expecter) SetLevel(level interface{}) *MockEvent_SetLevel_Call
- func (_e *MockEvent_Expecter) SetTag(key interface{}, value interface{}) *MockEvent_SetTag_Call
- func (_e *MockEvent_Expecter) SetTags(tags interface{}) *MockEvent_SetTags_Call
- func (_e *MockEvent_Expecter) SetUser(id interface{}, email interface{}, username interface{}) *MockEvent_SetUser_Call
- type MockEvent_SetError_Call
- type MockEvent_SetFingerprint_Call
- type MockEvent_SetLevel_Call
- type MockEvent_SetTag_Call
- type MockEvent_SetTags_Call
- type MockEvent_SetUser_Call
- type MockMetricsProvider
- func (_m *MockMetricsProvider) AddToCounter(ctx context.Context, name string, value float64, labels map[string]string) error
- func (_m *MockMetricsProvider) AddToGauge(ctx context.Context, name string, value float64, labels map[string]string) error
- func (_m *MockMetricsProvider) EXPECT() *MockMetricsProvider_Expecter
- func (_m *MockMetricsProvider) IncrementCounter(ctx context.Context, name string, labels map[string]string) error
- func (_m *MockMetricsProvider) Name() string
- func (_m *MockMetricsProvider) RecordDuration(ctx context.Context, name string, duration time.Duration, ...) error
- func (_m *MockMetricsProvider) RecordHistogram(ctx context.Context, name string, value float64, labels map[string]string) error
- func (_m *MockMetricsProvider) RegisterCounter(name string, help string, labelNames []string) error
- func (_m *MockMetricsProvider) RegisterGauge(name string, help string, labelNames []string) error
- func (_m *MockMetricsProvider) RegisterHistogram(name string, help string, labelNames []string, buckets []float64) error
- func (_m *MockMetricsProvider) SetGauge(ctx context.Context, name string, value float64, labels map[string]string) error
- func (_m *MockMetricsProvider) Start() error
- func (_m *MockMetricsProvider) Stop() error
- type MockMetricsProvider_AddToCounter_Call
- func (_c *MockMetricsProvider_AddToCounter_Call) Return(_a0 error) *MockMetricsProvider_AddToCounter_Call
- func (_c *MockMetricsProvider_AddToCounter_Call) Run(...) *MockMetricsProvider_AddToCounter_Call
- func (_c *MockMetricsProvider_AddToCounter_Call) RunAndReturn(run func(context.Context, string, float64, map[string]string) error) *MockMetricsProvider_AddToCounter_Call
- type MockMetricsProvider_AddToGauge_Call
- func (_c *MockMetricsProvider_AddToGauge_Call) Return(_a0 error) *MockMetricsProvider_AddToGauge_Call
- func (_c *MockMetricsProvider_AddToGauge_Call) Run(...) *MockMetricsProvider_AddToGauge_Call
- func (_c *MockMetricsProvider_AddToGauge_Call) RunAndReturn(run func(context.Context, string, float64, map[string]string) error) *MockMetricsProvider_AddToGauge_Call
- type MockMetricsProvider_Expecter
- func (_e *MockMetricsProvider_Expecter) AddToCounter(ctx interface{}, name interface{}, value interface{}, labels interface{}) *MockMetricsProvider_AddToCounter_Call
- func (_e *MockMetricsProvider_Expecter) AddToGauge(ctx interface{}, name interface{}, value interface{}, labels interface{}) *MockMetricsProvider_AddToGauge_Call
- func (_e *MockMetricsProvider_Expecter) IncrementCounter(ctx interface{}, name interface{}, labels interface{}) *MockMetricsProvider_IncrementCounter_Call
- func (_e *MockMetricsProvider_Expecter) Name() *MockMetricsProvider_Name_Call
- func (_e *MockMetricsProvider_Expecter) RecordDuration(ctx interface{}, name interface{}, duration interface{}, labels interface{}) *MockMetricsProvider_RecordDuration_Call
- func (_e *MockMetricsProvider_Expecter) RecordHistogram(ctx interface{}, name interface{}, value interface{}, labels interface{}) *MockMetricsProvider_RecordHistogram_Call
- func (_e *MockMetricsProvider_Expecter) RegisterCounter(name interface{}, help interface{}, labelNames interface{}) *MockMetricsProvider_RegisterCounter_Call
- func (_e *MockMetricsProvider_Expecter) RegisterGauge(name interface{}, help interface{}, labelNames interface{}) *MockMetricsProvider_RegisterGauge_Call
- func (_e *MockMetricsProvider_Expecter) RegisterHistogram(name interface{}, help interface{}, labelNames interface{}, ...) *MockMetricsProvider_RegisterHistogram_Call
- func (_e *MockMetricsProvider_Expecter) SetGauge(ctx interface{}, name interface{}, value interface{}, labels interface{}) *MockMetricsProvider_SetGauge_Call
- func (_e *MockMetricsProvider_Expecter) Start() *MockMetricsProvider_Start_Call
- func (_e *MockMetricsProvider_Expecter) Stop() *MockMetricsProvider_Stop_Call
- type MockMetricsProvider_IncrementCounter_Call
- func (_c *MockMetricsProvider_IncrementCounter_Call) Return(_a0 error) *MockMetricsProvider_IncrementCounter_Call
- func (_c *MockMetricsProvider_IncrementCounter_Call) Run(run func(ctx context.Context, name string, labels map[string]string)) *MockMetricsProvider_IncrementCounter_Call
- func (_c *MockMetricsProvider_IncrementCounter_Call) RunAndReturn(run func(context.Context, string, map[string]string) error) *MockMetricsProvider_IncrementCounter_Call
- type MockMetricsProvider_Name_Call
- type MockMetricsProvider_RecordDuration_Call
- func (_c *MockMetricsProvider_RecordDuration_Call) Return(_a0 error) *MockMetricsProvider_RecordDuration_Call
- func (_c *MockMetricsProvider_RecordDuration_Call) Run(run func(ctx context.Context, name string, duration time.Duration, ...)) *MockMetricsProvider_RecordDuration_Call
- func (_c *MockMetricsProvider_RecordDuration_Call) RunAndReturn(run func(context.Context, string, time.Duration, map[string]string) error) *MockMetricsProvider_RecordDuration_Call
- type MockMetricsProvider_RecordHistogram_Call
- func (_c *MockMetricsProvider_RecordHistogram_Call) Return(_a0 error) *MockMetricsProvider_RecordHistogram_Call
- func (_c *MockMetricsProvider_RecordHistogram_Call) Run(...) *MockMetricsProvider_RecordHistogram_Call
- func (_c *MockMetricsProvider_RecordHistogram_Call) RunAndReturn(run func(context.Context, string, float64, map[string]string) error) *MockMetricsProvider_RecordHistogram_Call
- type MockMetricsProvider_RegisterCounter_Call
- func (_c *MockMetricsProvider_RegisterCounter_Call) Return(_a0 error) *MockMetricsProvider_RegisterCounter_Call
- func (_c *MockMetricsProvider_RegisterCounter_Call) Run(run func(name string, help string, labelNames []string)) *MockMetricsProvider_RegisterCounter_Call
- func (_c *MockMetricsProvider_RegisterCounter_Call) RunAndReturn(run func(string, string, []string) error) *MockMetricsProvider_RegisterCounter_Call
- type MockMetricsProvider_RegisterGauge_Call
- func (_c *MockMetricsProvider_RegisterGauge_Call) Return(_a0 error) *MockMetricsProvider_RegisterGauge_Call
- func (_c *MockMetricsProvider_RegisterGauge_Call) Run(run func(name string, help string, labelNames []string)) *MockMetricsProvider_RegisterGauge_Call
- func (_c *MockMetricsProvider_RegisterGauge_Call) RunAndReturn(run func(string, string, []string) error) *MockMetricsProvider_RegisterGauge_Call
- type MockMetricsProvider_RegisterHistogram_Call
- func (_c *MockMetricsProvider_RegisterHistogram_Call) Return(_a0 error) *MockMetricsProvider_RegisterHistogram_Call
- func (_c *MockMetricsProvider_RegisterHistogram_Call) Run(run func(name string, help string, labelNames []string, buckets []float64)) *MockMetricsProvider_RegisterHistogram_Call
- func (_c *MockMetricsProvider_RegisterHistogram_Call) RunAndReturn(run func(string, string, []string, []float64) error) *MockMetricsProvider_RegisterHistogram_Call
- type MockMetricsProvider_SetGauge_Call
- func (_c *MockMetricsProvider_SetGauge_Call) Return(_a0 error) *MockMetricsProvider_SetGauge_Call
- func (_c *MockMetricsProvider_SetGauge_Call) Run(...) *MockMetricsProvider_SetGauge_Call
- func (_c *MockMetricsProvider_SetGauge_Call) RunAndReturn(run func(context.Context, string, float64, map[string]string) error) *MockMetricsProvider_SetGauge_Call
- type MockMetricsProvider_Start_Call
- type MockMetricsProvider_Stop_Call
- type MockObserver
- func (_m *MockObserver) CaptureException(ctx context.Context, err error, opts ...EventOption)
- func (_m *MockObserver) CaptureMessage(ctx context.Context, message string, level Level, opts ...EventOption)
- func (_m *MockObserver) Close() error
- func (_m *MockObserver) EXPECT() *MockObserver_Expecter
- func (_m *MockObserver) GetConfig() Config
- func (_m *MockObserver) GetMetrics() MetricsProvider
- func (_m *MockObserver) StartSpan(ctx context.Context, operation string, opts ...SpanOption) (context.Context, Span)
- func (_m *MockObserver) StartTransaction(ctx context.Context, name string, opts ...TransactionOption) Transaction
- type MockObserver_CaptureException_Call
- func (_c *MockObserver_CaptureException_Call) Return() *MockObserver_CaptureException_Call
- func (_c *MockObserver_CaptureException_Call) Run(run func(ctx context.Context, err error, opts ...EventOption)) *MockObserver_CaptureException_Call
- func (_c *MockObserver_CaptureException_Call) RunAndReturn(run func(context.Context, error, ...EventOption)) *MockObserver_CaptureException_Call
- type MockObserver_CaptureMessage_Call
- func (_c *MockObserver_CaptureMessage_Call) Return() *MockObserver_CaptureMessage_Call
- func (_c *MockObserver_CaptureMessage_Call) Run(...) *MockObserver_CaptureMessage_Call
- func (_c *MockObserver_CaptureMessage_Call) RunAndReturn(run func(context.Context, string, Level, ...EventOption)) *MockObserver_CaptureMessage_Call
- type MockObserver_Close_Call
- type MockObserver_Expecter
- func (_e *MockObserver_Expecter) CaptureException(ctx interface{}, err interface{}, opts ...interface{}) *MockObserver_CaptureException_Call
- func (_e *MockObserver_Expecter) CaptureMessage(ctx interface{}, message interface{}, level interface{}, opts ...interface{}) *MockObserver_CaptureMessage_Call
- func (_e *MockObserver_Expecter) Close() *MockObserver_Close_Call
- func (_e *MockObserver_Expecter) GetConfig() *MockObserver_GetConfig_Call
- func (_e *MockObserver_Expecter) GetMetrics() *MockObserver_GetMetrics_Call
- func (_e *MockObserver_Expecter) StartSpan(ctx interface{}, operation interface{}, opts ...interface{}) *MockObserver_StartSpan_Call
- func (_e *MockObserver_Expecter) StartTransaction(ctx interface{}, name interface{}, opts ...interface{}) *MockObserver_StartTransaction_Call
- type MockObserver_GetConfig_Call
- type MockObserver_GetMetrics_Call
- type MockObserver_StartSpan_Call
- func (_c *MockObserver_StartSpan_Call) Return(_a0 context.Context, _a1 Span) *MockObserver_StartSpan_Call
- func (_c *MockObserver_StartSpan_Call) Run(run func(ctx context.Context, operation string, opts ...SpanOption)) *MockObserver_StartSpan_Call
- func (_c *MockObserver_StartSpan_Call) RunAndReturn(run func(context.Context, string, ...SpanOption) (context.Context, Span)) *MockObserver_StartSpan_Call
- type MockObserver_StartTransaction_Call
- func (_c *MockObserver_StartTransaction_Call) Return(_a0 Transaction) *MockObserver_StartTransaction_Call
- func (_c *MockObserver_StartTransaction_Call) Run(run func(ctx context.Context, name string, opts ...TransactionOption)) *MockObserver_StartTransaction_Call
- func (_c *MockObserver_StartTransaction_Call) RunAndReturn(run func(context.Context, string, ...TransactionOption) Transaction) *MockObserver_StartTransaction_Call
- type MockSpan
- type MockSpanOption
- type MockSpanOption_ApplySpan_Call
- type MockSpanOption_Expecter
- type MockSpan_Expecter
- func (_e *MockSpan_Expecter) Finish() *MockSpan_Finish_Call
- func (_e *MockSpan_Expecter) SetData(key interface{}, value interface{}) *MockSpan_SetData_Call
- func (_e *MockSpan_Expecter) SetError(err interface{}, opts ...interface{}) *MockSpan_SetError_Call
- func (_e *MockSpan_Expecter) SetTag(key interface{}, value interface{}) *MockSpan_SetTag_Call
- type MockSpan_Finish_Call
- type MockSpan_SetData_Call
- type MockSpan_SetError_Call
- type MockSpan_SetTag_Call
- type MockTransaction
- func (_m *MockTransaction) Context() context.Context
- func (_m *MockTransaction) EXPECT() *MockTransaction_Expecter
- func (_m *MockTransaction) Finish(status TransactionStatus)
- func (_m *MockTransaction) SetData(key string, value interface{})
- func (_m *MockTransaction) SetName(name string)
- func (_m *MockTransaction) SetTag(key string, value string)
- func (_m *MockTransaction) StartChild(operation string, opts ...SpanOption) Span
- type MockTransactionOption
- type MockTransactionOption_ApplyTransaction_Call
- func (_c *MockTransactionOption_ApplyTransaction_Call) Return() *MockTransactionOption_ApplyTransaction_Call
- func (_c *MockTransactionOption_ApplyTransaction_Call) Run(run func(_a0 Transaction)) *MockTransactionOption_ApplyTransaction_Call
- func (_c *MockTransactionOption_ApplyTransaction_Call) RunAndReturn(run func(Transaction)) *MockTransactionOption_ApplyTransaction_Call
- type MockTransactionOption_Expecter
- type MockTransaction_Context_Call
- type MockTransaction_Expecter
- func (_e *MockTransaction_Expecter) Context() *MockTransaction_Context_Call
- func (_e *MockTransaction_Expecter) Finish(status interface{}) *MockTransaction_Finish_Call
- func (_e *MockTransaction_Expecter) SetData(key interface{}, value interface{}) *MockTransaction_SetData_Call
- func (_e *MockTransaction_Expecter) SetName(name interface{}) *MockTransaction_SetName_Call
- func (_e *MockTransaction_Expecter) SetTag(key interface{}, value interface{}) *MockTransaction_SetTag_Call
- func (_e *MockTransaction_Expecter) StartChild(operation interface{}, opts ...interface{}) *MockTransaction_StartChild_Call
- type MockTransaction_Finish_Call
- type MockTransaction_SetData_Call
- func (_c *MockTransaction_SetData_Call) Return() *MockTransaction_SetData_Call
- func (_c *MockTransaction_SetData_Call) Run(run func(key string, value interface{})) *MockTransaction_SetData_Call
- func (_c *MockTransaction_SetData_Call) RunAndReturn(run func(string, interface{})) *MockTransaction_SetData_Call
- type MockTransaction_SetName_Call
- type MockTransaction_SetTag_Call
- type MockTransaction_StartChild_Call
- func (_c *MockTransaction_StartChild_Call) Return(_a0 Span) *MockTransaction_StartChild_Call
- func (_c *MockTransaction_StartChild_Call) Run(run func(operation string, opts ...SpanOption)) *MockTransaction_StartChild_Call
- func (_c *MockTransaction_StartChild_Call) RunAndReturn(run func(string, ...SpanOption) Span) *MockTransaction_StartChild_Call
- type MockeventOptionFunc
- type MockeventOptionFunc_Execute_Call
- type MockeventOptionFunc_Expecter
- type MockspanOptionFunc
- type MockspanOptionFunc_Execute_Call
- type MockspanOptionFunc_Expecter
- type MocktransactionOptionFunc
- type MocktransactionOptionFunc_Execute_Call
- func (_c *MocktransactionOptionFunc_Execute_Call) Return() *MocktransactionOptionFunc_Execute_Call
- func (_c *MocktransactionOptionFunc_Execute_Call) Run(run func(_a0 Transaction)) *MocktransactionOptionFunc_Execute_Call
- func (_c *MocktransactionOptionFunc_Execute_Call) RunAndReturn(run func(Transaction)) *MocktransactionOptionFunc_Execute_Call
- type MocktransactionOptionFunc_Expecter
- type Observer
- type OpenTelemetryMetricsConfig
- type PropagationConfig
- type Span
- type SpanBuilder
- func (sb *SpanBuilder) Start(ctx context.Context) (context.Context, Span)
- func (sb *SpanBuilder) WithComponent(component string) *SpanBuilder
- func (sb *SpanBuilder) WithLayer(layer string) *SpanBuilder
- func (sb *SpanBuilder) WithOperation(operation string) *SpanBuilder
- func (sb *SpanBuilder) WithService(service string) *SpanBuilder
- func (sb *SpanBuilder) WithTag(key, value string) *SpanBuilder
- type SpanOption
- type Transaction
- type TransactionOption
- type TransactionStatus
Constants ¶
const ( ProviderSentry = "sentry" ProviderSigNoz = "signoz" )
Provider constants
const ( PropagationW3C = "w3c" PropagationB3 = "b3" PropagationB3Single = "b3-single" PropagationJaeger = "jaeger" )
Propagation format constants
const ( EnvironmentProduction = "production" EnvironmentDevelopment = "development" EnvironmentStaging = "staging" EnvironmentLocal = "local" )
Environment constants for observability configuration
const ( TagOperation = "operation" TagService = "service" TagComponent = "component" TagLayer = "layer" TagMethod = "method" LayerService = "service" LayerRepository = "repository" )
Common tag keys for spans and transactions
const ( ResourceServiceName = "service.name" ResourceServiceVersion = "service.version" ResourceServiceType = "service.type" ResourceTargetService = "target.service" ResourceEnvironment = "deployment.environment" ResourceLanguage = "library.language" ResourceHostName = "host.name" ResourceProcessPID = "process.pid" )
OpenTelemetry Resource attribute keys - these are standard across all providers
const ( // Network attributes for external API detection SpanAttributeNetPeerName = "net.peer.name" // Domain or host of the external service (e.g., "api.stripe.com") SpanAttributeHTTPURL = "http.url" // Complete URL of the request (e.g., "https://api.stripe.com/v1/charges") SpanAttributeHTTPTarget = "http.target" // Path portion of the URL (e.g., "/v1/charges") SpanAttributeHTTPMethod = "http.method" // HTTP method (GET, POST, etc.) SpanAttributeHTTPScheme = "http.scheme" // HTTP scheme (http, https) SpanAttributeHTTPHost = "http.host" // HTTP host header value // gRPC attributes for external service calls SpanAttributeRPCSystem = "rpc.system" // RPC system identifier (e.g., "grpc") // Response attributes SpanAttributeHTTPStatusCode = "http.status_code" // HTTP response status code SpanAttributeRPCGRPCStatusCode = "rpc.grpc.status_code" // gRPC status code )
External API Monitoring attributes (SigNoz semantic conventions) These attributes are used by SigNoz to automatically detect and categorize external API calls
const ( // RPC system values RPCSystemGRPC = "grpc" RPCSystemHTTP = "http" // HTTP schemes HTTPSchemeHTTP = "http" HTTPSchemeHTTPS = "https" )
External API categorization values
const ( UserAttributeID = "user.id" UserAttributeEmail = "user.email" UserAttributeUsername = "user.username" )
User attribute keys
const ( FingerprintAttribute = "fingerprint" FingerprintSeparator = "," )
Fingerprint attribute key
const ( TransactionSuccessMessage = "" TransactionFailureMessage = "transaction failed" TransactionCancelledMessage = "transaction cancelled" )
Transaction status messages
const ( // Export modes OTelExportModePush = "push" OTelExportModeEndpoint = "endpoint" // Default intervals DefaultPushInterval = 30 * time.Second DefaultBatchTimeout = 5 * time.Second DefaultExportTimeout = 30 * time.Second )
Constants for OpenTelemetry metrics configuration
const (
ResourceLanguageGo = "go"
)
OpenTelemetry Resource attribute values
const (
SpanAttributeLevel = "level"
)
OpenTelemetry Span attribute keys
Variables ¶
This section is empty.
Functions ¶
func GetHostname ¶ added in v0.26.0
func GetHostname() string
GetHostname returns the hostname - now ALWAYS included for service identification Hostname is crucial for: - Multi-server deployments (identifying which server handled the request) - Load balancer debugging (tracking requests across instances) - Performance analysis (comparing server performance) - Incident response (knowing exactly which server had issues)
Uses sync.Once to ensure hostname detection only happens once per process lifecycle
Types ¶
type Config ¶
type Config struct {
Provider string `yaml:"provider" mapstructure:"provider"`
Enabled bool `yaml:"enabled" mapstructure:"enabled"` // Enable/disable observability
Environment string `yaml:"environment" mapstructure:"environment"`
Release string `yaml:"release" mapstructure:"release"`
Debug bool `yaml:"debug" mapstructure:"debug"`
Address string `yaml:"address" mapstructure:"address"` // Common endpoint/address/dsn for providers
SampleRate float64 `yaml:"sample_rate" mapstructure:"sample_rate"` // Common sampling rate
Middleware MiddlewareConfig `yaml:"middleware" mapstructure:"middleware"`
Metrics MetricsConfig `yaml:"metrics" mapstructure:"metrics"` // Metrics configuration
Propagation PropagationConfig `yaml:"propagation" mapstructure:"propagation"` // Trace propagation configuration
CustomConfig map[string]string `yaml:"custom_config" mapstructure:"custom_config"` // Provider-specific configuration
TracingExclusions []string `yaml:"tracing_exclusions" mapstructure:"tracing_exclusions"` // methods to exclude from tracing
}
Config holds configuration for all observability features (tracing, logging, metrics)
func (*Config) SetDefaults ¶
func (c *Config) SetDefaults()
type EventOption ¶
type EventOption interface {
ApplyEvent(Event)
}
func WithEventError ¶
func WithEventError(err error) EventOption
func WithEventFingerprint ¶
func WithEventFingerprint(fingerprint []string) EventOption
func WithEventLevel ¶
func WithEventLevel(level Level) EventOption
func WithEventTag ¶
func WithEventTag(key, value string) EventOption
func WithEventTags ¶
func WithEventTags(tags map[string]string) EventOption
func WithEventUser ¶
func WithEventUser(id, email, username string) EventOption
type EventSpanBuilder ¶
type EventSpanBuilder struct {
*SpanBuilder
// contains filtered or unexported fields
}
EventSpanBuilder creates spans with layer prefix in operation name for better visibility
func NewEventSpanBuilder ¶
func NewEventSpanBuilder(observer Observer, operation, layer string) *EventSpanBuilder
NewEventSpanBuilder creates a new event span builder with layer prefix in operation name
type MetricDefinition ¶
type MetricDefinition struct {
Name string
Help string
Type MetricType
LabelNames []string
Buckets []float64 // Only used for histograms
}
MetricDefinition defines a metric to be registered
type MetricType ¶
type MetricType int
MetricType represents the type of metric
const ( MetricTypeCounter MetricType = iota MetricTypeGauge MetricTypeHistogram )
type MetricsConfig ¶
type MetricsConfig struct {
Enabled bool `yaml:"enabled" mapstructure:"enabled"`
Provider string `yaml:"provider" mapstructure:"provider"` // Use MetricsProviderType constants
Path string `yaml:"path" mapstructure:"path"` // Metrics endpoint path (legacy)
Port int `yaml:"port" mapstructure:"port"` // Metrics server port (legacy)
OpenTelemetry OpenTelemetryMetricsConfig `yaml:"opentelemetry" mapstructure:"opentelemetry"` // OpenTelemetry specific config
}
MetricsConfig holds configuration for metrics
func DefaultMetricsConfig ¶
func DefaultMetricsConfig() MetricsConfig
DefaultMetricsConfig returns default metrics configuration
func (MetricsConfig) Validate ¶
func (c MetricsConfig) Validate() error
Validate validates the metrics configuration
type MetricsProvider ¶
type MetricsProvider interface {
// Counter operations
IncrementCounter(ctx context.Context, name string, labels map[string]string) error
AddCounter(ctx context.Context, name string, value float64, labels map[string]string) error
// Gauge operations
SetGauge(ctx context.Context, name string, value float64, labels map[string]string) error
AddGauge(ctx context.Context, name string, value float64, labels map[string]string) error
// Histogram operations
RecordHistogram(ctx context.Context, name string, value float64, labels map[string]string) error
// Timer operations
RecordDuration(ctx context.Context, name string, duration time.Duration, labels map[string]string) error
// Metric registration
RegisterCounter(name, help string, labelNames []string) error
RegisterGauge(name, help string, labelNames []string) error
RegisterHistogram(name, help string, labelNames []string, buckets []float64) error
// Lifecycle
Start() error
Stop() error
Name() string
}
MetricsProvider defines the interface for metrics operations Trace correlation is handled transparently when context is available
func NewMetricsProvider ¶
func NewMetricsProvider(name string, config MetricsConfig) (MetricsProvider, error)
NewMetricsProvider creates a new metrics provider based on the configuration
func NewNoopMetricsProvider ¶
func NewNoopMetricsProvider(name string) MetricsProvider
NewNoopMetricsProvider creates a new no-operation metrics provider
func NewOpenTelemetryMetricsProvider ¶
func NewOpenTelemetryMetricsProvider(name string, config MetricsConfig) (MetricsProvider, error)
NewOpenTelemetryMetricsProvider creates a new OpenTelemetry metrics provider
type MetricsProviderType ¶
type MetricsProviderType string
MetricsProviderType represents the type of metrics provider
const ( MetricsProviderOpenTelemetry MetricsProviderType = "opentelemetry" MetricsProviderNoop MetricsProviderType = "noop" )
type MiddlewareConfig ¶
type MiddlewareConfig struct {
CaptureErrors bool `yaml:"capture_errors" mapstructure:"capture_errors"`
}
type MockEvent ¶
MockEvent is an autogenerated mock type for the Event type
func NewMockEvent ¶
NewMockEvent creates a new instance of MockEvent. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockEvent) Capture ¶
func (_m *MockEvent) Capture()
Capture provides a mock function with no fields
func (*MockEvent) EXPECT ¶
func (_m *MockEvent) EXPECT() *MockEvent_Expecter
func (*MockEvent) SetFingerprint ¶
SetFingerprint provides a mock function with given fields: fingerprint
type MockEventOption ¶
MockEventOption is an autogenerated mock type for the EventOption type
func NewMockEventOption ¶
func NewMockEventOption(t interface {
mock.TestingT
Cleanup(func())
}) *MockEventOption
NewMockEventOption creates a new instance of MockEventOption. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockEventOption) ApplyEvent ¶
func (_m *MockEventOption) ApplyEvent(_a0 Event)
ApplyEvent provides a mock function with given fields: _a0
func (*MockEventOption) EXPECT ¶
func (_m *MockEventOption) EXPECT() *MockEventOption_Expecter
type MockEventOption_ApplyEvent_Call ¶
MockEventOption_ApplyEvent_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ApplyEvent'
func (*MockEventOption_ApplyEvent_Call) Return ¶
func (_c *MockEventOption_ApplyEvent_Call) Return() *MockEventOption_ApplyEvent_Call
func (*MockEventOption_ApplyEvent_Call) Run ¶
func (_c *MockEventOption_ApplyEvent_Call) Run(run func(_a0 Event)) *MockEventOption_ApplyEvent_Call
func (*MockEventOption_ApplyEvent_Call) RunAndReturn ¶
func (_c *MockEventOption_ApplyEvent_Call) RunAndReturn(run func(Event)) *MockEventOption_ApplyEvent_Call
type MockEventOption_Expecter ¶
type MockEventOption_Expecter struct {
// contains filtered or unexported fields
}
func (*MockEventOption_Expecter) ApplyEvent ¶
func (_e *MockEventOption_Expecter) ApplyEvent(_a0 interface{}) *MockEventOption_ApplyEvent_Call
ApplyEvent is a helper method to define mock.On call
- _a0 Event
type MockEvent_Capture_Call ¶
MockEvent_Capture_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Capture'
func (*MockEvent_Capture_Call) Return ¶
func (_c *MockEvent_Capture_Call) Return() *MockEvent_Capture_Call
func (*MockEvent_Capture_Call) Run ¶
func (_c *MockEvent_Capture_Call) Run(run func()) *MockEvent_Capture_Call
func (*MockEvent_Capture_Call) RunAndReturn ¶
func (_c *MockEvent_Capture_Call) RunAndReturn(run func()) *MockEvent_Capture_Call
type MockEvent_Expecter ¶
type MockEvent_Expecter struct {
// contains filtered or unexported fields
}
func (*MockEvent_Expecter) Capture ¶
func (_e *MockEvent_Expecter) Capture() *MockEvent_Capture_Call
Capture is a helper method to define mock.On call
func (*MockEvent_Expecter) SetError ¶
func (_e *MockEvent_Expecter) SetError(err interface{}) *MockEvent_SetError_Call
SetError is a helper method to define mock.On call
- err error
func (*MockEvent_Expecter) SetFingerprint ¶
func (_e *MockEvent_Expecter) SetFingerprint(fingerprint interface{}) *MockEvent_SetFingerprint_Call
SetFingerprint is a helper method to define mock.On call
- fingerprint []string
func (*MockEvent_Expecter) SetLevel ¶
func (_e *MockEvent_Expecter) SetLevel(level interface{}) *MockEvent_SetLevel_Call
SetLevel is a helper method to define mock.On call
- level Level
func (*MockEvent_Expecter) SetTag ¶
func (_e *MockEvent_Expecter) SetTag(key interface{}, value interface{}) *MockEvent_SetTag_Call
SetTag is a helper method to define mock.On call
- key string
- value string
func (*MockEvent_Expecter) SetTags ¶
func (_e *MockEvent_Expecter) SetTags(tags interface{}) *MockEvent_SetTags_Call
SetTags is a helper method to define mock.On call
- tags map[string]string
func (*MockEvent_Expecter) SetUser ¶
func (_e *MockEvent_Expecter) SetUser(id interface{}, email interface{}, username interface{}) *MockEvent_SetUser_Call
SetUser is a helper method to define mock.On call
- id string
- email string
- username string
type MockEvent_SetError_Call ¶
MockEvent_SetError_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetError'
func (*MockEvent_SetError_Call) Return ¶
func (_c *MockEvent_SetError_Call) Return() *MockEvent_SetError_Call
func (*MockEvent_SetError_Call) Run ¶
func (_c *MockEvent_SetError_Call) Run(run func(err error)) *MockEvent_SetError_Call
func (*MockEvent_SetError_Call) RunAndReturn ¶
func (_c *MockEvent_SetError_Call) RunAndReturn(run func(error)) *MockEvent_SetError_Call
type MockEvent_SetFingerprint_Call ¶
MockEvent_SetFingerprint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetFingerprint'
func (*MockEvent_SetFingerprint_Call) Return ¶
func (_c *MockEvent_SetFingerprint_Call) Return() *MockEvent_SetFingerprint_Call
func (*MockEvent_SetFingerprint_Call) Run ¶
func (_c *MockEvent_SetFingerprint_Call) Run(run func(fingerprint []string)) *MockEvent_SetFingerprint_Call
func (*MockEvent_SetFingerprint_Call) RunAndReturn ¶
func (_c *MockEvent_SetFingerprint_Call) RunAndReturn(run func([]string)) *MockEvent_SetFingerprint_Call
type MockEvent_SetLevel_Call ¶
MockEvent_SetLevel_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetLevel'
func (*MockEvent_SetLevel_Call) Return ¶
func (_c *MockEvent_SetLevel_Call) Return() *MockEvent_SetLevel_Call
func (*MockEvent_SetLevel_Call) Run ¶
func (_c *MockEvent_SetLevel_Call) Run(run func(level Level)) *MockEvent_SetLevel_Call
func (*MockEvent_SetLevel_Call) RunAndReturn ¶
func (_c *MockEvent_SetLevel_Call) RunAndReturn(run func(Level)) *MockEvent_SetLevel_Call
type MockEvent_SetTag_Call ¶
MockEvent_SetTag_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetTag'
func (*MockEvent_SetTag_Call) Return ¶
func (_c *MockEvent_SetTag_Call) Return() *MockEvent_SetTag_Call
func (*MockEvent_SetTag_Call) Run ¶
func (_c *MockEvent_SetTag_Call) Run(run func(key string, value string)) *MockEvent_SetTag_Call
func (*MockEvent_SetTag_Call) RunAndReturn ¶
func (_c *MockEvent_SetTag_Call) RunAndReturn(run func(string, string)) *MockEvent_SetTag_Call
type MockEvent_SetTags_Call ¶
MockEvent_SetTags_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetTags'
func (*MockEvent_SetTags_Call) Return ¶
func (_c *MockEvent_SetTags_Call) Return() *MockEvent_SetTags_Call
func (*MockEvent_SetTags_Call) Run ¶
func (_c *MockEvent_SetTags_Call) Run(run func(tags map[string]string)) *MockEvent_SetTags_Call
func (*MockEvent_SetTags_Call) RunAndReturn ¶
func (_c *MockEvent_SetTags_Call) RunAndReturn(run func(map[string]string)) *MockEvent_SetTags_Call
type MockEvent_SetUser_Call ¶
MockEvent_SetUser_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetUser'
func (*MockEvent_SetUser_Call) Return ¶
func (_c *MockEvent_SetUser_Call) Return() *MockEvent_SetUser_Call
func (*MockEvent_SetUser_Call) Run ¶
func (_c *MockEvent_SetUser_Call) Run(run func(id string, email string, username string)) *MockEvent_SetUser_Call
func (*MockEvent_SetUser_Call) RunAndReturn ¶
func (_c *MockEvent_SetUser_Call) RunAndReturn(run func(string, string, string)) *MockEvent_SetUser_Call
type MockMetricsProvider ¶
MockMetricsProvider is an autogenerated mock type for the MetricsProvider type
func NewMockMetricsProvider ¶
func NewMockMetricsProvider(t interface {
mock.TestingT
Cleanup(func())
}) *MockMetricsProvider
NewMockMetricsProvider creates a new instance of MockMetricsProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockMetricsProvider) AddToCounter ¶
func (_m *MockMetricsProvider) AddToCounter(ctx context.Context, name string, value float64, labels map[string]string) error
AddToCounter provides a mock function with given fields: ctx, name, value, labels
func (*MockMetricsProvider) AddToGauge ¶
func (_m *MockMetricsProvider) AddToGauge(ctx context.Context, name string, value float64, labels map[string]string) error
AddToGauge provides a mock function with given fields: ctx, name, value, labels
func (*MockMetricsProvider) EXPECT ¶
func (_m *MockMetricsProvider) EXPECT() *MockMetricsProvider_Expecter
func (*MockMetricsProvider) IncrementCounter ¶
func (_m *MockMetricsProvider) IncrementCounter(ctx context.Context, name string, labels map[string]string) error
IncrementCounter provides a mock function with given fields: ctx, name, labels
func (*MockMetricsProvider) Name ¶
func (_m *MockMetricsProvider) Name() string
Name provides a mock function with no fields
func (*MockMetricsProvider) RecordDuration ¶
func (_m *MockMetricsProvider) RecordDuration(ctx context.Context, name string, duration time.Duration, labels map[string]string) error
RecordDuration provides a mock function with given fields: ctx, name, duration, labels
func (*MockMetricsProvider) RecordHistogram ¶
func (_m *MockMetricsProvider) RecordHistogram(ctx context.Context, name string, value float64, labels map[string]string) error
RecordHistogram provides a mock function with given fields: ctx, name, value, labels
func (*MockMetricsProvider) RegisterCounter ¶
func (_m *MockMetricsProvider) RegisterCounter(name string, help string, labelNames []string) error
RegisterCounter provides a mock function with given fields: name, help, labelNames
func (*MockMetricsProvider) RegisterGauge ¶
func (_m *MockMetricsProvider) RegisterGauge(name string, help string, labelNames []string) error
RegisterGauge provides a mock function with given fields: name, help, labelNames
func (*MockMetricsProvider) RegisterHistogram ¶
func (_m *MockMetricsProvider) RegisterHistogram(name string, help string, labelNames []string, buckets []float64) error
RegisterHistogram provides a mock function with given fields: name, help, labelNames, buckets
func (*MockMetricsProvider) SetGauge ¶
func (_m *MockMetricsProvider) SetGauge(ctx context.Context, name string, value float64, labels map[string]string) error
SetGauge provides a mock function with given fields: ctx, name, value, labels
func (*MockMetricsProvider) Start ¶
func (_m *MockMetricsProvider) Start() error
Start provides a mock function with no fields
func (*MockMetricsProvider) Stop ¶
func (_m *MockMetricsProvider) Stop() error
Stop provides a mock function with no fields
type MockMetricsProvider_AddToCounter_Call ¶
MockMetricsProvider_AddToCounter_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddToCounter'
func (*MockMetricsProvider_AddToCounter_Call) Return ¶
func (_c *MockMetricsProvider_AddToCounter_Call) Return(_a0 error) *MockMetricsProvider_AddToCounter_Call
func (*MockMetricsProvider_AddToCounter_Call) Run ¶
func (_c *MockMetricsProvider_AddToCounter_Call) Run(run func(ctx context.Context, name string, value float64, labels map[string]string)) *MockMetricsProvider_AddToCounter_Call
func (*MockMetricsProvider_AddToCounter_Call) RunAndReturn ¶
func (_c *MockMetricsProvider_AddToCounter_Call) RunAndReturn(run func(context.Context, string, float64, map[string]string) error) *MockMetricsProvider_AddToCounter_Call
type MockMetricsProvider_AddToGauge_Call ¶
MockMetricsProvider_AddToGauge_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddToGauge'
func (*MockMetricsProvider_AddToGauge_Call) Return ¶
func (_c *MockMetricsProvider_AddToGauge_Call) Return(_a0 error) *MockMetricsProvider_AddToGauge_Call
func (*MockMetricsProvider_AddToGauge_Call) Run ¶
func (_c *MockMetricsProvider_AddToGauge_Call) Run(run func(ctx context.Context, name string, value float64, labels map[string]string)) *MockMetricsProvider_AddToGauge_Call
func (*MockMetricsProvider_AddToGauge_Call) RunAndReturn ¶
func (_c *MockMetricsProvider_AddToGauge_Call) RunAndReturn(run func(context.Context, string, float64, map[string]string) error) *MockMetricsProvider_AddToGauge_Call
type MockMetricsProvider_Expecter ¶
type MockMetricsProvider_Expecter struct {
// contains filtered or unexported fields
}
func (*MockMetricsProvider_Expecter) AddToCounter ¶
func (_e *MockMetricsProvider_Expecter) AddToCounter(ctx interface{}, name interface{}, value interface{}, labels interface{}) *MockMetricsProvider_AddToCounter_Call
AddToCounter is a helper method to define mock.On call
- ctx context.Context
- name string
- value float64
- labels map[string]string
func (*MockMetricsProvider_Expecter) AddToGauge ¶
func (_e *MockMetricsProvider_Expecter) AddToGauge(ctx interface{}, name interface{}, value interface{}, labels interface{}) *MockMetricsProvider_AddToGauge_Call
AddToGauge is a helper method to define mock.On call
- ctx context.Context
- name string
- value float64
- labels map[string]string
func (*MockMetricsProvider_Expecter) IncrementCounter ¶
func (_e *MockMetricsProvider_Expecter) IncrementCounter(ctx interface{}, name interface{}, labels interface{}) *MockMetricsProvider_IncrementCounter_Call
IncrementCounter is a helper method to define mock.On call
- ctx context.Context
- name string
- labels map[string]string
func (*MockMetricsProvider_Expecter) Name ¶
func (_e *MockMetricsProvider_Expecter) Name() *MockMetricsProvider_Name_Call
Name is a helper method to define mock.On call
func (*MockMetricsProvider_Expecter) RecordDuration ¶
func (_e *MockMetricsProvider_Expecter) RecordDuration(ctx interface{}, name interface{}, duration interface{}, labels interface{}) *MockMetricsProvider_RecordDuration_Call
RecordDuration is a helper method to define mock.On call
- ctx context.Context
- name string
- duration time.Duration
- labels map[string]string
func (*MockMetricsProvider_Expecter) RecordHistogram ¶
func (_e *MockMetricsProvider_Expecter) RecordHistogram(ctx interface{}, name interface{}, value interface{}, labels interface{}) *MockMetricsProvider_RecordHistogram_Call
RecordHistogram is a helper method to define mock.On call
- ctx context.Context
- name string
- value float64
- labels map[string]string
func (*MockMetricsProvider_Expecter) RegisterCounter ¶
func (_e *MockMetricsProvider_Expecter) RegisterCounter(name interface{}, help interface{}, labelNames interface{}) *MockMetricsProvider_RegisterCounter_Call
RegisterCounter is a helper method to define mock.On call
- name string
- help string
- labelNames []string
func (*MockMetricsProvider_Expecter) RegisterGauge ¶
func (_e *MockMetricsProvider_Expecter) RegisterGauge(name interface{}, help interface{}, labelNames interface{}) *MockMetricsProvider_RegisterGauge_Call
RegisterGauge is a helper method to define mock.On call
- name string
- help string
- labelNames []string
func (*MockMetricsProvider_Expecter) RegisterHistogram ¶
func (_e *MockMetricsProvider_Expecter) RegisterHistogram(name interface{}, help interface{}, labelNames interface{}, buckets interface{}) *MockMetricsProvider_RegisterHistogram_Call
RegisterHistogram is a helper method to define mock.On call
- name string
- help string
- labelNames []string
- buckets []float64
func (*MockMetricsProvider_Expecter) SetGauge ¶
func (_e *MockMetricsProvider_Expecter) SetGauge(ctx interface{}, name interface{}, value interface{}, labels interface{}) *MockMetricsProvider_SetGauge_Call
SetGauge is a helper method to define mock.On call
- ctx context.Context
- name string
- value float64
- labels map[string]string
func (*MockMetricsProvider_Expecter) Start ¶
func (_e *MockMetricsProvider_Expecter) Start() *MockMetricsProvider_Start_Call
Start is a helper method to define mock.On call
func (*MockMetricsProvider_Expecter) Stop ¶
func (_e *MockMetricsProvider_Expecter) Stop() *MockMetricsProvider_Stop_Call
Stop is a helper method to define mock.On call
type MockMetricsProvider_IncrementCounter_Call ¶
MockMetricsProvider_IncrementCounter_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IncrementCounter'
func (*MockMetricsProvider_IncrementCounter_Call) Return ¶
func (_c *MockMetricsProvider_IncrementCounter_Call) Return(_a0 error) *MockMetricsProvider_IncrementCounter_Call
func (*MockMetricsProvider_IncrementCounter_Call) Run ¶
func (_c *MockMetricsProvider_IncrementCounter_Call) Run(run func(ctx context.Context, name string, labels map[string]string)) *MockMetricsProvider_IncrementCounter_Call
func (*MockMetricsProvider_IncrementCounter_Call) RunAndReturn ¶
func (_c *MockMetricsProvider_IncrementCounter_Call) RunAndReturn(run func(context.Context, string, map[string]string) error) *MockMetricsProvider_IncrementCounter_Call
type MockMetricsProvider_Name_Call ¶
MockMetricsProvider_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name'
func (*MockMetricsProvider_Name_Call) Return ¶
func (_c *MockMetricsProvider_Name_Call) Return(_a0 string) *MockMetricsProvider_Name_Call
func (*MockMetricsProvider_Name_Call) Run ¶
func (_c *MockMetricsProvider_Name_Call) Run(run func()) *MockMetricsProvider_Name_Call
func (*MockMetricsProvider_Name_Call) RunAndReturn ¶
func (_c *MockMetricsProvider_Name_Call) RunAndReturn(run func() string) *MockMetricsProvider_Name_Call
type MockMetricsProvider_RecordDuration_Call ¶
MockMetricsProvider_RecordDuration_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RecordDuration'
func (*MockMetricsProvider_RecordDuration_Call) Return ¶
func (_c *MockMetricsProvider_RecordDuration_Call) Return(_a0 error) *MockMetricsProvider_RecordDuration_Call
func (*MockMetricsProvider_RecordDuration_Call) Run ¶
func (_c *MockMetricsProvider_RecordDuration_Call) Run(run func(ctx context.Context, name string, duration time.Duration, labels map[string]string)) *MockMetricsProvider_RecordDuration_Call
func (*MockMetricsProvider_RecordDuration_Call) RunAndReturn ¶
func (_c *MockMetricsProvider_RecordDuration_Call) RunAndReturn(run func(context.Context, string, time.Duration, map[string]string) error) *MockMetricsProvider_RecordDuration_Call
type MockMetricsProvider_RecordHistogram_Call ¶
MockMetricsProvider_RecordHistogram_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RecordHistogram'
func (*MockMetricsProvider_RecordHistogram_Call) Return ¶
func (_c *MockMetricsProvider_RecordHistogram_Call) Return(_a0 error) *MockMetricsProvider_RecordHistogram_Call
func (*MockMetricsProvider_RecordHistogram_Call) Run ¶
func (_c *MockMetricsProvider_RecordHistogram_Call) Run(run func(ctx context.Context, name string, value float64, labels map[string]string)) *MockMetricsProvider_RecordHistogram_Call
func (*MockMetricsProvider_RecordHistogram_Call) RunAndReturn ¶
func (_c *MockMetricsProvider_RecordHistogram_Call) RunAndReturn(run func(context.Context, string, float64, map[string]string) error) *MockMetricsProvider_RecordHistogram_Call
type MockMetricsProvider_RegisterCounter_Call ¶
MockMetricsProvider_RegisterCounter_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RegisterCounter'
func (*MockMetricsProvider_RegisterCounter_Call) Return ¶
func (_c *MockMetricsProvider_RegisterCounter_Call) Return(_a0 error) *MockMetricsProvider_RegisterCounter_Call
func (*MockMetricsProvider_RegisterCounter_Call) Run ¶
func (_c *MockMetricsProvider_RegisterCounter_Call) Run(run func(name string, help string, labelNames []string)) *MockMetricsProvider_RegisterCounter_Call
func (*MockMetricsProvider_RegisterCounter_Call) RunAndReturn ¶
func (_c *MockMetricsProvider_RegisterCounter_Call) RunAndReturn(run func(string, string, []string) error) *MockMetricsProvider_RegisterCounter_Call
type MockMetricsProvider_RegisterGauge_Call ¶
MockMetricsProvider_RegisterGauge_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RegisterGauge'
func (*MockMetricsProvider_RegisterGauge_Call) Return ¶
func (_c *MockMetricsProvider_RegisterGauge_Call) Return(_a0 error) *MockMetricsProvider_RegisterGauge_Call
func (*MockMetricsProvider_RegisterGauge_Call) Run ¶
func (_c *MockMetricsProvider_RegisterGauge_Call) Run(run func(name string, help string, labelNames []string)) *MockMetricsProvider_RegisterGauge_Call
func (*MockMetricsProvider_RegisterGauge_Call) RunAndReturn ¶
func (_c *MockMetricsProvider_RegisterGauge_Call) RunAndReturn(run func(string, string, []string) error) *MockMetricsProvider_RegisterGauge_Call
type MockMetricsProvider_RegisterHistogram_Call ¶
MockMetricsProvider_RegisterHistogram_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RegisterHistogram'
func (*MockMetricsProvider_RegisterHistogram_Call) Return ¶
func (_c *MockMetricsProvider_RegisterHistogram_Call) Return(_a0 error) *MockMetricsProvider_RegisterHistogram_Call
func (*MockMetricsProvider_RegisterHistogram_Call) Run ¶
func (_c *MockMetricsProvider_RegisterHistogram_Call) Run(run func(name string, help string, labelNames []string, buckets []float64)) *MockMetricsProvider_RegisterHistogram_Call
func (*MockMetricsProvider_RegisterHistogram_Call) RunAndReturn ¶
func (_c *MockMetricsProvider_RegisterHistogram_Call) RunAndReturn(run func(string, string, []string, []float64) error) *MockMetricsProvider_RegisterHistogram_Call
type MockMetricsProvider_SetGauge_Call ¶
MockMetricsProvider_SetGauge_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetGauge'
func (*MockMetricsProvider_SetGauge_Call) Return ¶
func (_c *MockMetricsProvider_SetGauge_Call) Return(_a0 error) *MockMetricsProvider_SetGauge_Call
func (*MockMetricsProvider_SetGauge_Call) Run ¶
func (_c *MockMetricsProvider_SetGauge_Call) Run(run func(ctx context.Context, name string, value float64, labels map[string]string)) *MockMetricsProvider_SetGauge_Call
func (*MockMetricsProvider_SetGauge_Call) RunAndReturn ¶
func (_c *MockMetricsProvider_SetGauge_Call) RunAndReturn(run func(context.Context, string, float64, map[string]string) error) *MockMetricsProvider_SetGauge_Call
type MockMetricsProvider_Start_Call ¶
MockMetricsProvider_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start'
func (*MockMetricsProvider_Start_Call) Return ¶
func (_c *MockMetricsProvider_Start_Call) Return(_a0 error) *MockMetricsProvider_Start_Call
func (*MockMetricsProvider_Start_Call) Run ¶
func (_c *MockMetricsProvider_Start_Call) Run(run func()) *MockMetricsProvider_Start_Call
func (*MockMetricsProvider_Start_Call) RunAndReturn ¶
func (_c *MockMetricsProvider_Start_Call) RunAndReturn(run func() error) *MockMetricsProvider_Start_Call
type MockMetricsProvider_Stop_Call ¶
MockMetricsProvider_Stop_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Stop'
func (*MockMetricsProvider_Stop_Call) Return ¶
func (_c *MockMetricsProvider_Stop_Call) Return(_a0 error) *MockMetricsProvider_Stop_Call
func (*MockMetricsProvider_Stop_Call) Run ¶
func (_c *MockMetricsProvider_Stop_Call) Run(run func()) *MockMetricsProvider_Stop_Call
func (*MockMetricsProvider_Stop_Call) RunAndReturn ¶
func (_c *MockMetricsProvider_Stop_Call) RunAndReturn(run func() error) *MockMetricsProvider_Stop_Call
type MockObserver ¶
MockObserver is an autogenerated mock type for the Observer type
func NewMockObserver ¶
func NewMockObserver(t interface {
mock.TestingT
Cleanup(func())
}) *MockObserver
NewMockObserver creates a new instance of MockObserver. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockObserver) CaptureException ¶
func (_m *MockObserver) CaptureException(ctx context.Context, err error, opts ...EventOption)
CaptureException provides a mock function with given fields: ctx, err, opts
func (*MockObserver) CaptureMessage ¶
func (_m *MockObserver) CaptureMessage(ctx context.Context, message string, level Level, opts ...EventOption)
CaptureMessage provides a mock function with given fields: ctx, message, level, opts
func (*MockObserver) Close ¶
func (_m *MockObserver) Close() error
Close provides a mock function with no fields
func (*MockObserver) EXPECT ¶
func (_m *MockObserver) EXPECT() *MockObserver_Expecter
func (*MockObserver) GetConfig ¶
func (_m *MockObserver) GetConfig() Config
GetConfig provides a mock function with no fields
func (*MockObserver) GetMetrics ¶
func (_m *MockObserver) GetMetrics() MetricsProvider
GetMetrics provides a mock function with no fields
func (*MockObserver) StartSpan ¶
func (_m *MockObserver) StartSpan(ctx context.Context, operation string, opts ...SpanOption) (context.Context, Span)
StartSpan provides a mock function with given fields: ctx, operation, opts
func (*MockObserver) StartTransaction ¶
func (_m *MockObserver) StartTransaction(ctx context.Context, name string, opts ...TransactionOption) Transaction
StartTransaction provides a mock function with given fields: ctx, name, opts
type MockObserver_CaptureException_Call ¶
MockObserver_CaptureException_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CaptureException'
func (*MockObserver_CaptureException_Call) Return ¶
func (_c *MockObserver_CaptureException_Call) Return() *MockObserver_CaptureException_Call
func (*MockObserver_CaptureException_Call) Run ¶
func (_c *MockObserver_CaptureException_Call) Run(run func(ctx context.Context, err error, opts ...EventOption)) *MockObserver_CaptureException_Call
func (*MockObserver_CaptureException_Call) RunAndReturn ¶
func (_c *MockObserver_CaptureException_Call) RunAndReturn(run func(context.Context, error, ...EventOption)) *MockObserver_CaptureException_Call
type MockObserver_CaptureMessage_Call ¶
MockObserver_CaptureMessage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CaptureMessage'
func (*MockObserver_CaptureMessage_Call) Return ¶
func (_c *MockObserver_CaptureMessage_Call) Return() *MockObserver_CaptureMessage_Call
func (*MockObserver_CaptureMessage_Call) Run ¶
func (_c *MockObserver_CaptureMessage_Call) Run(run func(ctx context.Context, message string, level Level, opts ...EventOption)) *MockObserver_CaptureMessage_Call
func (*MockObserver_CaptureMessage_Call) RunAndReturn ¶
func (_c *MockObserver_CaptureMessage_Call) RunAndReturn(run func(context.Context, string, Level, ...EventOption)) *MockObserver_CaptureMessage_Call
type MockObserver_Close_Call ¶
MockObserver_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close'
func (*MockObserver_Close_Call) Return ¶
func (_c *MockObserver_Close_Call) Return(_a0 error) *MockObserver_Close_Call
func (*MockObserver_Close_Call) Run ¶
func (_c *MockObserver_Close_Call) Run(run func()) *MockObserver_Close_Call
func (*MockObserver_Close_Call) RunAndReturn ¶
func (_c *MockObserver_Close_Call) RunAndReturn(run func() error) *MockObserver_Close_Call
type MockObserver_Expecter ¶
type MockObserver_Expecter struct {
// contains filtered or unexported fields
}
func (*MockObserver_Expecter) CaptureException ¶
func (_e *MockObserver_Expecter) CaptureException(ctx interface{}, err interface{}, opts ...interface{}) *MockObserver_CaptureException_Call
CaptureException is a helper method to define mock.On call
- ctx context.Context
- err error
- opts ...EventOption
func (*MockObserver_Expecter) CaptureMessage ¶
func (_e *MockObserver_Expecter) CaptureMessage(ctx interface{}, message interface{}, level interface{}, opts ...interface{}) *MockObserver_CaptureMessage_Call
CaptureMessage is a helper method to define mock.On call
- ctx context.Context
- message string
- level Level
- opts ...EventOption
func (*MockObserver_Expecter) Close ¶
func (_e *MockObserver_Expecter) Close() *MockObserver_Close_Call
Close is a helper method to define mock.On call
func (*MockObserver_Expecter) GetConfig ¶
func (_e *MockObserver_Expecter) GetConfig() *MockObserver_GetConfig_Call
GetConfig is a helper method to define mock.On call
func (*MockObserver_Expecter) GetMetrics ¶
func (_e *MockObserver_Expecter) GetMetrics() *MockObserver_GetMetrics_Call
GetMetrics is a helper method to define mock.On call
func (*MockObserver_Expecter) StartSpan ¶
func (_e *MockObserver_Expecter) StartSpan(ctx interface{}, operation interface{}, opts ...interface{}) *MockObserver_StartSpan_Call
StartSpan is a helper method to define mock.On call
- ctx context.Context
- operation string
- opts ...SpanOption
func (*MockObserver_Expecter) StartTransaction ¶
func (_e *MockObserver_Expecter) StartTransaction(ctx interface{}, name interface{}, opts ...interface{}) *MockObserver_StartTransaction_Call
StartTransaction is a helper method to define mock.On call
- ctx context.Context
- name string
- opts ...TransactionOption
type MockObserver_GetConfig_Call ¶
MockObserver_GetConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetConfig'
func (*MockObserver_GetConfig_Call) Return ¶
func (_c *MockObserver_GetConfig_Call) Return(_a0 Config) *MockObserver_GetConfig_Call
func (*MockObserver_GetConfig_Call) Run ¶
func (_c *MockObserver_GetConfig_Call) Run(run func()) *MockObserver_GetConfig_Call
func (*MockObserver_GetConfig_Call) RunAndReturn ¶
func (_c *MockObserver_GetConfig_Call) RunAndReturn(run func() Config) *MockObserver_GetConfig_Call
type MockObserver_GetMetrics_Call ¶
MockObserver_GetMetrics_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetMetrics'
func (*MockObserver_GetMetrics_Call) Return ¶
func (_c *MockObserver_GetMetrics_Call) Return(_a0 MetricsProvider) *MockObserver_GetMetrics_Call
func (*MockObserver_GetMetrics_Call) Run ¶
func (_c *MockObserver_GetMetrics_Call) Run(run func()) *MockObserver_GetMetrics_Call
func (*MockObserver_GetMetrics_Call) RunAndReturn ¶
func (_c *MockObserver_GetMetrics_Call) RunAndReturn(run func() MetricsProvider) *MockObserver_GetMetrics_Call
type MockObserver_StartSpan_Call ¶
MockObserver_StartSpan_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StartSpan'
func (*MockObserver_StartSpan_Call) Return ¶
func (_c *MockObserver_StartSpan_Call) Return(_a0 context.Context, _a1 Span) *MockObserver_StartSpan_Call
func (*MockObserver_StartSpan_Call) Run ¶
func (_c *MockObserver_StartSpan_Call) Run(run func(ctx context.Context, operation string, opts ...SpanOption)) *MockObserver_StartSpan_Call
func (*MockObserver_StartSpan_Call) RunAndReturn ¶
func (_c *MockObserver_StartSpan_Call) RunAndReturn(run func(context.Context, string, ...SpanOption) (context.Context, Span)) *MockObserver_StartSpan_Call
type MockObserver_StartTransaction_Call ¶
MockObserver_StartTransaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StartTransaction'
func (*MockObserver_StartTransaction_Call) Return ¶
func (_c *MockObserver_StartTransaction_Call) Return(_a0 Transaction) *MockObserver_StartTransaction_Call
func (*MockObserver_StartTransaction_Call) Run ¶
func (_c *MockObserver_StartTransaction_Call) Run(run func(ctx context.Context, name string, opts ...TransactionOption)) *MockObserver_StartTransaction_Call
func (*MockObserver_StartTransaction_Call) RunAndReturn ¶
func (_c *MockObserver_StartTransaction_Call) RunAndReturn(run func(context.Context, string, ...TransactionOption) Transaction) *MockObserver_StartTransaction_Call
type MockSpan ¶
MockSpan is an autogenerated mock type for the Span type
func NewMockSpan ¶
NewMockSpan creates a new instance of MockSpan. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockSpan) EXPECT ¶
func (_m *MockSpan) EXPECT() *MockSpan_Expecter
func (*MockSpan) Finish ¶
func (_m *MockSpan) Finish()
Finish provides a mock function with no fields
type MockSpanOption ¶
MockSpanOption is an autogenerated mock type for the SpanOption type
func NewMockSpanOption ¶
func NewMockSpanOption(t interface {
mock.TestingT
Cleanup(func())
}) *MockSpanOption
NewMockSpanOption creates a new instance of MockSpanOption. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockSpanOption) ApplySpan ¶
func (_m *MockSpanOption) ApplySpan(_a0 Span)
ApplySpan provides a mock function with given fields: _a0
func (*MockSpanOption) EXPECT ¶
func (_m *MockSpanOption) EXPECT() *MockSpanOption_Expecter
type MockSpanOption_ApplySpan_Call ¶
MockSpanOption_ApplySpan_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ApplySpan'
func (*MockSpanOption_ApplySpan_Call) Return ¶
func (_c *MockSpanOption_ApplySpan_Call) Return() *MockSpanOption_ApplySpan_Call
func (*MockSpanOption_ApplySpan_Call) Run ¶
func (_c *MockSpanOption_ApplySpan_Call) Run(run func(_a0 Span)) *MockSpanOption_ApplySpan_Call
func (*MockSpanOption_ApplySpan_Call) RunAndReturn ¶
func (_c *MockSpanOption_ApplySpan_Call) RunAndReturn(run func(Span)) *MockSpanOption_ApplySpan_Call
type MockSpanOption_Expecter ¶
type MockSpanOption_Expecter struct {
// contains filtered or unexported fields
}
func (*MockSpanOption_Expecter) ApplySpan ¶
func (_e *MockSpanOption_Expecter) ApplySpan(_a0 interface{}) *MockSpanOption_ApplySpan_Call
ApplySpan is a helper method to define mock.On call
- _a0 Span
type MockSpan_Expecter ¶
type MockSpan_Expecter struct {
// contains filtered or unexported fields
}
func (*MockSpan_Expecter) Finish ¶
func (_e *MockSpan_Expecter) Finish() *MockSpan_Finish_Call
Finish is a helper method to define mock.On call
func (*MockSpan_Expecter) SetData ¶
func (_e *MockSpan_Expecter) SetData(key interface{}, value interface{}) *MockSpan_SetData_Call
SetData is a helper method to define mock.On call
- key string
- value interface{}
func (*MockSpan_Expecter) SetError ¶
func (_e *MockSpan_Expecter) SetError(err interface{}, opts ...interface{}) *MockSpan_SetError_Call
SetError is a helper method to define mock.On call
- err error
- opts ...trace.EventOption
func (*MockSpan_Expecter) SetTag ¶
func (_e *MockSpan_Expecter) SetTag(key interface{}, value interface{}) *MockSpan_SetTag_Call
SetTag is a helper method to define mock.On call
- key string
- value string
type MockSpan_Finish_Call ¶
MockSpan_Finish_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Finish'
func (*MockSpan_Finish_Call) Return ¶
func (_c *MockSpan_Finish_Call) Return() *MockSpan_Finish_Call
func (*MockSpan_Finish_Call) Run ¶
func (_c *MockSpan_Finish_Call) Run(run func()) *MockSpan_Finish_Call
func (*MockSpan_Finish_Call) RunAndReturn ¶
func (_c *MockSpan_Finish_Call) RunAndReturn(run func()) *MockSpan_Finish_Call
type MockSpan_SetData_Call ¶
MockSpan_SetData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetData'
func (*MockSpan_SetData_Call) Return ¶
func (_c *MockSpan_SetData_Call) Return() *MockSpan_SetData_Call
func (*MockSpan_SetData_Call) Run ¶
func (_c *MockSpan_SetData_Call) Run(run func(key string, value interface{})) *MockSpan_SetData_Call
func (*MockSpan_SetData_Call) RunAndReturn ¶
func (_c *MockSpan_SetData_Call) RunAndReturn(run func(string, interface{})) *MockSpan_SetData_Call
type MockSpan_SetError_Call ¶
MockSpan_SetError_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetError'
func (*MockSpan_SetError_Call) Return ¶
func (_c *MockSpan_SetError_Call) Return() *MockSpan_SetError_Call
func (*MockSpan_SetError_Call) Run ¶
func (_c *MockSpan_SetError_Call) Run(run func(err error, opts ...trace.EventOption)) *MockSpan_SetError_Call
func (*MockSpan_SetError_Call) RunAndReturn ¶
func (_c *MockSpan_SetError_Call) RunAndReturn(run func(error, ...trace.EventOption)) *MockSpan_SetError_Call
type MockSpan_SetTag_Call ¶
MockSpan_SetTag_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetTag'
func (*MockSpan_SetTag_Call) Return ¶
func (_c *MockSpan_SetTag_Call) Return() *MockSpan_SetTag_Call
func (*MockSpan_SetTag_Call) Run ¶
func (_c *MockSpan_SetTag_Call) Run(run func(key string, value string)) *MockSpan_SetTag_Call
func (*MockSpan_SetTag_Call) RunAndReturn ¶
func (_c *MockSpan_SetTag_Call) RunAndReturn(run func(string, string)) *MockSpan_SetTag_Call
type MockTransaction ¶
MockTransaction is an autogenerated mock type for the Transaction type
func NewMockTransaction ¶
func NewMockTransaction(t interface {
mock.TestingT
Cleanup(func())
}) *MockTransaction
NewMockTransaction creates a new instance of MockTransaction. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockTransaction) Context ¶
func (_m *MockTransaction) Context() context.Context
Context provides a mock function with no fields
func (*MockTransaction) EXPECT ¶
func (_m *MockTransaction) EXPECT() *MockTransaction_Expecter
func (*MockTransaction) Finish ¶
func (_m *MockTransaction) Finish(status TransactionStatus)
Finish provides a mock function with given fields: status
func (*MockTransaction) SetData ¶
func (_m *MockTransaction) SetData(key string, value interface{})
SetData provides a mock function with given fields: key, value
func (*MockTransaction) SetName ¶
func (_m *MockTransaction) SetName(name string)
SetName provides a mock function with given fields: name
func (*MockTransaction) SetTag ¶
func (_m *MockTransaction) SetTag(key string, value string)
SetTag provides a mock function with given fields: key, value
func (*MockTransaction) StartChild ¶
func (_m *MockTransaction) StartChild(operation string, opts ...SpanOption) Span
StartChild provides a mock function with given fields: operation, opts
type MockTransactionOption ¶
MockTransactionOption is an autogenerated mock type for the TransactionOption type
func NewMockTransactionOption ¶
func NewMockTransactionOption(t interface {
mock.TestingT
Cleanup(func())
}) *MockTransactionOption
NewMockTransactionOption creates a new instance of MockTransactionOption. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockTransactionOption) ApplyTransaction ¶
func (_m *MockTransactionOption) ApplyTransaction(_a0 Transaction)
ApplyTransaction provides a mock function with given fields: _a0
func (*MockTransactionOption) EXPECT ¶
func (_m *MockTransactionOption) EXPECT() *MockTransactionOption_Expecter
type MockTransactionOption_ApplyTransaction_Call ¶
MockTransactionOption_ApplyTransaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ApplyTransaction'
func (*MockTransactionOption_ApplyTransaction_Call) Return ¶
func (_c *MockTransactionOption_ApplyTransaction_Call) Return() *MockTransactionOption_ApplyTransaction_Call
func (*MockTransactionOption_ApplyTransaction_Call) Run ¶
func (_c *MockTransactionOption_ApplyTransaction_Call) Run(run func(_a0 Transaction)) *MockTransactionOption_ApplyTransaction_Call
func (*MockTransactionOption_ApplyTransaction_Call) RunAndReturn ¶
func (_c *MockTransactionOption_ApplyTransaction_Call) RunAndReturn(run func(Transaction)) *MockTransactionOption_ApplyTransaction_Call
type MockTransactionOption_Expecter ¶
type MockTransactionOption_Expecter struct {
// contains filtered or unexported fields
}
func (*MockTransactionOption_Expecter) ApplyTransaction ¶
func (_e *MockTransactionOption_Expecter) ApplyTransaction(_a0 interface{}) *MockTransactionOption_ApplyTransaction_Call
ApplyTransaction is a helper method to define mock.On call
- _a0 Transaction
type MockTransaction_Context_Call ¶
MockTransaction_Context_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Context'
func (*MockTransaction_Context_Call) Return ¶
func (_c *MockTransaction_Context_Call) Return(_a0 context.Context) *MockTransaction_Context_Call
func (*MockTransaction_Context_Call) Run ¶
func (_c *MockTransaction_Context_Call) Run(run func()) *MockTransaction_Context_Call
func (*MockTransaction_Context_Call) RunAndReturn ¶
func (_c *MockTransaction_Context_Call) RunAndReturn(run func() context.Context) *MockTransaction_Context_Call
type MockTransaction_Expecter ¶
type MockTransaction_Expecter struct {
// contains filtered or unexported fields
}
func (*MockTransaction_Expecter) Context ¶
func (_e *MockTransaction_Expecter) Context() *MockTransaction_Context_Call
Context is a helper method to define mock.On call
func (*MockTransaction_Expecter) Finish ¶
func (_e *MockTransaction_Expecter) Finish(status interface{}) *MockTransaction_Finish_Call
Finish is a helper method to define mock.On call
- status TransactionStatus
func (*MockTransaction_Expecter) SetData ¶
func (_e *MockTransaction_Expecter) SetData(key interface{}, value interface{}) *MockTransaction_SetData_Call
SetData is a helper method to define mock.On call
- key string
- value interface{}
func (*MockTransaction_Expecter) SetName ¶
func (_e *MockTransaction_Expecter) SetName(name interface{}) *MockTransaction_SetName_Call
SetName is a helper method to define mock.On call
- name string
func (*MockTransaction_Expecter) SetTag ¶
func (_e *MockTransaction_Expecter) SetTag(key interface{}, value interface{}) *MockTransaction_SetTag_Call
SetTag is a helper method to define mock.On call
- key string
- value string
func (*MockTransaction_Expecter) StartChild ¶
func (_e *MockTransaction_Expecter) StartChild(operation interface{}, opts ...interface{}) *MockTransaction_StartChild_Call
StartChild is a helper method to define mock.On call
- operation string
- opts ...SpanOption
type MockTransaction_Finish_Call ¶
MockTransaction_Finish_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Finish'
func (*MockTransaction_Finish_Call) Return ¶
func (_c *MockTransaction_Finish_Call) Return() *MockTransaction_Finish_Call
func (*MockTransaction_Finish_Call) Run ¶
func (_c *MockTransaction_Finish_Call) Run(run func(status TransactionStatus)) *MockTransaction_Finish_Call
func (*MockTransaction_Finish_Call) RunAndReturn ¶
func (_c *MockTransaction_Finish_Call) RunAndReturn(run func(TransactionStatus)) *MockTransaction_Finish_Call
type MockTransaction_SetData_Call ¶
MockTransaction_SetData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetData'
func (*MockTransaction_SetData_Call) Return ¶
func (_c *MockTransaction_SetData_Call) Return() *MockTransaction_SetData_Call
func (*MockTransaction_SetData_Call) Run ¶
func (_c *MockTransaction_SetData_Call) Run(run func(key string, value interface{})) *MockTransaction_SetData_Call
func (*MockTransaction_SetData_Call) RunAndReturn ¶
func (_c *MockTransaction_SetData_Call) RunAndReturn(run func(string, interface{})) *MockTransaction_SetData_Call
type MockTransaction_SetName_Call ¶
MockTransaction_SetName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetName'
func (*MockTransaction_SetName_Call) Return ¶
func (_c *MockTransaction_SetName_Call) Return() *MockTransaction_SetName_Call
func (*MockTransaction_SetName_Call) Run ¶
func (_c *MockTransaction_SetName_Call) Run(run func(name string)) *MockTransaction_SetName_Call
func (*MockTransaction_SetName_Call) RunAndReturn ¶
func (_c *MockTransaction_SetName_Call) RunAndReturn(run func(string)) *MockTransaction_SetName_Call
type MockTransaction_SetTag_Call ¶
MockTransaction_SetTag_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetTag'
func (*MockTransaction_SetTag_Call) Return ¶
func (_c *MockTransaction_SetTag_Call) Return() *MockTransaction_SetTag_Call
func (*MockTransaction_SetTag_Call) Run ¶
func (_c *MockTransaction_SetTag_Call) Run(run func(key string, value string)) *MockTransaction_SetTag_Call
func (*MockTransaction_SetTag_Call) RunAndReturn ¶
func (_c *MockTransaction_SetTag_Call) RunAndReturn(run func(string, string)) *MockTransaction_SetTag_Call
type MockTransaction_StartChild_Call ¶
MockTransaction_StartChild_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StartChild'
func (*MockTransaction_StartChild_Call) Return ¶
func (_c *MockTransaction_StartChild_Call) Return(_a0 Span) *MockTransaction_StartChild_Call
func (*MockTransaction_StartChild_Call) Run ¶
func (_c *MockTransaction_StartChild_Call) Run(run func(operation string, opts ...SpanOption)) *MockTransaction_StartChild_Call
func (*MockTransaction_StartChild_Call) RunAndReturn ¶
func (_c *MockTransaction_StartChild_Call) RunAndReturn(run func(string, ...SpanOption) Span) *MockTransaction_StartChild_Call
type MockeventOptionFunc ¶
MockeventOptionFunc is an autogenerated mock type for the eventOptionFunc type
func NewMockeventOptionFunc ¶
func NewMockeventOptionFunc(t interface {
mock.TestingT
Cleanup(func())
}) *MockeventOptionFunc
NewMockeventOptionFunc creates a new instance of MockeventOptionFunc. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockeventOptionFunc) EXPECT ¶
func (_m *MockeventOptionFunc) EXPECT() *MockeventOptionFunc_Expecter
func (*MockeventOptionFunc) Execute ¶
func (_m *MockeventOptionFunc) Execute(_a0 Event)
Execute provides a mock function with given fields: _a0
type MockeventOptionFunc_Execute_Call ¶
MockeventOptionFunc_Execute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Execute'
func (*MockeventOptionFunc_Execute_Call) Return ¶
func (_c *MockeventOptionFunc_Execute_Call) Return() *MockeventOptionFunc_Execute_Call
func (*MockeventOptionFunc_Execute_Call) Run ¶
func (_c *MockeventOptionFunc_Execute_Call) Run(run func(_a0 Event)) *MockeventOptionFunc_Execute_Call
func (*MockeventOptionFunc_Execute_Call) RunAndReturn ¶
func (_c *MockeventOptionFunc_Execute_Call) RunAndReturn(run func(Event)) *MockeventOptionFunc_Execute_Call
type MockeventOptionFunc_Expecter ¶
type MockeventOptionFunc_Expecter struct {
// contains filtered or unexported fields
}
func (*MockeventOptionFunc_Expecter) Execute ¶
func (_e *MockeventOptionFunc_Expecter) Execute(_a0 interface{}) *MockeventOptionFunc_Execute_Call
Execute is a helper method to define mock.On call
- _a0 Event
type MockspanOptionFunc ¶
MockspanOptionFunc is an autogenerated mock type for the spanOptionFunc type
func NewMockspanOptionFunc ¶
func NewMockspanOptionFunc(t interface {
mock.TestingT
Cleanup(func())
}) *MockspanOptionFunc
NewMockspanOptionFunc creates a new instance of MockspanOptionFunc. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockspanOptionFunc) EXPECT ¶
func (_m *MockspanOptionFunc) EXPECT() *MockspanOptionFunc_Expecter
func (*MockspanOptionFunc) Execute ¶
func (_m *MockspanOptionFunc) Execute(_a0 Span)
Execute provides a mock function with given fields: _a0
type MockspanOptionFunc_Execute_Call ¶
MockspanOptionFunc_Execute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Execute'
func (*MockspanOptionFunc_Execute_Call) Return ¶
func (_c *MockspanOptionFunc_Execute_Call) Return() *MockspanOptionFunc_Execute_Call
func (*MockspanOptionFunc_Execute_Call) Run ¶
func (_c *MockspanOptionFunc_Execute_Call) Run(run func(_a0 Span)) *MockspanOptionFunc_Execute_Call
func (*MockspanOptionFunc_Execute_Call) RunAndReturn ¶
func (_c *MockspanOptionFunc_Execute_Call) RunAndReturn(run func(Span)) *MockspanOptionFunc_Execute_Call
type MockspanOptionFunc_Expecter ¶
type MockspanOptionFunc_Expecter struct {
// contains filtered or unexported fields
}
func (*MockspanOptionFunc_Expecter) Execute ¶
func (_e *MockspanOptionFunc_Expecter) Execute(_a0 interface{}) *MockspanOptionFunc_Execute_Call
Execute is a helper method to define mock.On call
- _a0 Span
type MocktransactionOptionFunc ¶
MocktransactionOptionFunc is an autogenerated mock type for the transactionOptionFunc type
func NewMocktransactionOptionFunc ¶
func NewMocktransactionOptionFunc(t interface {
mock.TestingT
Cleanup(func())
}) *MocktransactionOptionFunc
NewMocktransactionOptionFunc creates a new instance of MocktransactionOptionFunc. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MocktransactionOptionFunc) EXPECT ¶
func (_m *MocktransactionOptionFunc) EXPECT() *MocktransactionOptionFunc_Expecter
func (*MocktransactionOptionFunc) Execute ¶
func (_m *MocktransactionOptionFunc) Execute(_a0 Transaction)
Execute provides a mock function with given fields: _a0
type MocktransactionOptionFunc_Execute_Call ¶
MocktransactionOptionFunc_Execute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Execute'
func (*MocktransactionOptionFunc_Execute_Call) Return ¶
func (_c *MocktransactionOptionFunc_Execute_Call) Return() *MocktransactionOptionFunc_Execute_Call
func (*MocktransactionOptionFunc_Execute_Call) Run ¶
func (_c *MocktransactionOptionFunc_Execute_Call) Run(run func(_a0 Transaction)) *MocktransactionOptionFunc_Execute_Call
func (*MocktransactionOptionFunc_Execute_Call) RunAndReturn ¶
func (_c *MocktransactionOptionFunc_Execute_Call) RunAndReturn(run func(Transaction)) *MocktransactionOptionFunc_Execute_Call
type MocktransactionOptionFunc_Expecter ¶
type MocktransactionOptionFunc_Expecter struct {
// contains filtered or unexported fields
}
func (*MocktransactionOptionFunc_Expecter) Execute ¶
func (_e *MocktransactionOptionFunc_Expecter) Execute(_a0 interface{}) *MocktransactionOptionFunc_Execute_Call
Execute is a helper method to define mock.On call
- _a0 Transaction
type Observer ¶
type Observer interface {
// Tracing operations
StartTransaction(ctx context.Context, name string, opts ...TransactionOption) Transaction
StartSpan(ctx context.Context, operation string, opts ...SpanOption) (context.Context, Span)
CaptureException(ctx context.Context, err error, opts ...EventOption)
CaptureMessage(ctx context.Context, message string, level Level, opts ...EventOption)
// Metrics operations
GetMetrics() MetricsProvider
// Configuration and lifecycle
GetConfig() Config
ForceFlush(ctx context.Context) error
Close() error
}
Observer defines the main interface for observability operations
func NewNoopObserver ¶
func NewNoopObserver() Observer
NewNoopObserver creates a new no-op observer that does nothing
type OpenTelemetryMetricsConfig ¶
type OpenTelemetryMetricsConfig struct {
Endpoint string `yaml:"endpoint" mapstructure:"endpoint"`
Insecure bool `yaml:"insecure" mapstructure:"insecure"`
ServiceName string `yaml:"service_name" mapstructure:"service_name"`
ServiceVersion string `yaml:"service_version" mapstructure:"service_version"`
Environment string `yaml:"environment" mapstructure:"environment"`
Hostname string `yaml:"hostname" mapstructure:"hostname"`
Headers map[string]string `yaml:"headers" mapstructure:"headers"`
Protocol string `yaml:"protocol" mapstructure:"protocol"` // "grpc" (default) or "http"
// Export configuration
ExportMode string `yaml:"export_mode" mapstructure:"export_mode"` // "push" or "endpoint"
PushInterval time.Duration `yaml:"push_interval" mapstructure:"push_interval"` // For push mode
BatchTimeout time.Duration `yaml:"batch_timeout" mapstructure:"batch_timeout"` // Batch timeout
ExportTimeout time.Duration `yaml:"export_timeout" mapstructure:"export_timeout"` // Export timeout
}
OpenTelemetryMetricsConfig holds OpenTelemetry-specific metrics configuration
func DefaultOpenTelemetryMetricsConfig ¶
func DefaultOpenTelemetryMetricsConfig() OpenTelemetryMetricsConfig
DefaultOpenTelemetryMetricsConfig returns default OpenTelemetry metrics configuration
func (OpenTelemetryMetricsConfig) Validate ¶
func (c OpenTelemetryMetricsConfig) Validate() error
Validate validates the OpenTelemetry metrics configuration
type PropagationConfig ¶ added in v0.26.0
type PropagationConfig struct {
Formats []string `yaml:"formats" mapstructure:"formats"` // ["w3c", "b3", "b3-single", "jaeger"]
}
PropagationConfig controls trace propagation formats
type Span ¶
type Span interface {
SetTag(key, value string)
SetData(key string, value interface{})
SetError(err error, opts ...trace.EventOption)
Finish()
}
Span represents a unit of work or operation within a transaction
type SpanBuilder ¶
type SpanBuilder struct {
// contains filtered or unexported fields
}
SpanBuilder helps build spans with common patterns
func NewSpanBuilder ¶
func NewSpanBuilder(observer Observer, operation string) *SpanBuilder
NewSpanBuilder creates a new span builder
func (*SpanBuilder) WithComponent ¶
func (sb *SpanBuilder) WithComponent(component string) *SpanBuilder
WithComponent adds a component tag to the span
func (*SpanBuilder) WithLayer ¶
func (sb *SpanBuilder) WithLayer(layer string) *SpanBuilder
WithLayer adds a layer tag to the span
func (*SpanBuilder) WithOperation ¶
func (sb *SpanBuilder) WithOperation(operation string) *SpanBuilder
WithOperation adds an operation tag to the span
func (*SpanBuilder) WithService ¶
func (sb *SpanBuilder) WithService(service string) *SpanBuilder
WithService adds a service tag to the span
func (*SpanBuilder) WithTag ¶
func (sb *SpanBuilder) WithTag(key, value string) *SpanBuilder
WithTag adds a custom tag to the span
type SpanOption ¶
type SpanOption interface {
ApplySpan(Span)
}
SpanOption configures a span
func WithSpanData ¶
func WithSpanData(key string, value interface{}) SpanOption
WithSpanData adds data to the span
func WithSpanError ¶
func WithSpanError(err error) SpanOption
WithSpanError marks the span as failed with an error
func WithSpanTag ¶
func WithSpanTag(key, value string) SpanOption
WithSpanTag adds a tag to the span
type Transaction ¶
type Transaction interface {
Context() context.Context
SetName(name string)
SetTag(key, value string)
SetData(key string, value interface{})
StartChild(operation string, opts ...SpanOption) Span
Finish(status TransactionStatus)
}
Transaction represents a logical operation that can contain multiple spans
type TransactionOption ¶
type TransactionOption interface {
ApplyTransaction(Transaction)
}
TransactionOption configures a transaction
func WithTransactionData ¶
func WithTransactionData(key string, value interface{}) TransactionOption
WithTransactionData adds data to the transaction
func WithTransactionTag ¶
func WithTransactionTag(key, value string) TransactionOption
WithTransactionTag adds a tag to the transaction
type TransactionStatus ¶
type TransactionStatus string
TransactionStatus represents the final status of a transaction
const ( // TransactionOK indicates a successful transaction TransactionOK TransactionStatus = "ok" // TransactionError indicates a failed transaction TransactionError TransactionStatus = "error" // TransactionCancelled indicates a cancelled transaction TransactionCancelled TransactionStatus = "cancelled" )
Source Files
¶
- config.go
- constants.go
- event.go
- event_mock.go
- event_option_func_mock.go
- event_option_mock.go
- helpers.go
- hostname.go
- metrics.go
- metrics_config.go
- metrics_factory.go
- metrics_noop.go
- metrics_opentelemetry.go
- metrics_provider_mock.go
- noop.go
- observer.go
- observer_mock.go
- span.go
- span_mock.go
- span_option_func_mock.go
- span_option_mock.go
- transaction.go
- transaction_mock.go
- transaction_option_func_mock.go
- transaction_option_mock.go