nova

package
v0.140.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

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.

func NewFactory

func NewFactory() component.Factory

Necessary to satisfy mdatagen tests

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.

type Detector

type Detector struct {
	// contains filtered or unexported fields
}

Detector queries the OpenStack Nova metadata service and emits resource attributes.

func (*Detector) Detect

func (d *Detector) Detect(ctx context.Context) (resource pcommon.Resource, schemaURL string, err error)

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL