Documentation
¶
Index ¶
- Constants
- func SetUseFreshConfig(use bool)
- type Config
- func (c *Config) CIVisibilityEnabled() bool
- func (c *Config) DataStreamsMonitoringEnabled() bool
- func (c *Config) Debug() bool
- func (c *Config) DebugAbandonedSpans() bool
- func (c *Config) DebugStack() bool
- func (c *Config) Env() string
- func (c *Config) FeatureFlags() map[string]struct{}
- func (c *Config) GlobalSampleRate() float64
- func (c *Config) HasFeature(feat string) bool
- func (c *Config) Hostname() string
- func (c *Config) HostnameLookupError() error
- func (c *Config) IsLambdaFunction() bool
- func (c *Config) LogDirectory() string
- func (c *Config) LogStartup() bool
- func (c *Config) LogToStdout() bool
- func (c *Config) PartialFlushEnabled() (enabled bool, minSpans int)
- func (c *Config) ProfilerEndpoints() bool
- func (c *Config) ProfilerHotspotsEnabled() bool
- func (c *Config) ReportHostname() bool
- func (c *Config) RetryInterval() time.Duration
- func (c *Config) RuntimeMetricsEnabled() bool
- func (c *Config) RuntimeMetricsV2Enabled() bool
- func (c *Config) ServiceMapping(from string) (to string, ok bool)
- func (c *Config) ServiceMappings() map[string]string
- func (c *Config) ServiceName() string
- func (c *Config) SetCIVisibilityEnabled(enabled bool, origin telemetry.Origin)
- func (c *Config) SetDataStreamsMonitoringEnabled(enabled bool, origin telemetry.Origin)
- func (c *Config) SetDebug(enabled bool, origin telemetry.Origin)
- func (c *Config) SetDebugAbandonedSpans(enabled bool, origin telemetry.Origin)
- func (c *Config) SetDebugStack(enabled bool, origin telemetry.Origin)
- func (c *Config) SetEnv(env string, origin telemetry.Origin)
- func (c *Config) SetFeatureFlags(features []string, origin telemetry.Origin)
- func (c *Config) SetGlobalSampleRate(rate float64, origin telemetry.Origin)
- func (c *Config) SetHostname(hostname string, origin telemetry.Origin)
- func (c *Config) SetIsLambdaFunction(enabled bool, origin telemetry.Origin)
- func (c *Config) SetLogDirectory(directory string, origin telemetry.Origin)
- func (c *Config) SetLogStartup(enabled bool, origin telemetry.Origin)
- func (c *Config) SetLogToStdout(enabled bool, origin telemetry.Origin)
- func (c *Config) SetPartialFlushEnabled(enabled bool, origin telemetry.Origin)
- func (c *Config) SetPartialFlushMinSpans(minSpans int, origin telemetry.Origin)
- func (c *Config) SetProfilerEndpoints(enabled bool, origin telemetry.Origin)
- func (c *Config) SetProfilerHotspotsEnabled(enabled bool, origin telemetry.Origin)
- func (c *Config) SetRetryInterval(interval time.Duration, origin telemetry.Origin)
- func (c *Config) SetRuntimeMetricsEnabled(enabled bool, origin telemetry.Origin)
- func (c *Config) SetRuntimeMetricsV2Enabled(enabled bool, origin telemetry.Origin)
- func (c *Config) SetServiceMapping(from, to string, origin telemetry.Origin)
- func (c *Config) SetServiceName(name string, origin telemetry.Origin)
- func (c *Config) SetSpanTimeout(timeout time.Duration, origin telemetry.Origin)
- func (c *Config) SetStatsComputationEnabled(enabled bool, origin telemetry.Origin)
- func (c *Config) SetTraceRateLimitPerSecond(rate float64, origin telemetry.Origin)
- func (c *Config) SetVersion(version string, origin telemetry.Origin)
- func (c *Config) SpanTimeout() time.Duration
- func (c *Config) StatsComputationEnabled() bool
- func (c *Config) TraceRateLimitPerSecond() float64
- func (c *Config) Version() string
- type Origin
Constants ¶
const ( OriginCode = telemetry.OriginCode OriginCalculated = telemetry.OriginCalculated )
Re-exported origin constants for common configuration sources
const ( // DefaultRateLimit specifies the default rate limit per second for traces. // TODO: Maybe delete this. We will have defaults in supported_configuration.json anyway. DefaultRateLimit = 100.0 // traceMaxSize is the maximum number of spans we keep in memory for a // single trace. This is to avoid memory leaks. If more spans than this // are added to a trace, then the trace is dropped and the spans are // discarded. Adding additional spans after a trace is dropped does // nothing. TraceMaxSize = int(1e5) )
Variables ¶
This section is empty.
Functions ¶
func SetUseFreshConfig ¶
func SetUseFreshConfig(use bool)
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config represents global configuration properties. Config instances should be obtained via Get() which always returns a non-nil value. Methods on Config assume a non-nil receiver and will panic if called on nil.
func CreateNew ¶ added in v2.6.0
func CreateNew() *Config
CreateNew returns a new global configuration instance. This function should be used when we need to create a new configuration instance. It build a new configuration instance and override the existing one loosing any programmatic configuration that would have been applied to the existing instance.
It shouldn't be used to get the global configuration instance to manipulate it but should be used when there is a need to reset the global configuration instance.
This is useful when we need to create a new configuration instance when a new product is initialized. Each product should have its own configuration instance and apply its own programmatic configuration to it.
If a customer starts multiple tracer with different programmatic configuration only the latest one will be used and available globally.
func Get ¶
func Get() *Config
Get returns the global configuration singleton. This function is thread-safe and can be called from multiple goroutines concurrently. The configuration is lazily initialized on first access using sync.Once, ensuring loadConfig() is called exactly once even under concurrent access.
func (*Config) CIVisibilityEnabled ¶ added in v2.6.0
func (*Config) DataStreamsMonitoringEnabled ¶ added in v2.6.0
func (*Config) DebugAbandonedSpans ¶ added in v2.6.0
func (*Config) DebugStack ¶ added in v2.6.0
func (*Config) FeatureFlags ¶ added in v2.6.0
func (*Config) GlobalSampleRate ¶ added in v2.6.0
func (*Config) HasFeature ¶ added in v2.6.0
HasFeature performs a single feature flag lookup without copying the underlying map. This is better than FeatureFlags() for hot paths (e.g., span creation) to avoid per-call allocations.
func (*Config) HostnameLookupError ¶ added in v2.6.0
func (*Config) IsLambdaFunction ¶ added in v2.6.0
func (*Config) LogDirectory ¶ added in v2.6.0
func (*Config) LogStartup ¶ added in v2.6.0
func (*Config) LogToStdout ¶ added in v2.6.0
func (*Config) PartialFlushEnabled ¶ added in v2.6.0
PartialFlushEnabled returns the partial flushing configuration under a single read lock.
func (*Config) ProfilerEndpoints ¶ added in v2.6.0
func (*Config) ProfilerHotspotsEnabled ¶ added in v2.6.0
func (*Config) ReportHostname ¶ added in v2.6.0
func (*Config) RetryInterval ¶ added in v2.6.0
func (*Config) RuntimeMetricsEnabled ¶ added in v2.6.0
func (*Config) RuntimeMetricsV2Enabled ¶ added in v2.6.0
func (*Config) ServiceMapping ¶ added in v2.6.0
ServiceMapping performs a single mapping lookup without copying the underlying map. This is better than ServiceMappings() for hot paths (e.g., span creation) to avoid per-call allocations.
func (*Config) ServiceMappings ¶ added in v2.6.0
ServiceMappings returns a copy of the service mappings map. If no service mappings are set, returns nil.