Documentation
¶
Index ¶
- Constants
- func LimitQueryText(queryText string) string
- func NewResourceLogsConsumer(next consumer.Logs, databaseSystem string, serviceName string, ...) consumer.Logs
- func NewResourceMetricsConsumer(next consumer.Metrics, databaseSystem string, serviceName string, ...) consumer.Metrics
- func SQLSignature(normalizedQuery string) string
- func SetDatabaseResourceAttributes(attributes pcommon.Map, databaseSystem string, serviceName string, ...)
- func ValidateCandidateLimit(limit, candidateLimit, maximum int) error
- type Config
- type ExplainPlansConfig
- type Snapshot
- type SnapshotStore
Constants ¶
View Source
const ( DefaultLimit = 250 MaxQueryTextBytes = 4 << 10 // 4 KiB )
View Source
const ( ServiceNameAttribute = "service.name" DatabaseSystemAttribute = "db.system" CollectorVersionAttribute = "querycomment.collector.version" )
Variables ¶
This section is empty.
Functions ¶
func LimitQueryText ¶ added in v0.1.3
func NewResourceLogsConsumer ¶ added in v0.1.3
func NewResourceLogsConsumer( next consumer.Logs, databaseSystem string, serviceName string, settings receiver.Settings, ) consumer.Logs
NewResourceLogsConsumer wraps a logs consumer and stamps the common database resource attributes on every ResourceLogs item it receives.
func NewResourceMetricsConsumer ¶ added in v0.1.3
func NewResourceMetricsConsumer( next consumer.Metrics, databaseSystem string, serviceName string, settings receiver.Settings, ) consumer.Metrics
NewResourceMetricsConsumer wraps a metrics consumer and stamps the common database resource attributes on every ResourceMetrics item it receives.
func SQLSignature ¶
SQLSignature returns a stable 128-bit identifier for normalized SQL text.
func SetDatabaseResourceAttributes ¶ added in v0.1.3
func SetDatabaseResourceAttributes(attributes pcommon.Map, databaseSystem string, serviceName string, settings receiver.Settings)
SetDatabaseResourceAttributes sets the common database resource attributes used by QueryComment metrics and logs.
func ValidateCandidateLimit ¶ added in v0.1.3
ValidateCandidateLimit checks the common top-N candidate-pool bounds.
Types ¶
type Config ¶
type Config struct {
Enabled bool `mapstructure:"enabled"`
Limit int `mapstructure:"limit"`
ExplainPlans ExplainPlansConfig `mapstructure:"explain_plans"`
}
func DefaultConfig ¶
func DefaultConfig() Config
type ExplainPlansConfig ¶ added in v0.1.3
type ExplainPlansConfig struct {
Enabled bool `mapstructure:"enabled"`
MaxPerInterval int `mapstructure:"max_per_interval"`
CacheSize int `mapstructure:"cache_size"`
CacheTTL time.Duration `mapstructure:"cache_ttl"`
FailureCacheTTL time.Duration `mapstructure:"failure_cache_ttl"`
QueryTimeout time.Duration `mapstructure:"query_timeout"`
CollectionTimeout time.Duration `mapstructure:"collection_timeout"`
CollectionInterval time.Duration `mapstructure:"collection_interval"`
MaxPlanBytes int `mapstructure:"max_plan_bytes"`
}
func (ExplainPlansConfig) Validate ¶ added in v0.1.3
func (c ExplainPlansConfig) Validate() error
type SnapshotStore ¶ added in v0.1.3
type SnapshotStore[T any] struct { // contains filtered or unexported fields }
func NewSnapshotStore ¶ added in v0.1.3
func NewSnapshotStore[T any]() *SnapshotStore[T]
func (*SnapshotStore[T]) Load ¶ added in v0.1.3
func (s *SnapshotStore[T]) Load() Snapshot[T]
func (*SnapshotStore[T]) Publish ¶ added in v0.1.3
func (s *SnapshotStore[T]) Publish(rows []T, collectedAt time.Time)
Click to show internal directories.
Click to hide internal directories.