Documentation
¶
Index ¶
Constants ¶
View Source
const ( // TypeStr is the detector type id. TypeStr = "nova" // LabelPrefix is the attribute prefix for Nova metadata keys (user/tenant-provided). LabelPrefix = "openstack.nova.meta." )
Variables ¶
This section is empty.
Functions ¶
func NewDetector ¶
NewDetector creates a Nova detector.
Types ¶
type Config ¶
type Config struct {
// Labels is a list of regex patterns to match Nova instance metadata keys
// (from the "meta" map) that should be added as resource attributes.
// Matched keys are emitted as "openstack.nova.meta.<key>: <value>".
Labels []string `mapstructure:"labels"`
// ResourceAttributes controls which standard resource attributes are enabled
// (e.g., host.id, host.name, cloud.provider, etc.).
ResourceAttributes metadata.ResourceAttributesConfig `mapstructure:"resource_attributes"`
// FailOnMissingMetadata, if true, causes the detector to return an error
// when the Nova metadata service is unavailable or required fields are missing.
// If false (default), the detector does best-effort population.
FailOnMissingMetadata bool `mapstructure:"fail_on_missing_metadata"`
}
Config defines user-specified configurations unique to the Nova detector.
func CreateDefaultConfig ¶
func CreateDefaultConfig() Config
CreateDefaultConfig returns the default configuration for the Nova detector.
Click to show internal directories.
Click to hide internal directories.