common

package
v1.11.9 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MultilineCollectorTimeout = time.Second
	LogPatternsPerLevel       = 256
	LogSourceAttribute        = "log.source"
)

Variables

View Source
var DefaultExcludeDatabases = []string{"rdsadmin", "cloudsqladmin", "mysql", "information_schema", "performance_schema", "sys", "mysql_innodb_cluster_metadata", "mysql_innodb_cluster_metadata_previous"}

Functions

func AuthHeaders

func AuthHeaders(apiKey string) map[string]string

func Counter

func Counter(desc *prometheus.Desc, value float64, labels ...string) prometheus.Metric

func DatabaseTLSConfig added in v1.9.0

func DatabaseTLSConfig(creds TLSCredentials, insecureSkipVerify bool) (*tls.Config, error)

func Desc

func Desc(name, help string, labels ...string) *prometheus.Desc

func Gauge

func Gauge(desc *prometheus.Desc, value float64, labels ...string) prometheus.Metric

func LabelsMatched added in v1.11.3

func LabelsMatched(filters, labels map[string]string) bool

func LogSeverity added in v1.11.8

func LogSeverity(level logparser.Level) log.Severity

LogSeverity maps a logparser level to the OpenTelemetry log severity.

func SetAuthHeaders

func SetAuthHeaders(r *http.Request, apiKey string)

func SplitHostPort added in v1.3.0

func SplitHostPort(addr string) (host string, port int, err error)

func TlsConfig added in v1.6.4

func TlsConfig(insecureSkipVerify bool, caFile string) *tls.Config

func TopN added in v1.9.0

func TopN[T any](s []T, n int, less func(a, b T) bool) []T

func TopNMap added in v1.9.0

func TopNMap[K comparable, V any, S cmp.Ordered](m map[K]V, n int, val func(V) S) map[K]V

func TopNMapByValue added in v1.9.0

func TopNMapByValue[K comparable, V cmp.Ordered](m map[K]V, n int) map[K]V

Types

type Endpoint added in v1.11.2

type Endpoint struct {
	Host string
	Port string
}

type LogEmitter added in v1.11.2

type LogEmitter struct {
	// contains filtered or unexported fields
}

func (*LogEmitter) Callback added in v1.11.2

func (e *LogEmitter) Callback() logparser.OnMsgCallbackF

func (*LogEmitter) Stop added in v1.11.2

func (e *LogEmitter) Stop()

type LogsPipeline added in v1.11.8

type LogsPipeline struct {
	// contains filtered or unexported fields
}

func NewLogsPipeline added in v1.11.8

func NewLogsPipeline(endpoint *url.URL, headers map[string]string, tlsConfig *tls.Config) (*LogsPipeline, error)

func (*LogsPipeline) NewLogEmitter added in v1.11.8

func (p *LogsPipeline) NewLogEmitter(serviceName, hostName, source string) (*LogEmitter, error)

func (*LogsPipeline) NewLoggerProvider added in v1.11.8

func (p *LogsPipeline) NewLoggerProvider(serviceName string, resourceAttrs ...attribute.KeyValue) (*sdk.LoggerProvider, error)

func (*LogsPipeline) Shutdown added in v1.11.8

func (p *LogsPipeline) Shutdown(ctx context.Context) error

type TLSCredentials added in v1.9.0

type TLSCredentials struct {
	CA, Cert, Key string
}

Jump to

Keyboard shortcuts

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