mirror of
https://github.com/hanzoai/traces.git
synced 2026-10-30 18:20:41 +00:00
* generator: extract validation to reusable package We will also use these functions for the config Controller * wip * update deprecated label validation * fix intrinsic dimensions * add span metrics subprocessor comments
23 lines
611 B
Go
23 lines
611 B
Go
package hostinfo
|
|
|
|
import (
|
|
"flag"
|
|
)
|
|
|
|
const (
|
|
defaultHostInfoMetric = "traces_host_info"
|
|
)
|
|
|
|
type Config struct {
|
|
// HostIdentifiers defines the list of resource attributes used to derive
|
|
// a unique `grafana.host.id` value. In most cases, this should be [ "host.id" ]
|
|
HostIdentifiers []string `yaml:"host_identifiers"`
|
|
// MetricName defines the name of the metric that will be generated
|
|
MetricName string `yaml:"metric_name"`
|
|
}
|
|
|
|
func (cfg *Config) RegisterFlagsAndApplyDefaults(string, *flag.FlagSet) {
|
|
cfg.HostIdentifiers = []string{"k8s.node.name", "host.id"}
|
|
cfg.MetricName = defaultHostInfoMetric
|
|
}
|