consul

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const Name = "consul"

Variables

View Source
var DefaultArguments = Config{
	ResourceAttributes: ResourceAttributesConfig{
		CloudRegion: rac.ResourceAttributeConfig{Enabled: true},
		HostID:      rac.ResourceAttributeConfig{Enabled: true},
		HostName:    rac.ResourceAttributeConfig{Enabled: true},
	},
}

DefaultArguments holds default settings for Config.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Address is the address of the Consul server
	Address string `alloy:"address,attr,optional"`

	// Datacenter to use. If not provided, the default agent datacenter is used.
	Datacenter string `alloy:"datacenter,attr,optional"`

	// Token is used to provide a per-request ACL token which overrides the
	// agent's default (empty) token. Token is only required if
	// [Consul's ACL System](https://www.consul.io/docs/security/acl/acl-system)
	// is enabled.
	Token alloytypes.Secret `alloy:"token,attr,optional"`

	// Namespace is the name of the namespace to send along for the request
	// when no other Namespace is present in the QueryOptions
	Namespace string `alloy:"namespace,attr,optional"`

	// Allowlist of [Consul Metadata](https://www.consul.io/docs/agent/options#node_meta)
	// keys to use as resource attributes.
	MetaLabels []string `alloy:"meta,attr,optional"`

	// ResourceAttributes configuration for Consul detector
	ResourceAttributes ResourceAttributesConfig `alloy:"resource_attributes,block,optional"`
}

The struct requires no user-specified fields by default as consul agent's default configuration will be provided to the API client. See `consul.go#NewDetector` for more information.

func (Config) Convert

func (args Config) Convert() map[string]interface{}

func (*Config) SetToDefault

func (args *Config) SetToDefault()

SetToDefault implements syntax.Defaulter.

type ResourceAttributesConfig

type ResourceAttributesConfig struct {
	CloudRegion rac.ResourceAttributeConfig `alloy:"cloud.region,block,optional"`
	HostID      rac.ResourceAttributeConfig `alloy:"host.id,block,optional"`
	HostName    rac.ResourceAttributeConfig `alloy:"host.name,block,optional"`
}

ResourceAttributesConfig provides config for consul resource attributes.

func (*ResourceAttributesConfig) Convert

func (r *ResourceAttributesConfig) Convert() map[string]interface{}

Jump to

Keyboard shortcuts

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