oci

package
v0.314.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package oci provides service discovery for Oracle Cloud Infrastructure compute instances.

Index

Constants

This section is empty.

Variables

View Source
var DefaultSDConfig = SDConfig{
	Port:             80,
	RefreshInterval:  model.Duration(60 * time.Second),
	Auth:             authAPIKey,
	HTTPClientConfig: config.DefaultHTTPClientConfig,
}

DefaultSDConfig is the default OCI service discovery configuration.

Functions

This section is empty.

Types

type Discovery

type Discovery struct {
	*refresh.Discovery
	// contains filtered or unexported fields
}

Discovery periodically performs OCI compute instance discovery. It implements the Discoverer interface.

func NewDiscovery

func NewDiscovery(conf *SDConfig, opts discovery.DiscovererOptions) (*Discovery, error)

NewDiscovery returns a new Discovery which periodically refreshes its targets.

type SDConfig

type SDConfig struct {
	// Auth selects the authentication method. Valid values: "api_key" (default),
	// "instance_principal".
	Auth string `yaml:"auth,omitempty"`

	// API key auth fields. Required when Auth is "api_key".
	Tenancy     string `yaml:"tenancy,omitempty"`
	User        string `yaml:"user,omitempty"`
	Fingerprint string `yaml:"fingerprint,omitempty"`
	KeyFile     string `yaml:"key_file,omitempty"`
	// KeyPassphrase is the passphrase used to decrypt KeyFile, if any.
	// Mutually exclusive with KeyPassphraseFile.
	KeyPassphrase config.Secret `yaml:"key_passphrase,omitempty"`
	// KeyPassphraseFile is a path to a file containing the passphrase used to
	// decrypt KeyFile. Mutually exclusive with KeyPassphrase.
	//
	// TODO: read this lazily via a custom common.ConfigurationProvider so
	// rotating the passphrase on disk takes effect without restarting
	// Prometheus, matching the runtime-reloadable semantics of password_file.
	KeyPassphraseFile string `yaml:"key_passphrase_file,omitempty"`

	// Region is required for all auth methods.
	Region string `yaml:"region"`

	// Compartments is an explicit list of compartment OCIDs to scan. When empty,
	// all active compartments reachable from the tenancy root are discovered
	// automatically via the OCI Identity API.
	Compartments []string `yaml:"compartments,omitempty"`

	HTTPClientConfig config.HTTPClientConfig `yaml:",inline"`

	Port            int            `yaml:"port"`
	RefreshInterval model.Duration `yaml:"refresh_interval"`
}

SDConfig is the configuration for OCI service discovery.

func (*SDConfig) Name

func (*SDConfig) Name() string

Name returns the name of the OCI service discovery config.

func (*SDConfig) NewDiscoverer

func (c *SDConfig) NewDiscoverer(opts discovery.DiscovererOptions) (discovery.Discoverer, error)

NewDiscoverer returns a Discoverer for the Config.

func (*SDConfig) NewDiscovererMetrics

NewDiscovererMetrics implements discovery.Config.

func (*SDConfig) SetDirectory

func (c *SDConfig) SetDirectory(dir string)

SetDirectory joins any relative file paths with dir.

func (*SDConfig) UnmarshalYAML

func (c *SDConfig) UnmarshalYAML(unmarshal func(any) error) error

UnmarshalYAML implements the yaml.Unmarshaler interface.

Jump to

Keyboard shortcuts

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