Documentation
¶
Index ¶
- Constants
- Variables
- func ForAllClusters(namespace, svc model.LabelValue, cb func(model.LabelSet, push.LabelsAdapter))
- func RandDuration() string
- func RandError() string
- func RandFileName() string
- func RandLevel() model.LabelValue
- func RandOrgID() string
- func RandSeq(n int) string
- func RandStructuredMetadata(svc string, index int) push.LabelsAdapter
- func RandTraceID(prevTrace string) string
- func RandURI() string
- func RandUserID() string
- type AppLogger
- type Logger
- type LoggerFunc
- type OtelLogger
- type SyslogLogger
Constants ¶
View Source
const ( INFO = model.LabelValue("info") ERROR = model.LabelValue("error") WARN = model.LabelValue("warn") DEBUG = model.LabelValue("debug") )
Variables ¶
View Source
var Clusters = []string{
"us-west-1",
"us-east-1",
"us-east-2",
"eu-west-1",
}
View Source
var OrgIDs = []string{"1218", "29", "1010", "2419", "2919"}
View Source
var URI = []string{
"/api/loki/v1/query",
"/api/loki/v1/push",
"/api/loki/v1/patterns",
"/api/loki/v1/label",
"/api/loki/v1/label/values",
"/api/loki/v1/label/names",
"/api/loki/v1/label/series",
"/api/mimir/v1/query",
"/api/mimir/v1/push",
"/api/mimir/v1/label",
"/api/mimir/v1/label/values",
"/api/pyroscope/v1/query",
"/api/pyroscope/v1/push",
}
View Source
var UserIDs = []string{"14234", "03428", "10572", "94223", "08203", "93820", "12345", "54321", "67890"}
Functions ¶
func ForAllClusters ¶
func ForAllClusters(namespace, svc model.LabelValue, cb func(model.LabelSet, push.LabelsAdapter))
func RandDuration ¶
func RandDuration() string
func RandFileName ¶
func RandFileName() string
func RandLevel ¶
func RandLevel() model.LabelValue
func RandStructuredMetadata ¶
func RandStructuredMetadata(svc string, index int) push.LabelsAdapter
func RandTraceID ¶
func RandUserID ¶
func RandUserID() string
Types ¶
type AppLogger ¶
type AppLogger struct {
// contains filtered or unexported fields
}
func (*AppLogger) LogWithMetadata ¶
func (app *AppLogger) LogWithMetadata(level model.LabelValue, t time.Time, message string, metadata push.LabelsAdapter)
type LoggerFunc ¶
type LoggerFunc func(labels model.LabelSet, timestamp time.Time, message string, metadata push.LabelsAdapter) error
func (LoggerFunc) HandleWithMetadata ¶
func (f LoggerFunc) HandleWithMetadata(labels model.LabelSet, timestamp time.Time, message string, metadata push.LabelsAdapter) error
type OtelLogger ¶
type OtelLogger struct {
// contains filtered or unexported fields
}
OtelLogger implements the Logger interface and provides OpenTelemetry context awareness
func NewOtelLogger ¶
func NewOtelLogger(svcName string, labels model.LabelSet) *OtelLogger
NewOtelLogger creates a new OpenTelemetry-aware logger
func (*OtelLogger) HandleWithMetadata ¶
func (o *OtelLogger) HandleWithMetadata(labels model.LabelSet, timestamp time.Time, message string, metadata push.LabelsAdapter) error
HandleWithMetadata implements the Logger interface with OpenTelemetry context
type SyslogLogger ¶
type SyslogLogger struct {
// contains filtered or unexported fields
}
SyslogLogger implements the Logger interface and handles logging to syslog
func NewSyslogLogger ¶
func NewSyslogLogger(conn net.Conn, facility syslog.Priority) *SyslogLogger
NewSyslogLogger creates a new logger that writes to syslog
func (*SyslogLogger) HandleWithMetadata ¶
func (s *SyslogLogger) HandleWithMetadata(labels model.LabelSet, timestamp time.Time, message string, metadata push.LabelsAdapter) error
HandleWithMetadata implements the Logger interface
Click to show internal directories.
Click to hide internal directories.