Documentation
¶
Overview ¶
Package config contains types from github.com/prometheus/common/config, but modifies them to be serializable with Alloy.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultHTTPClientConfig = HTTPClientConfig{ FollowRedirects: true, EnableHTTP2: true, }
DefaultHTTPClientConfig for initializing objects
Functions ¶
This section is empty.
Types ¶
type Authorization ¶
type Authorization struct {
Type string `alloy:"type,attr,optional"`
Credentials alloytypes.Secret `alloy:"credentials,attr,optional"`
CredentialsFile string `alloy:"credentials_file,attr,optional"`
}
Authorization sets up HTTP authorization credentials.
func (*Authorization) Convert ¶
func (a *Authorization) Convert() *config.Authorization
Convert converts our type to the native prometheus type
func (*Authorization) Validate ¶
func (a *Authorization) Validate() error
type BasicAuth ¶
type BasicAuth struct {
Username string `alloy:"username,attr,optional"`
Password alloytypes.Secret `alloy:"password,attr,optional"`
PasswordFile string `alloy:"password_file,attr,optional"`
}
BasicAuth configures Basic HTTP authentication credentials.
type HTTPClientConfig ¶
type HTTPClientConfig struct {
BasicAuth *BasicAuth `alloy:"basic_auth,block,optional"`
Authorization *Authorization `alloy:"authorization,block,optional"`
OAuth2 *OAuth2Config `alloy:"oauth2,block,optional"`
BearerToken alloytypes.Secret `alloy:"bearer_token,attr,optional"`
BearerTokenFile string `alloy:"bearer_token_file,attr,optional"`
ProxyConfig *ProxyConfig `alloy:",squash"`
TLSConfig TLSConfig `alloy:"tls_config,block,optional"`
FollowRedirects bool `alloy:"follow_redirects,attr,optional"`
EnableHTTP2 bool `alloy:"enable_http2,attr,optional"`
HTTPHeaders *Headers `alloy:",squash"`
}
HTTPClientConfig mirrors config.HTTPClientConfig
func CloneDefaultHTTPClientConfig ¶
func CloneDefaultHTTPClientConfig() *HTTPClientConfig
Clone creates a shallow clone of h.
func (*HTTPClientConfig) Convert ¶
func (h *HTTPClientConfig) Convert() *config.HTTPClientConfig
Convert converts HTTPClientConfig to the native Prometheus type. If h is nil, the default client config is returned.
func (*HTTPClientConfig) SetToDefault ¶
func (h *HTTPClientConfig) SetToDefault()
SetToDefault implements the syntax.Defaulter
func (*HTTPClientConfig) Validate ¶
func (h *HTTPClientConfig) Validate() error
Validate returns an error if h is invalid.
type Headers ¶ added in v1.8.0
type Headers struct {
Headers map[string][]alloytypes.Secret `alloy:"http_headers,attr,optional"`
}
type LabelSelector ¶
type LabelSelector struct {
MatchLabels map[string]string `alloy:"match_labels,attr,optional"`
MatchExpressions []MatchExpression `alloy:"match_expression,block,optional"`
}
LabelSelector defines a selector to check to see if a set of Kubernetes labels matches a selector.
func (*LabelSelector) BuildSelector ¶
func (ls *LabelSelector) BuildSelector() (labels.Selector, error)
BuildSelector builds a labels.Selector from an Alloy LabelSelector.
type MatchExpression ¶
type MatchExpression struct {
Key string `alloy:"key,attr"`
Operator string `alloy:"operator,attr"`
Values []string `alloy:"values,attr,optional"`
}
MatchExpression defines an expression matcher to check to see if some key from a Kubernetes resource matches a selector.
type OAuth2Config ¶
type OAuth2Config struct {
ClientID string `alloy:"client_id,attr,optional"`
ClientSecret alloytypes.Secret `alloy:"client_secret,attr,optional"`
ClientSecretFile string `alloy:"client_secret_file,attr,optional"`
Scopes []string `alloy:"scopes,attr,optional"`
TokenURL string `alloy:"token_url,attr,optional"`
EndpointParams map[string]string `alloy:"endpoint_params,attr,optional"`
ProxyConfig *ProxyConfig `alloy:",squash"`
TLSConfig *TLSConfig `alloy:"tls_config,block,optional"`
}
OAuth2Config sets up the OAuth2 client.
func (*OAuth2Config) Convert ¶
func (o *OAuth2Config) Convert() *config.OAuth2
Convert converts our type to the native prometheus type
func (*OAuth2Config) Validate ¶
func (o *OAuth2Config) Validate() error
type ProxyConfig ¶
type ProxyConfig struct {
ProxyURL URL `alloy:"proxy_url,attr,optional"`
NoProxy string `alloy:"no_proxy,attr,optional"`
ProxyFromEnvironment bool `alloy:"proxy_from_environment,attr,optional"`
ProxyConnectHeader ProxyHeader `alloy:",squash"`
}
func (*ProxyConfig) Convert ¶
func (p *ProxyConfig) Convert() config.ProxyConfig
func (*ProxyConfig) Validate ¶
func (p *ProxyConfig) Validate() error
type ProxyHeader ¶ added in v1.3.0
type ProxyHeader struct {
Header map[string][]alloytypes.Secret `alloy:"proxy_connect_header,attr,optional"`
}
func (*ProxyHeader) Convert ¶ added in v1.3.0
func (h *ProxyHeader) Convert() config.ProxyHeader
type SysLogFormat ¶ added in v1.6.0
type SysLogFormat string
const ( // A modern Syslog RFC SyslogFormatRFC5424 SysLogFormat = "rfc5424" // A legacy Syslog RFC also known as BSD-syslog SyslogFormatRFC3164 SysLogFormat = "rfc3164" )
func (SysLogFormat) MarshalText ¶ added in v1.6.0
func (s SysLogFormat) MarshalText() (text []byte, err error)
MarshalText implements encoding.TextMarshaler
func (*SysLogFormat) UnmarshalText ¶ added in v1.6.0
func (s *SysLogFormat) UnmarshalText(text []byte) error
UnmarshalText implements encoding.TextUnmarshaler
type TLSConfig ¶
type TLSConfig struct {
CA string `alloy:"ca_pem,attr,optional"`
CAFile string `alloy:"ca_file,attr,optional"`
Cert string `alloy:"cert_pem,attr,optional"`
CertFile string `alloy:"cert_file,attr,optional"`
Key alloytypes.Secret `alloy:"key_pem,attr,optional"`
KeyFile string `alloy:"key_file,attr,optional"`
ServerName string `alloy:"server_name,attr,optional"`
InsecureSkipVerify bool `alloy:"insecure_skip_verify,attr,optional"`
MinVersion TLSVersion `alloy:"min_version,attr,optional"`
}
TLSConfig sets up options for TLS connections.
type TLSVersion ¶
type TLSVersion uint16
TLSVersion mirrors config.TLSVersion
func (TLSVersion) MarshalText ¶
func (tv TLSVersion) MarshalText() (text []byte, err error)
MarshalText implements encoding.TextMarshaler
func (*TLSVersion) UnmarshalText ¶
func (tv *TLSVersion) UnmarshalText(text []byte) error
UnmarshalText implements encoding.TextUnmarshaler
type URL ¶
URL mirrors config.URL
func (URL) MarshalText ¶
MarshalText implements encoding.TextMarshaler
func (*URL) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler