Documentation
¶
Index ¶
- Variables
- func GetLogsExporter(name string, e *Exporters) (types.Sink, error)
- func GetMetricsExporter(name string, e *Exporters) (remote.RemoteWriteClient, error)
- func HasLogsExporter(name string, e *Exporters) bool
- func HasMetricsExporter(name string, e *Exporters) bool
- func MergeAddMetadataLabels(configs ...*AddMetadataLabels) *metadata.DynamicLabelerConfig
- func NewTransformer(defaultDropMetrics *bool, addLabels map[string]string, ...) (*transform.RequestTransformer, error)
- type AddMetadataKubernetesNode
- type AddMetadataLabels
- type Config
- type Exporters
- type FluentForwardLogExport
- type HostLog
- type JournalTarget
- type KernelTarget
- type KubeletDiscovery
- type LabelMatcher
- type LiftLabel
- type LiftResource
- type LogTransform
- type MetadataWatch
- type MetadataWatchKubernetesNode
- type OtelLog
- type OtelMetric
- type OtlpMetricExport
- type PodTarget
- type PrometheusRemoteWrite
- type PrometheusScrape
- type ScrapeTarget
- type TailTarget
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultConfig = Config{ Endpoint: "https://ingestor.adx-mon.svc.cluster.local", MaxBatchSize: 5000, WALFlushIntervalMilliSeconds: 100, ListenAddr: ":8080", StorageDir: homedir, StorageBackend: "adx", PrometheusScrape: &PrometheusScrape{ StaticScrapeTarget: []*ScrapeTarget{}, ScrapeIntervalSeconds: 30, }, PrometheusRemoteWrite: []*PrometheusRemoteWrite{ { Path: "/remote_write", AddLabels: make(map[string]string), }, }, OtelLog: &OtelLog{ AddAttributes: make(map[string]string), }, OtelMetric: []*OtelMetric{ { Path: "/v1/metrics", AddLabels: make(map[string]string), }, }, HostLog: []*HostLog{ { StaticFileTargets: []*TailTarget{}, JournalTargets: []*JournalTarget{}, AddAttributes: make(map[string]string), }, }, }
Functions ¶
func GetLogsExporter ¶ added in v0.2.0
func GetMetricsExporter ¶
func GetMetricsExporter(name string, e *Exporters) (remote.RemoteWriteClient, error)
func HasLogsExporter ¶ added in v0.2.0
func HasMetricsExporter ¶
func MergeAddMetadataLabels ¶ added in v0.2.0
func MergeAddMetadataLabels(configs ...*AddMetadataLabels) *metadata.DynamicLabelerConfig
MergeAddMetadataLabels collapses one or more AddMetadataLabels configs into a single DynamicLabelerConfig. Later configurations in the slice take precedence when keys overlap.
func NewTransformer ¶
func NewTransformer(defaultDropMetrics *bool, addLabels map[string]string, dropLabels map[string]string, dropMetrics, keepMetrics []string, keepMetricsWithLabelValue []LabelMatcher) (*transform.RequestTransformer, error)
Types ¶
type AddMetadataKubernetesNode ¶ added in v0.2.0
type AddMetadataKubernetesNode struct {
Labels map[string]string `toml:"labels,omitempty" comment:"Mapping of node label keys to destination label key names"`
Annotations map[string]string `toml:"annotations,omitempty" comment:"Mapping of node annotation keys to destination label key names"`
}
AddMetadataKubernetesNode defines a set of Kubernetes node metadata to add to metrics and logs.
type AddMetadataLabels ¶ added in v0.2.0
type AddMetadataLabels struct {
KubernetesNode *AddMetadataKubernetesNode `toml:"kubernetes-node,omitempty" comment:"Configures the node labels and annotations to add as labels"`
}
AddMetadataLabels defines the set of metadata to add to metrics and logs.
func (*AddMetadataLabels) Validate ¶ added in v0.2.0
func (a *AddMetadataLabels) Validate(config *Config) error
type Config ¶
type Config struct {
Endpoint string `toml:"endpoint,omitempty" comment:"Ingestor URL to send collected telemetry."`
Kubeconfig string `` /* 152-byte string literal not displayed */
KubeletDiscovery *KubeletDiscovery `` /* 192-byte string literal not displayed */
InsecureSkipVerify bool `toml:"insecure-skip-verify,omitempty" comment:"Skip TLS verification."`
ListenAddr string `toml:"listen-addr,omitempty" comment:"Address to listen on for endpoints."`
Region string `toml:"region,omitempty" comment:"Region is a location identifier."`
TLSKeyFile string `toml:"tls-key-file,omitempty" comment:"Optional path to the TLS key file."`
TLSCertFile string `toml:"tls-cert-file,omitempty" comment:"Optional path to the TLS cert bundle file."`
StorageBackend string `toml:"storage-backend,omitempty" comment:"Storage backend used for WAL segments. Valid values: adx, clickhouse."`
MaxConnections int `toml:"max-connections,omitempty" comment:"Maximum number of connections to accept."`
MaxBatchSize int `toml:"max-batch-size,omitempty" comment:"Maximum number of samples to send in a single batch."`
MaxSegmentAgeSeconds int `toml:"max-segment-age-seconds,omitempty" comment:"Max segment agent in seconds."`
MaxSegmentSize int64 `toml:"max-segment-size,omitempty" comment:"Maximum segment size in bytes."`
MaxDiskUsage int64 `toml:"max-disk-usage,omitempty" comment:"Maximum allowed size in bytes of all segments on disk."`
WALFlushIntervalMilliSeconds int `toml:"wal-flush-interval-ms,omitempty" comment:"Interval to flush the WAL. (default 100)"`
MaxTransferConcurrency int `toml:"max-transfer-concurrency,omitempty" comment:"Maximum number of concurrent transfers."`
StorageDir string `toml:"storage-dir,omitempty" comment:"Storage directory for the WAL and log cursors."`
EnablePprof bool `toml:"enable-pprof,omitempty" comment:"Enable pprof endpoints."`
// These are global config options that apply to all endpoints.
DefaultDropMetrics *bool `` /* 129-byte string literal not displayed */
AddLabels map[string]string `toml:"add-labels,omitempty" comment:"Global Key/value pairs of labels to add to all metrics."`
DropLabels map[string]string `` /* 193-byte string literal not displayed */
DropMetrics []string `toml:"drop-metrics,omitempty" comment:"Global Regexes of metrics to drop."`
KeepMetrics []string `toml:"keep-metrics,omitempty" comment:"Global Regexes of metrics to keep."`
KeepMetricsWithLabelValue []LabelMatcher `` /* 186-byte string literal not displayed */
LiftLabels []*LiftLabel `toml:"lift-labels,omitempty" comment:"Global labels to lift from the metric to top level columns"`
DisableMetricsForwarding bool `toml:"disable-metrics-forwarding,omitempty" comment:"Disable metrics forwarding to endpoints."`
DisableGzip bool `toml:"disable-gzip,omitempty" comment:"Disable gzip compression for transferring segments."`
// These are global config options that apply to all endpoints.
AddAttributes map[string]string `toml:"add-attributes,omitempty" comment:"Key/value pairs of attributes to add to all logs."`
LiftAttributes []string `toml:"lift-attributes,omitempty" comment:"Attributes lifted from the Body field and added to Attributes."`
LiftResources []*LiftResource `toml:"lift-resources,omitempty" comment:"Fields lifted from the Resource and added as top level columns."`
PrometheusScrape *PrometheusScrape `toml:"prometheus-scrape,omitempty" comment:"Defines a prometheus format endpoint scraper."`
PrometheusRemoteWrite []*PrometheusRemoteWrite `toml:"prometheus-remote-write,omitempty" comment:"Defines a prometheus remote write endpoint."`
OtelLog *OtelLog `toml:"otel-log,omitempty" comment:"Defines an OpenTelemetry log endpoint. Accepts OTLP/HTTP."`
OtelMetric []*OtelMetric `toml:"otel-metric,omitempty" comment:"Defines an OpenTelemetry metric endpoint. Accepts OTLP/HTTP and/or OTLP/gRPC."`
HostLog []*HostLog `toml:"host-log,omitempty" comment:"Defines a host log scraper."`
Exporters *Exporters `` /* 214-byte string literal not displayed */
MetadataWatch *MetadataWatch `toml:"metadata-watch,omitempty" comment:"Optional configuration for watching dynamic metadata to add to logs and metrics."`
AddMetadataLabels *AddMetadataLabels `` /* 139-byte string literal not displayed */
}
func (*Config) ReplaceVariable ¶
ReplaceVariable replaces all instances of the given variable with the given value.
type Exporters ¶
type Exporters struct {
OtlpMetricExport []*OtlpMetricExport `toml:"otlp-metric-export,omitempty" comment:"Configuration for exporting metrics to an OTLP/HTTP endpoint."`
FluentForwardLogExport []*FluentForwardLogExport `toml:"fluent-forward-log-export,omitempty" comment:"Configuration for exporting logs to a Fluentd/Fluent Bit endpoint."`
}
type FluentForwardLogExport ¶ added in v0.2.0
type FluentForwardLogExport struct {
Name string `toml:"name" comment:"Name of the exporter."`
Destination string `` /* 140-byte string literal not displayed */
TagAttribute string `` /* 146-byte string literal not displayed */
}
func (*FluentForwardLogExport) Validate ¶ added in v0.2.0
func (f *FluentForwardLogExport) Validate() error
type HostLog ¶
type HostLog struct {
DisableKubeDiscovery bool `` /* 145-byte string literal not displayed */
AddAttributes map[string]string `toml:"add-attributes" comment:"Key/value pairs of attributes to add to all logs."`
AddMetadataLabels *AddMetadataLabels `` /* 133-byte string literal not displayed */
StaticFileTargets []*TailTarget `toml:"file-target" comment:"Defines a tail file target."`
StaticPodTargets []*PodTarget `` /* 162-byte string literal not displayed */
JournalTargets []*JournalTarget `toml:"journal-target" comment:"Defines a journal target to scrape."`
KernelTargets []*KernelTarget `toml:"kernel-target" comment:"Defines a kernel target to scrape."`
Transforms []*LogTransform `toml:"transforms" comment:"Defines a list of transforms to apply to log lines."`
Exporters []string `toml:"exporters" comment:"List of exporter names to forward logs to."`
}
type JournalTarget ¶
type JournalTarget struct {
Matches []string `` /* 233-byte string literal not displayed */
Database string `toml:"database" comment:"Database to store logs in."`
Table string `toml:"table" comment:"Table to store logs in."`
Parsers []string `toml:"parsers" comment:"Parsers to apply sequentially to the log line."`
JournalFields []string `` /* 140-byte string literal not displayed */
}
func (*JournalTarget) Validate ¶
func (j *JournalTarget) Validate() error
type KernelTarget ¶ added in v0.2.0
type KernelTarget struct {
Database string `toml:"database" comment:"Database to store logs in."`
Table string `toml:"table" comment:"Table to store logs in."`
Priority string `toml:"priority" comment:"One of emerg, alert, crit, err, warning, notice, info, debug, default is info."`
}
func (*KernelTarget) Validate ¶ added in v0.2.0
func (k *KernelTarget) Validate() error
type KubeletDiscovery ¶ added in v0.2.0
type KubeletDiscovery struct {
Host string `toml:"host,omitempty" comment:"Kubelet host address. Defaults to node name from NODE_NAME env var, or '127.0.0.1' if not set"`
Port int `toml:"port,omitempty" comment:"Kubelet port. Defaults to 10250"`
PollInterval int `toml:"poll-interval,omitempty" comment:"How often to poll the kubelet for pod updates (seconds). Defaults to 10"`
RequestTimeout int `toml:"request-timeout,omitempty" comment:"Request timeout for kubelet API calls (seconds). Defaults to 9"`
TokenPath string `` /* 132-byte string literal not displayed */
CAPath string `` /* 144-byte string literal not displayed */
}
func (*KubeletDiscovery) Validate ¶ added in v0.2.0
func (k *KubeletDiscovery) Validate() error
type LabelMatcher ¶
type LiftResource ¶
type LogTransform ¶
type MetadataWatch ¶ added in v0.2.0
type MetadataWatch struct {
KubernetesNode *MetadataWatchKubernetesNode `` /* 144-byte string literal not displayed */
}
MetadataWatch defines a set of watchers for dynamic metadata to add to logs and metrics.
func (*MetadataWatch) Validate ¶ added in v0.2.0
func (m *MetadataWatch) Validate() error
type MetadataWatchKubernetesNode ¶ added in v0.2.0
type MetadataWatchKubernetesNode struct {
}
MetadataWatchKubernetesNode defines a metadata watcher for Kubernetes nodes.
type OtelLog ¶
type OtelLog struct {
AddAttributes map[string]string `toml:"add-attributes" comment:"Key/value pairs of attributes to add to all logs."`
AddMetadataLabels *AddMetadataLabels `` /* 132-byte string literal not displayed */
LiftAttributes []string `toml:"lift-attributes" comment:"Attributes lifted from the Body and added to Attributes."`
Transforms []*LogTransform `toml:"transforms" comment:"Defines a list of transforms to apply to log lines."`
Exporters []string `toml:"exporters" comment:"List of exporter names to forward logs to."`
}
type OtelMetric ¶
type OtelMetric struct {
Database string `toml:"database" comment:"Database to store metrics in."`
Path string `toml:"path" comment:"The path to listen on for OTLP/HTTP requests."`
GrpcPort int `toml:"grpc-port" comment:"The port to listen on for OTLP/gRPC requests."`
DisableMetricsForwarding *bool `toml:"disable-metrics-forwarding" comment:"Disable metrics forwarding to endpoints."`
DefaultDropMetrics *bool `toml:"default-drop-metrics" comment:"Default to dropping all metrics. Only metrics matching a keep rule will be kept."`
AddLabels map[string]string `toml:"add-labels" comment:"Key/value pairs of labels to add to all metrics."`
DropLabels map[string]string `` /* 177-byte string literal not displayed */
DropMetrics []string `toml:"drop-metrics" comment:"Regexes of metrics to drop."`
KeepMetrics []string `toml:"keep-metrics" comment:"Regexes of metrics to keep."`
KeepMetricsWithLabelValue []LabelMatcher `toml:"keep-metrics-with-label-value" comment:"Regexes of metrics to keep if they have the given label and value."`
AddMetadataLabels *AddMetadataLabels `` /* 135-byte string literal not displayed */
Exporters []string `toml:"exporters" comment:"List of exporter names to forward metrics to."`
}
func (*OtelMetric) Validate ¶
func (w *OtelMetric) Validate() error
type OtlpMetricExport ¶
type OtlpMetricExport struct {
Name string `toml:"name" comment:"Name of the exporter."`
Destination string `toml:"destination" comment:"OTLP/HTTP endpoint to send metrics to."`
DefaultDropMetrics *bool `toml:"default-drop-metrics" comment:"Default to dropping all metrics. Only metrics matching a keep rule will be kept."`
AddLabels map[string]string `toml:"add-labels,omitempty" comment:"Key/value pairs of labels to add to all metrics."`
DropLabels map[string]string `toml:"drop-labels" comment:"Labels to drop if they match a metrics regex in the format <metrics regex>=<label name>."`
DropMetrics []string `toml:"drop-metrics" comment:"Regexes of metrics to drop."`
KeepMetrics []string `toml:"keep-metrics" comment:"Regexes of metrics to keep."`
KeepMetricsWithLabelValue []LabelMatcher `toml:"keep-metrics-with-label-value" comment:"Regexes of metrics to keep if they have the given label and value."`
AddResourceAttributes map[string]string `toml:"add-resource-attributes" comment:"Key/value pairs of resource attributes to add to all metrics."`
}
OtlpMetricExport exports metric telemetry to OTLP/HTTP metrics endpoints.
func (*OtlpMetricExport) GetWriteClient ¶
func (o *OtlpMetricExport) GetWriteClient() (remote.RemoteWriteClient, error)
func (*OtlpMetricExport) Validate ¶
func (o *OtlpMetricExport) Validate() error
type PodTarget ¶ added in v0.2.0
type PodTarget struct {
Namespace string `toml:"namespace" comment:"The namespace of the pod to scrape."`
Name string `toml:"name" comment:"The name of the pod to scrape."`
LabelTargets map[string]string `toml:"label-targets" comment:"The labels to match on the pod. If the pod has all of these labels, it will be scraped."`
Destination string `` /* 126-byte string literal not displayed */
Parsers []string `toml:"parsers" comment:"Parsers to apply sequentially to the log line."`
}
type PrometheusRemoteWrite ¶
type PrometheusRemoteWrite struct {
Database string `toml:"database" comment:"Database to store metrics in."`
Path string `toml:"path" comment:"The path to listen on for prometheus remote write requests. Defaults to /receive."`
DisableMetricsForwarding *bool `toml:"disable-metrics-forwarding" comment:"Disable metrics forwarding to endpoints."`
DefaultDropMetrics *bool `toml:"default-drop-metrics" comment:"Default to dropping all metrics. Only metrics matching a keep rule will be kept."`
AddLabels map[string]string `toml:"add-labels" comment:"Key/value pairs of labels to add to all metrics."`
DropLabels map[string]string `toml:"drop-labels" comment:"Labels to drop if they match a metrics regex in the format <metrics regex>=<label name>."`
DropMetrics []string `toml:"drop-metrics" comment:"Regexes of metrics to drop."`
KeepMetrics []string `toml:"keep-metrics" comment:"Regexes of metrics to keep."`
KeepMetricsWithLabelValue []LabelMatcher `toml:"keep-metrics-with-label-value" comment:"Regexes of metrics to keep if they have the given label and value."`
AddMetadataLabels *AddMetadataLabels `` /* 135-byte string literal not displayed */
Exporters []string `toml:"exporters" comment:"List of exporter names to forward metrics to."`
}
func (*PrometheusRemoteWrite) Validate ¶
func (w *PrometheusRemoteWrite) Validate() error
type PrometheusScrape ¶
type PrometheusScrape struct {
Database string `toml:"database" comment:"Database to store metrics in."`
StaticScrapeTarget []*ScrapeTarget `toml:"static-scrape-target" comment:"Defines a static scrape target."`
ScrapeIntervalSeconds int `toml:"scrape-interval" comment:"Scrape interval in seconds."`
ScrapeTimeout int `toml:"scrape-timeout" comment:"Scrape timeout in seconds."`
DisableMetricsForwarding bool `toml:"disable-metrics-forwarding" comment:"Disable metrics forwarding to endpoints."`
DisableDiscovery bool `toml:"disable-discovery" comment:"Disable discovery of kubernetes pod targets."`
DefaultDropMetrics *bool `toml:"default-drop-metrics" comment:"Default to dropping all metrics. Only metrics matching a keep rule will be kept."`
AddLabels map[string]string `toml:"add-labels" comment:"Key/value pairs of labels to add to all metrics."`
DropLabels map[string]string `toml:"drop-labels" comment:"Labels to drop if they match a metrics regex in the format <metrics regex>=<label name>."`
DropMetrics []string `toml:"drop-metrics" comment:"Regexes of metrics to drop."`
KeepMetrics []string `toml:"keep-metrics" comment:"Regexes of metrics to keep."`
KeepMetricsWithLabelValue []LabelMatcher `toml:"keep-metrics-with-label-value" comment:"Regexes of metrics to keep if they have the given label and value."`
AddMetadataLabels *AddMetadataLabels `` /* 134-byte string literal not displayed */
Exporters []string `toml:"exporters" comment:"List of exporter names to forward metrics to."`
}
func (*PrometheusScrape) Validate ¶
func (s *PrometheusScrape) Validate() error
type ScrapeTarget ¶
type ScrapeTarget struct {
HostRegex string `toml:"host-regex" comment:"The regex to match the host name against. If the hostname matches, the URL will be scraped."`
URL string `toml:"url" comment:"The URL to scrape."`
Namespace string `toml:"namespace" comment:"The namespace label to add for metrics scraped at this URL."`
Pod string `toml:"pod" comment:"The pod label to add for metrics scraped at this URL."`
Container string `toml:"container" comment:"The container label to add for metrics scraped at this URL."`
}
func (*ScrapeTarget) Validate ¶
func (t *ScrapeTarget) Validate() error
type TailTarget ¶
type TailTarget struct {
FilePath string `toml:"file-path" comment:"The path to the file to tail."`
LogType sourceparse.Type `` /* 219-byte string literal not displayed */
Database string `toml:"database" comment:"Database to store logs in."`
Table string `toml:"table" comment:"Table to store logs in."`
Parsers []string `toml:"parsers" comment:"Parsers to apply sequentially to the log line."`
}
Click to show internal directories.
Click to hide internal directories.