Documentation
¶
Overview ¶
Copyright (c) F5, Inc.
This source code is licensed under the Apache License, Version 2.0 license found in the LICENSE file in the root directory of this source tree.
Copyright (c) F5, Inc.
This source code is licensed under the Apache License, Version 2.0 license found in the LICENSE file in the root directory of this source tree.
Index ¶
- Constants
- Variables
- func DefaultAllowedDirectories() []string
- func DefaultExcludedFiles() []string
- func DefaultFeatures() []string
- func DefaultLabels() map[string]string
- func Execute(ctx context.Context) error
- func Init(version, commit string)
- func RegisterConfigFile() error
- func RegisterRunner(r func(cmd *cobra.Command, args []string))
- func ToAuxiliaryCommandServerProto(cmd *Command) *mpi.AuxiliaryCommandServer
- func ToCommandProto(cmd *Command) *mpi.CommandServer
- type APIDetails
- type AccessLog
- type Action
- type Attribute
- type AuthConfig
- type BackOff
- type Batch
- type CPUScraper
- type Client
- type Collector
- type Command
- type Config
- func (c *Config) AreReceiversConfigured() bool
- func (c *Config) IsACollectorExporterConfigured() bool
- func (c *Config) IsAuxiliaryCommandGrpcClientConfigured() bool
- func (c *Config) IsCommandGrpcClientConfigured() bool
- func (c *Config) IsCommandServerProxyConfigured() bool
- func (c *Config) IsDirectoryAllowed(directory string) bool
- func (c *Config) IsFeatureEnabled(feature string) bool
- func (c *Config) NewContextWithLabels(ctx context.Context) context.Context
- type ContainerMetricsReceiver
- type DataPlaneConfig
- type DebugExporter
- type DiskScraper
- type Exporters
- type Extensions
- type FileWatcher
- type FilesystemScraper
- type GRPC
- type HTTP
- type Header
- type HeadersSetter
- type Health
- type HostMetrics
- type HostMetricsScrapers
- type InstanceHealthWatcher
- type InstanceWatcher
- type KeepAlive
- type Log
- type LogsGzip
- type MemoryScraper
- type NetworkScraper
- type NginxDataPlaneConfig
- type NginxPlusReceiver
- type NginxReceiver
- type Operator
- type OtlpExporter
- type OtlpReceiver
- type OtlpTLSConfig
- type Pipeline
- type Pipelines
- type Processors
- type PrometheusExporter
- type Proxy
- type Receivers
- type Resource
- type ResourceAttribute
- type ServerConfig
- type ServerType
- type TLSConfig
- type TcplogReceiver
- type Watchers
Constants ¶
const ( ConfigFileName = "nginx-agent.conf" EnvPrefix = "NGINX_AGENT" KeyDelimiter = "_" KeyValueNumber = 2 AgentDirName = "/etc/nginx-agent" DefaultMetricsBatchProcessor = "default_metrics" DefaultLogsBatchProcessor = "default_logs" DefaultExporter = "default" DefaultPipeline = "default" )
const ( DefGracefulShutdownPeriod = 5 * time.Second DefNginxReloadMonitoringPeriod = 10 * time.Second DefTreatErrorsAsWarnings = false DefNginxApiTlsCa = "" // Nginx Reload Backoff defaults DefNginxReloadBackoffInitialInterval = 500 * time.Millisecond DefNginxReloadBackoffRandomizationFactor = 0.5 // the value is 0 <= and < 1 DefNginxReloadBackoffMultiplier = 2 DefNginxReloadBackoffMaxInterval = 3 * time.Second DefNginxReloadBackoffMaxElapsedTime = 10 * time.Second DefCommandServerHostKey = "" DefCommandServerPortKey = 0 DefCommandServerTypeKey = "grpc" DefCommandAuthTokenKey = "" DefCommandAuthTokenPathKey = "" DefCommandTLSCertKey = "" DefCommandTLSKeyKey = "" DefCommandTLSCaKey = "" DefCommandTLSSkipVerifyKey = false DefCommandTLServerNameKey = "" DefCommandServerProxyURlKey = "" DefCommandServerProxyNoProxyKey = "" DefCommandServerProxyAuthMethodKey = "" DefCommandServerProxyUsernameKey = "" DefCommandServerProxyPasswordKey = "" DefCommandServerProxyTokenKey = "" DefCommandServerProxyTLSCertKey = "" DefCommandServerProxyTLSKeyKey = "" DefCommandServerProxyTLSCaKey = "" DefCommandServerProxyTLSSkipVerifyKey = false DefCommandServerProxyTLServerNameKey = "" DefCommandServerProxyTimeoutKey = 10 * time.Second DefAuxiliaryCommandServerHostKey = "" DefAuxiliaryCommandServerPortKey = 0 DefAuxiliaryCommandServerTypeKey = "grpc" DefAuxiliaryCommandAuthTokenKey = "" DefAuxiliaryCommandAuthTokenPathKey = "" DefAuxiliaryCommandTLSCertKey = "" DefAuxiliaryCommandTLSKeyKey = "" DefAuxiliaryCommandTLSCaKey = "" DefAuxiliaryCommandTLSSkipVerifyKey = false DefAuxiliaryCommandTLServerNameKey = "" // Client GRPC Settings DefMaxMessageSize = 0 // 0 = unset DefMaxMessageRecieveSize = 4194304 // default 4 MB DefMaxMessageSendSize = 4194304 // default 4 MB DefMaxFileSize uint32 = 1048576 // 1MB DefFileChunkSize uint32 = 524288 // 0.5MB // Client HTTP Settings DefHTTPTimeout = 10 * time.Second // Client GRPC Keep Alive Settings DefGRPCKeepAliveTimeout = 10 * time.Second DefGRPCKeepAliveTime = 20 * time.Second DefGRPCKeepAlivePermitWithoutStream = true // Client Backoff defaults DefBackoffInitialInterval = 1 * time.Second DefBackoffRandomizationFactor = 0.5 // the value is 0 <= and < 1 DefBackoffMultiplier = 3 DefBackoffMaxInterval = 20 * time.Second DefBackoffMaxElapsedTime = 1 * time.Minute // Watcher defaults DefInstanceWatcherMonitoringFrequency = 5 * time.Second DefInstanceHealthWatcherMonitoringFrequency = 5 * time.Second DefFileWatcherMonitoringFrequency = 5 * time.Second // Collector defaults DefCollectorConfigPath = "/etc/nginx-agent/opentelemetry-collector-agent.yaml" DefCollectorLogLevel = "INFO" DefCollectorLogPath = "/var/log/nginx-agent/opentelemetry-collector-agent.log" DefCollectorTLSCertPath = "/var/lib/nginx-agent/cert.pem" DefCollectorTLSKeyPath = "/var/lib/nginx-agent/key.pem" DefCollectorTLSCAPath = "/var/lib/nginx-agent/ca.pem" DefCollectorTLSSANNames = "127.0.0.1,::1,localhost" DefCollectorMetricsBatchProcessorSendBatchSize = 1000 DefCollectorMetricsBatchProcessorSendBatchMaxSize = 1000 DefCollectorMetricsBatchProcessorTimeout = 30 * time.Second DefCollectorLogsBatchProcessorSendBatchSize = 100 DefCollectorLogsBatchProcessorSendBatchMaxSize = 100 DefCollectorLogsBatchProcessorTimeout = 60 * time.Second DefCollectorExtensionsHealthServerHost = "localhost" DefCollectorExtensionsHealthServerPort = 13133 DefCollectorExtensionsHealthPath = "/" DefCollectorExtensionsHealthTLSCertPath = "" DefCollectorExtensionsHealthTLSKeyPath = "" DefCollectorExtensionsHealthTLSCAPath = "" DefCollectorExtensionsHealthTLSSkipVerify = false DefCollectorExtensionsHealthTLServerNameKey = "" // File defaults DefManifestDir = "/var/lib/nginx-agent" )
const ( ClientRootKey = "client" AllowedDirectoriesKey = "allowed_directories" ConfigPathKey = "path" CommandRootKey = "command" AuxiliaryCommandRootKey = "auxiliary_command" DataPlaneConfigRootKey = "data_plane_config" LabelsRootKey = "labels" LogLevelRootKey = "log" CollectorRootKey = "collector" VersionKey = "version" UUIDKey = "uuid" FeaturesKey = "features" InstanceWatcherMonitoringFrequencyKey = "watchers_instance_watcher_monitoring_frequency" InstanceHealthWatcherMonitoringFrequencyKey = "watchers_instance_health_watcher_monitoring_frequency" FileWatcherKey = "watchers_file_watcher" ManifestDirPathKey = "manifest_dir" )
Variables ¶
var ( // child flags saved as vars to enable easier prefixing. GrpcKeepAlive = pre(ClientRootKey) + "grpc_keepalive" ClientKeepAlivePermitWithoutStreamKey = pre(GrpcKeepAlive) + "permit_without_stream" ClientKeepAliveTimeKey = pre(GrpcKeepAlive) + "time" ClientKeepAliveTimeoutKey = pre(GrpcKeepAlive) + "timeout" ClientHTTPTimeoutKey = pre(ClientRootKey) + "http_timeout" ClientGRPCMaxMessageSendSizeKey = pre(ClientRootKey) + "grpc_max_message_send_size" ClientGRPCMaxMessageReceiveSizeKey = pre(ClientRootKey) + "grpc_max_message_receive_size" ClientGRPCMaxMessageSizeKey = pre(ClientRootKey) + "grpc_max_message_size" ClientGRPCMaxFileSizeKey = pre(ClientRootKey) + "grpc_max_file_size" ClientGRPCFileChunkSizeKey = pre(ClientRootKey) + "grpc_file_chunk_size" ClientBackoffInitialIntervalKey = pre(ClientRootKey) + "backoff_initial_interval" ClientBackoffMaxIntervalKey = pre(ClientRootKey) + "backoff_max_interval" ClientBackoffMaxElapsedTimeKey = pre(ClientRootKey) + "backoff_max_elapsed_time" ClientBackoffRandomizationFactorKey = pre(ClientRootKey) + "backoff_randomization_factor" ClientBackoffMultiplierKey = pre(ClientRootKey) + "backoff_multiplier" CollectorConfigPathKey = pre(CollectorRootKey) + "config_path" CollectorExportersKey = pre(CollectorRootKey) + "exporters" CollectorDebugExporterKey = pre(CollectorExportersKey) + "debug" CollectorPrometheusExporterKey = pre(CollectorExportersKey) + "prometheus" CollectorPrometheusExporterServerHostKey = pre(CollectorPrometheusExporterKey) + "server_host" CollectorPrometheusExporterServerPortKey = pre(CollectorPrometheusExporterKey) + "server_port" CollectorPrometheusExporterTLSKey = pre(CollectorPrometheusExporterKey) + "tls" CollectorPrometheusExporterTLSCertKey = pre(CollectorPrometheusExporterTLSKey) + "cert" CollectorPrometheusExporterTLSKeyKey = pre(CollectorPrometheusExporterTLSKey) + "key" CollectorPrometheusExporterTLSCaKey = pre(CollectorPrometheusExporterTLSKey) + "ca" CollectorPrometheusExporterTLSSkipVerifyKey = pre(CollectorPrometheusExporterTLSKey) + "skip_verify" CollectorPrometheusExporterTLSServerNameKey = pre(CollectorPrometheusExporterTLSKey) + "server_name" CollectorOtlpExportersKey = pre(CollectorExportersKey) + "otlp" CollectorProcessorsKey = pre(CollectorRootKey) + "processors" CollectorExtensionsKey = pre(CollectorRootKey) + "extensions" CollectorExtensionsHealthKey = pre(CollectorExtensionsKey) + "health" CollectorExtensionsHealthServerHostKey = pre(CollectorExtensionsHealthKey) + "server_host" CollectorExtensionsHealthServerPortKey = pre(CollectorExtensionsHealthKey) + "server_port" CollectorExtensionsHealthPathKey = pre(CollectorExtensionsHealthKey) + "path" CollectorExtensionsHealthTLSKey = pre(CollectorExtensionsHealthKey) + "tls" CollectorExtensionsHealthTLSCaKey = pre(CollectorExtensionsHealthTLSKey) + "ca" CollectorExtensionsHealthTLSCertKey = pre(CollectorExtensionsHealthTLSKey) + "cert" CollectorExtensionsHealthTLSKeyKey = pre(CollectorExtensionsHealthTLSKey) + "key" CollectorExtensionsHealthTLSServerNameKey = pre(CollectorExtensionsHealthTLSKey) + "server_name" CollectorExtensionsHealthTLSSkipVerifyKey = pre(CollectorExtensionsHealthTLSKey) + "skip_verify" CollectorExtensionsHeadersSetterKey = pre(CollectorExtensionsKey) + "headers_setter" CollectorPipelinesKey = pre(CollectorRootKey) + "pipelines" CollectorMetricsPipelinesKey = pre(CollectorPipelinesKey) + "metrics" CollectorLogsPipelinesKey = pre(CollectorPipelinesKey) + "logs" CollectorReceiversKey = pre(CollectorRootKey) + "receivers" CollectorLogKey = pre(CollectorRootKey) + "log" CollectorLogLevelKey = pre(CollectorLogKey) + "level" CollectorLogPathKey = pre(CollectorLogKey) + "path" CommandAuthKey = pre(CommandRootKey) + "auth" CommandAuthTokenKey = pre(CommandAuthKey) + "token" CommandAuthTokenPathKey = pre(CommandAuthKey) + "tokenpath" CommandServerHostKey = pre(CommandServerKey) + "host" CommandServerKey = pre(CommandRootKey) + "server" CommandServerPortKey = pre(CommandServerKey) + "port" CommandServerTypeKey = pre(CommandServerKey) + "type" CommandTLSKey = pre(CommandRootKey) + "tls" CommandTLSCaKey = pre(CommandTLSKey) + "ca" CommandTLSCertKey = pre(CommandTLSKey) + "cert" CommandTLSKeyKey = pre(CommandTLSKey) + "key" CommandTLSServerNameKey = pre(CommandTLSKey) + "server_name" CommandTLSSkipVerifyKey = pre(CommandTLSKey) + "skip_verify" CommandServerProxyTimeoutKey = pre(CommandServerKey) + "proxy_timeout" CommandServerProxyURLKey = pre(CommandServerKey) + "proxy_url" CommandServerProxyUsernameKey = pre(CommandServerKey) + "proxy_username" CommandServerProxyPasswordKey = pre(CommandServerKey) + "proxy_password" CommandServerProxyNoProxyKey = pre(CommandServerKey) + "proxy_no_proxy" CommandServerProxyTokenKey = pre(CommandServerKey) + "proxy_token" CommandServerProxyAuthMethodKey = pre(CommandServerKey) + "proxy_auth_method" CommandServerProxyTLSCertKey = pre(CommandServerKey) + "proxy_tls_cert" CommandServerProxyTLSKeyKey = pre(CommandServerKey) + "proxy_tls_key" CommandServerProxyTLSCaKey = pre(CommandServerKey) + "proxy_tls_ca" CommandServerProxyTLSSkipVerifyKey = pre(CommandServerKey) + "proxy_tls_skip_verify" CommandServerProxyTLSServerNameKey = pre(CommandServerKey) + "proxy_tls_server_name" AuxiliaryCommandAuthKey = pre(AuxiliaryCommandRootKey) + "auth" AuxiliaryCommandAuthTokenKey = pre(AuxiliaryCommandAuthKey) + "token" AuxiliaryCommandAuthTokenPathKey = pre(AuxiliaryCommandAuthKey) + "tokenpath" AuxiliaryCommandServerHostKey = pre(AuxiliaryCommandServerKey) + "host" AuxiliaryCommandServerKey = pre(AuxiliaryCommandRootKey) + "server" AuxiliaryCommandServerPortKey = pre(AuxiliaryCommandServerKey) + "port" AuxiliaryCommandServerTypeKey = pre(AuxiliaryCommandServerKey) + "type" AuxiliaryCommandTLSKey = pre(AuxiliaryCommandRootKey) + "tls" AuxiliaryCommandTLSCaKey = pre(AuxiliaryCommandTLSKey) + "ca" AuxiliaryCommandTLSCertKey = pre(AuxiliaryCommandTLSKey) + "cert" AuxiliaryCommandTLSKeyKey = pre(AuxiliaryCommandTLSKey) + "key" AuxiliaryCommandTLSServerNameKey = pre(AuxiliaryCommandTLSKey) + "server_name" AuxiliaryCommandTLSSkipVerifyKey = pre(AuxiliaryCommandTLSKey) + "skip_verify" LogLevelKey = pre(LogLevelRootKey) + "level" LogPathKey = pre(LogLevelRootKey) + "path" NginxReloadMonitoringPeriodKey = pre(DataPlaneConfigRootKey, "nginx") + "reload_monitoring_period" NginxTreatWarningsAsErrorsKey = pre(DataPlaneConfigRootKey, "nginx") + "treat_warnings_as_errors" NginxReloadBackoffKey = pre(DataPlaneConfigRootKey, "nginx") + "reload_backoff" NginxReloadBackoffInitialIntervalKey = pre(NginxReloadBackoffKey) + "initial_interval" NginxReloadBackoffMaxIntervalKey = pre(NginxReloadBackoffKey) + "max_interval" NginxReloadBackoffMaxElapsedTimeKey = pre(NginxReloadBackoffKey) + "max_elapsed_time" NginxReloadBackoffRandomizationFactorKey = pre(NginxReloadBackoffKey) + "randomization_factor" NginxReloadBackoffMultiplierKey = pre(NginxReloadBackoffKey) + "multiplier" NginxExcludeLogsKey = pre(DataPlaneConfigRootKey, "nginx") + "exclude_logs" NginxApiTlsCa = pre(DataPlaneConfigRootKey, "nginx") + "api_tls_ca" FileWatcherMonitoringFrequencyKey = pre(FileWatcherKey) + "monitoring_frequency" NginxExcludeFilesKey = pre(FileWatcherKey) + "exclude_files" )
var CompletionCommand = &cobra.Command{ Use: "completion [bash|zsh|fish]", Short: "Generate completion script.", Long: `To load completions: Bash: $ source <(nginx-agent completion bash) # To load completions for each session, execute once: Linux: $ nginx-agent completion bash > /etc/bash_completion.d/nginx-agent MacOS: $ nginx-agent completion bash > /usr/local/etc/bash_completion.d/nginx-agent Zsh: # If shell completion is not already enabled in your environment you will need # to enable it. You can execute the following once: $ echo "autoload -U compinit; compinit" >> ~/.zshrc # To load completions for each session, execute once: $ nginx-agent completion zsh > "${fpath[1]}/_nginx-agent" # You will need to start a new shell for this setup to take effect. Fish: $ nginx-agent completion fish | source # To load completions for each session, execute once: $ nginx-agent completion fish > ~/.config/fish/completions/nginx-agent.fish `, DisableFlagsInUseLine: true, ValidArgs: []string{"bash", "zsh", "fish"}, Args: cobra.MatchAll(cobra.ExactArgs(1), cobra.OnlyValidArgs), Run: func(cmd *cobra.Command, args []string) { var err error switch args[0] { case "bash": err = cmd.Root().GenBashCompletion(os.Stdout) case "zsh": err = cmd.Root().GenZshCompletion(os.Stdout) case "fish": err = cmd.Root().GenFishCompletion(os.Stdout, true) } if err != nil { slog.Warn("Error sending command", "error", err) } }, }
var RootCommand = &cobra.Command{
Use: "nginx-agent [flags]",
Short: "nginx-agent",
}
Functions ¶
func DefaultAllowedDirectories ¶
func DefaultAllowedDirectories() []string
func DefaultExcludedFiles ¶
func DefaultExcludedFiles() []string
func DefaultFeatures ¶
func DefaultFeatures() []string
func DefaultLabels ¶
func RegisterConfigFile ¶
func RegisterConfigFile() error
func RegisterRunner ¶
func ToAuxiliaryCommandServerProto ¶ added in v3.2.0
func ToAuxiliaryCommandServerProto(cmd *Command) *mpi.AuxiliaryCommandServer
ToAuxiliaryCommandServerProto maps the AgentConfig Command struct back to the AuxiliaryCommandServer proto message
func ToCommandProto ¶
func ToCommandProto(cmd *Command) *mpi.CommandServer
ToCommandProto maps the AgentConfig Command struct back to the Command proto message
Types ¶
type APIDetails ¶
type AuthConfig ¶
type BackOff ¶
type BackOff struct { InitialInterval time.Duration `yaml:"initial_interval" mapstructure:"initial_interval"` MaxInterval time.Duration `yaml:"max_interval" mapstructure:"max_interval"` MaxElapsedTime time.Duration `yaml:"max_elapsed_time" mapstructure:"max_elapsed_time"` RandomizationFactor float64 `yaml:"randomization_factor" mapstructure:"randomization_factor"` Multiplier float64 `yaml:"multiplier" mapstructure:"multiplier"` }
type CPUScraper ¶
type CPUScraper struct{}
type Collector ¶
type Collector struct { ConfigPath string `yaml:"config_path" mapstructure:"config_path"` Log *Log `yaml:"log" mapstructure:"log"` Exporters Exporters `yaml:"exporters" mapstructure:"exporters"` Extensions Extensions `yaml:"extensions" mapstructure:"extensions"` Processors Processors `yaml:"processors" mapstructure:"processors"` Pipelines Pipelines `yaml:"pipelines" mapstructure:"pipelines"` Receivers Receivers `yaml:"receivers" mapstructure:"receivers"` }
type Command ¶
type Command struct { Server *ServerConfig `yaml:"server" mapstructure:"server"` Auth *AuthConfig `yaml:"auth" mapstructure:"auth"` TLS *TLSConfig `yaml:"tls" mapstructure:"tls"` }
func FromCommandProto ¶
func FromCommandProto(config *mpi.CommandServer) *Command
FromCommandProto maps the AgentConfig Command struct to the Command proto message
type Config ¶
type Config struct { Command *Command `yaml:"command" mapstructure:"command"` AuxiliaryCommand *Command `yaml:"auxiliary_command" mapstructure:"auxiliary_command"` Log *Log `yaml:"log" mapstructure:"log"` DataPlaneConfig *DataPlaneConfig `yaml:"data_plane_config" mapstructure:"data_plane_config"` Client *Client `yaml:"client" mapstructure:"client"` Collector *Collector `yaml:"collector" mapstructure:"collector"` Watchers *Watchers `yaml:"watchers" mapstructure:"watchers"` Labels map[string]any `yaml:"labels" mapstructure:"labels"` Version string `yaml:"-"` Path string `yaml:"-"` UUID string `yaml:"-"` ManifestDir string `yaml:"-"` AllowedDirectories []string `yaml:"allowed_directories" mapstructure:"allowed_directories"` Features []string `yaml:"features" mapstructure:"features"` }
func ResolveConfig ¶
func (*Config) AreReceiversConfigured ¶
func (*Config) IsACollectorExporterConfigured ¶
func (*Config) IsAuxiliaryCommandGrpcClientConfigured ¶ added in v3.2.0
func (*Config) IsCommandGrpcClientConfigured ¶ added in v3.2.0
func (*Config) IsCommandServerProxyConfigured ¶ added in v3.3.0
func (*Config) IsDirectoryAllowed ¶
func (*Config) IsFeatureEnabled ¶
type DataPlaneConfig ¶
type DataPlaneConfig struct {
Nginx *NginxDataPlaneConfig `yaml:"nginx" mapstructure:"nginx"`
}
type DebugExporter ¶
type DebugExporter struct{}
type DiskScraper ¶
type DiskScraper struct{}
type Exporters ¶
type Exporters struct { Debug *DebugExporter `yaml:"debug" mapstructure:"debug"` PrometheusExporter *PrometheusExporter `yaml:"prometheus" mapstructure:"prometheus"` OtlpExporters map[string]*OtlpExporter `yaml:"otlp" mapstructure:"otlp"` }
type Extensions ¶
type Extensions struct { Health *Health `yaml:"health" mapstructure:"health"` HeadersSetter *HeadersSetter `yaml:"headers_setter" mapstructure:"headers_setter"` }
type FileWatcher ¶
type FilesystemScraper ¶
type FilesystemScraper struct{}
type GRPC ¶
type GRPC struct { KeepAlive *KeepAlive `yaml:"keepalive" mapstructure:"keepalive"` // if MaxMessageSize is size set then we use that value, // otherwise MaxMessageRecieveSize and MaxMessageSendSize for individual settings MaxMessageSize int `yaml:"max_message_size" mapstructure:"max_message_size"` MaxMessageReceiveSize int `yaml:"max_message_receive_size" mapstructure:"max_message_receive_size"` MaxMessageSendSize int `yaml:"max_message_send_size" mapstructure:"max_message_send_size"` MaxFileSize uint32 `yaml:"max_file_size" mapstructure:"max_file_size"` FileChunkSize uint32 `yaml:"file_chunk_size" mapstructure:"file_chunk_size"` }
type Header ¶
type Header struct { Action string `yaml:"action" mapstructure:"action"` Key string `yaml:"key" mapstructure:"key"` Value string `yaml:"value" mapstructure:"value"` DefaultValue string `yaml:"default_value" mapstructure:"default_value"` FromContext string `yaml:"from_context" mapstructure:"from_context"` FilePath string `yaml:"file_path" mapstructure:"file_path"` }
type HeadersSetter ¶
type HeadersSetter struct {
Headers []Header `yaml:"headers" mapstructure:"headers"`
}
type Health ¶
type Health struct { Server *ServerConfig `yaml:"server" mapstructure:"server"` TLS *TLSConfig `yaml:"tls" mapstructure:"tls"` Path string `yaml:"path" mapstructure:"path"` }
type HostMetrics ¶
type HostMetrics struct { Scrapers *HostMetricsScrapers `yaml:"scrapers" mapstructure:"scrapers"` CollectionInterval time.Duration `yaml:"collection_interval" mapstructure:"collection_interval"` InitialDelay time.Duration `yaml:"initial_delay" mapstructure:"initial_delay"` }
type HostMetricsScrapers ¶
type HostMetricsScrapers struct { CPU *CPUScraper `yaml:"cpu" mapstructure:"cpu"` Disk *DiskScraper `yaml:"disk" mapstructure:"disk"` Filesystem *FilesystemScraper `yaml:"filesystem" mapstructure:"filesystem"` Memory *MemoryScraper `yaml:"memory" mapstructure:"memory"` Network *NetworkScraper `yaml:"network" mapstructure:"network"` }
type InstanceHealthWatcher ¶
type InstanceWatcher ¶
type MemoryScraper ¶
type MemoryScraper struct{}
type NetworkScraper ¶
type NetworkScraper struct{}
type NginxDataPlaneConfig ¶
type NginxDataPlaneConfig struct { ReloadBackoff *BackOff `yaml:"reload_backoff" mapstructure:"reload_backoff"` APITls TLSConfig `yaml:"api_tls" mapstructure:"api_tls"` ExcludeLogs []string `yaml:"exclude_logs" mapstructure:"exclude_logs"` ReloadMonitoringPeriod time.Duration `yaml:"reload_monitoring_period" mapstructure:"reload_monitoring_period"` TreatWarningsAsErrors bool `yaml:"treat_warnings_as_errors" mapstructure:"treat_warnings_as_errors"` }
type NginxPlusReceiver ¶
type NginxPlusReceiver struct { InstanceID string `yaml:"instance_id" mapstructure:"instance_id"` PlusAPI APIDetails `yaml:"api_details" mapstructure:"api_details"` CollectionInterval time.Duration `yaml:"collection_interval" mapstructure:"collection_interval"` }
type NginxReceiver ¶
type NginxReceiver struct { InstanceID string `yaml:"instance_id" mapstructure:"instance_id"` StubStatus APIDetails `yaml:"api_details" mapstructure:"api_details"` AccessLogs []AccessLog `yaml:"access_logs" mapstructure:"access_logs"` CollectionInterval time.Duration `yaml:"collection_interval" mapstructure:"collection_interval"` }
func (*NginxReceiver) Validate ¶
func (nr *NginxReceiver) Validate(allowedDirectories []string) error
type Operator ¶
type Operator struct { Fields map[string]string `yaml:"fields" mapstructure:"fields"` Type string `yaml:"type" mapstructure:"type"` }
There are many types of operators with different field names so we use a generic map to store the fields. See here for more info: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/pkg/stanza/docs/operators/README.md
type OtlpExporter ¶
type OtlpExporter struct { Server *ServerConfig `yaml:"server" mapstructure:"server"` TLS *TLSConfig `yaml:"tls" mapstructure:"tls"` Compression string `yaml:"compression" mapstructure:"compression"` Authenticator string `yaml:"authenticator" mapstructure:"authenticator"` }
type OtlpReceiver ¶
type OtlpReceiver struct { Server *ServerConfig `yaml:"server" mapstructure:"server"` Auth *AuthConfig `yaml:"auth" mapstructure:"auth"` OtlpTLSConfig *OtlpTLSConfig `yaml:"tls" mapstructure:"tls"` }
type OtlpTLSConfig ¶
type OtlpTLSConfig struct { Cert string `yaml:"cert" mapstructure:"cert"` Key string `yaml:"key" mapstructure:"key"` Ca string `yaml:"ca" mapstructure:"ca"` ServerName string `yaml:"server_name" mapstructure:"server_name"` ExistingCert bool `yaml:"-"` SkipVerify bool `yaml:"skip_verify" mapstructure:"skip_verify"` GenerateSelfSignedCert bool `yaml:"generate_self_signed_cert" mapstructure:"generate_self_signed_cert"` }
Specialized TLS configuration for OtlpReceiver with self-signed cert generation.
type Processors ¶
type Processors struct { Attribute map[string]*Attribute `yaml:"attribute" mapstructure:"attribute"` Resource map[string]*Resource `yaml:"resource" mapstructure:"resource"` Batch map[string]*Batch `yaml:"batch" mapstructure:"batch"` LogsGzip map[string]*LogsGzip `yaml:"logsgzip" mapstructure:"logsgzip"` }
OTel Collector Processors configuration.
type PrometheusExporter ¶
type PrometheusExporter struct { Server *ServerConfig `yaml:"server" mapstructure:"server"` TLS *TLSConfig `yaml:"tls" mapstructure:"tls"` }
type Proxy ¶ added in v3.3.0
type Proxy struct { TLS *TLSConfig `yaml:"tls,omitempty" mapstructure:"tls"` URL string `yaml:"url" mapstructure:"url"` NoProxy string `yaml:"no_proxy,omitempty" mapstructure:"no_proxy"` AuthMethod string `yaml:"auth_method,omitempty" mapstructure:"auth_method"` Username string `yaml:"username,omitempty" mapstructure:"username"` Password string `yaml:"password,omitempty" mapstructure:"password"` Token string `yaml:"token,omitempty" mapstructure:"token"` Timeout time.Duration `yaml:"timeout" mapstructure:"timeout"` }
type Receivers ¶
type Receivers struct { ContainerMetrics *ContainerMetricsReceiver `yaml:"container_metrics" mapstructure:"container_metrics"` HostMetrics *HostMetrics `yaml:"host_metrics" mapstructure:"host_metrics"` OtlpReceivers map[string]*OtlpReceiver `yaml:"otlp" mapstructure:"otlp"` TcplogReceivers map[string]*TcplogReceiver `yaml:"tcplog" mapstructure:"tcplog"` NginxReceivers []NginxReceiver `yaml:"-"` NginxPlusReceivers []NginxPlusReceiver `yaml:"-"` }
OTel Collector Receiver configuration.
type Resource ¶
type Resource struct {
Attributes []ResourceAttribute `yaml:"attributes" mapstructure:"attributes"`
}
type ResourceAttribute ¶
type ServerConfig ¶
type ServerConfig struct { Proxy *Proxy `yaml:"proxy" mapstructure:"proxy"` Type ServerType `yaml:"type" mapstructure:"type"` Host string `yaml:"host" mapstructure:"host"` Port int `yaml:"port" mapstructure:"port"` }
type TcplogReceiver ¶
type Watchers ¶
type Watchers struct { FileWatcher FileWatcher `yaml:"file_watcher" mapstructure:"file_watcher"` InstanceWatcher InstanceWatcher `yaml:"instance_watcher" mapstructure:"instance_watcher"` //nolint:lll // this needs to be in one line InstanceHealthWatcher InstanceHealthWatcher `yaml:"instance_health_watcher" mapstructure:"instance_health_watcher"` }