Documentation
¶
Overview ¶
Package oci provides service discovery for Oracle Cloud Infrastructure compute instances.
Index ¶
- Variables
- type Discovery
- type SDConfig
- func (*SDConfig) Name() string
- func (c *SDConfig) NewDiscoverer(opts discovery.DiscovererOptions) (discovery.Discoverer, error)
- func (*SDConfig) NewDiscovererMetrics(_ prometheus.Registerer, rmi discovery.RefreshMetricsInstantiator) discovery.DiscovererMetrics
- func (c *SDConfig) SetDirectory(dir string)
- func (c *SDConfig) UnmarshalYAML(unmarshal func(any) error) error
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 ¶
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) NewDiscoverer ¶
func (c *SDConfig) NewDiscoverer(opts discovery.DiscovererOptions) (discovery.Discoverer, error)
NewDiscoverer returns a Discoverer for the Config.
func (*SDConfig) NewDiscovererMetrics ¶
func (*SDConfig) NewDiscovererMetrics(_ prometheus.Registerer, rmi discovery.RefreshMetricsInstantiator) discovery.DiscovererMetrics
NewDiscovererMetrics implements discovery.Config.
func (*SDConfig) SetDirectory ¶
SetDirectory joins any relative file paths with dir.
Click to show internal directories.
Click to hide internal directories.