Documentation
¶
Index ¶
Constants ¶
View Source
const (
TypeStr = "k8snode"
)
Variables ¶
This section is empty.
Functions ¶
func NewDetector ¶
func NewDetector(set processor.CreateSettings, dcfg internal.DetectorConfig) (internal.Detector, error)
Types ¶
type Config ¶
type Config struct {
k8sconfig.APIConfig `mapstructure:",squash"`
// NodeFromEnv can be used to extract the node name from an environment
// variable. The value must be the name of the environment variable.
// This is useful when the node a Otel agent will run on cannot be
// predicted. In such cases, the Kubernetes downward API can be used to
// add the node name to each pod as an environment variable. K8s tagger
// can then read this value and filter pods by it.
// NodeFromEnv defaults to K8S_NODE_NAME
//
// For example, node name can be passed to each agent with the downward API as follows
//
// env:
// - name: K8S_NODE_NAME
// valueFrom:
// fieldRef:
// fieldPath: spec.nodeName
//
// Then the NodeFromEnv field can be set to `K8S_NODE_NAME` to filter all pods by the node that
// the agent is running on.
//
// More on downward API here: https://kubernetes.io/docs/tasks/inject-data-application/environment-variable-expose-pod-information/
NodeFromEnvVar string `mapstructure:"node_from_env_var"`
ResourceAttributes metadata.ResourceAttributesConfig `mapstructure:"resource_attributes"`
}
func CreateDefaultConfig ¶
func CreateDefaultConfig() Config
func (*Config) UpdateDefaults ¶
UpdateDefaults validates and update the default config with user's provided settings
Click to show internal directories.
Click to hide internal directories.