v1alpha1

package
v1.2.99-rc1 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// SchemeGroupVersion is the group version used to register CRDs for this
	// package.
	SchemeGroupVersion = schema.GroupVersion{Group: "monitoring.grafana.com", Version: "v1alpha1"}

	// SchemeBuilder is used to add Go types to the GroupVersionKind scheme.
	SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}

	// AddToScheme is required by client packages.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

This section is empty.

Types

type CRIStageSpec added in v0.19.0

type CRIStageSpec struct{}

CRIStageSpec is a parsing stage that reads log lines using the standard CRI logging format. It needs no defined fields.

func (*CRIStageSpec) DeepCopy added in v0.19.0

func (in *CRIStageSpec) DeepCopy() *CRIStageSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CRIStageSpec.

func (*CRIStageSpec) DeepCopyInto added in v0.19.0

func (in *CRIStageSpec) DeepCopyInto(out *CRIStageSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DockerStageSpec added in v0.19.0

type DockerStageSpec struct{}

DockerStageSpec is a parsing stage that reads log lines using the standard Docker logging format. It needs no defined fields.

func (*DockerStageSpec) DeepCopy added in v0.19.0

func (in *DockerStageSpec) DeepCopy() *DockerStageSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerStageSpec.

func (*DockerStageSpec) DeepCopyInto added in v0.19.0

func (in *DockerStageSpec) DeepCopyInto(out *DockerStageSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DropStageSpec added in v0.19.0

type DropStageSpec struct {
	// Name from the extract data to parse. If empty, uses the log message.
	Source string `json:"source,omitempty"`

	// RE2 regular exprssion.
	//
	// If source is provided, the regex will attempt
	// to match the source.
	//
	// If no source is provided, then the regex will attempt
	// to attach the log line.
	//
	// If the provided regex matches the log line or a provided source, the
	// line will be dropped.
	Expression string `json:"expression,omitempty"`

	// Value can only be specified when source is specified. If the value
	// provided is an exact match for the given source then the line will be
	// dropped.
	//
	// Mutually exclusive with expression.
	Value string `json:"value,omitempty"`

	// OlderThan will be parsed as a Go duration. If the log line's timestamp
	// is older than the current time minus the provided duration it will be
	// dropped.
	OlderThan string `json:"olderThan,omitempty"`

	// LongerThan will drop a log line if it its content is longer than this
	// value (in bytes). Can be expressed as an integer (8192) or a number with a
	// suffix (8kb).
	LongerThan string `json:"longerThan,omitempty"`

	// Every time a log line is dropped the metric logentry_dropped_lines_total
	// will be incremented. A "reason" label is added, and can be customized by
	// providing a custom value here. Defaults to "drop_stage."
	DropCounterReason string `json:"dropCounterReason,omitempty"`
}

DropStageSpec is a filtering stage that lets you drop certain logs.

func (*DropStageSpec) DeepCopy added in v0.19.0

func (in *DropStageSpec) DeepCopy() *DropStageSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DropStageSpec.

func (*DropStageSpec) DeepCopyInto added in v0.19.0

func (in *DropStageSpec) DeepCopyInto(out *DropStageSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type GrafanaAgent

type GrafanaAgent struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// Spec holds the specification of the desired behavior for the Grafana Agent
	// cluster.
	Spec GrafanaAgentSpec `json:"spec,omitempty"`
}

GrafanaAgent defines a Grafana Agent deployment.

func (*GrafanaAgent) DeepCopy

func (in *GrafanaAgent) DeepCopy() *GrafanaAgent

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GrafanaAgent.

func (*GrafanaAgent) DeepCopyInto

func (in *GrafanaAgent) DeepCopyInto(out *GrafanaAgent)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*GrafanaAgent) DeepCopyObject

func (in *GrafanaAgent) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*GrafanaAgent) LogsInstanceSelector added in v0.19.0

func (a *GrafanaAgent) LogsInstanceSelector() ObjectSelector

LogsInstanceSelector returns a selector to find LogsInstances.

func (*GrafanaAgent) MetricsInstanceSelector added in v0.19.0

func (a *GrafanaAgent) MetricsInstanceSelector() ObjectSelector

MetricsInstanceSelector returns a selector to find MetricsInstances.

type GrafanaAgentList

type GrafanaAgentList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	// Items is the list of GrafanaAgents.
	Items []*GrafanaAgent `json:"items"`
}

GrafanaAgentList is a list of GrafanaAgents.

func (*GrafanaAgentList) DeepCopy

func (in *GrafanaAgentList) DeepCopy() *GrafanaAgentList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GrafanaAgentList.

func (*GrafanaAgentList) DeepCopyInto

func (in *GrafanaAgentList) DeepCopyInto(out *GrafanaAgentList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*GrafanaAgentList) DeepCopyObject

func (in *GrafanaAgentList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type GrafanaAgentSpec

type GrafanaAgentSpec struct {
	// LogLevel controls the log level of the generated pods. Defaults to "info" if not set.
	LogLevel string `json:"logLevel,omitempty"`
	// LogFormat controls the logging format of the generated pods. Defaults to "logfmt" if not set.
	LogFormat string `json:"logFormat,omitempty"`
	// APIServerConfig allows specifying a host and auth methods to access the
	// Kubernetes API server. If left empty, the Agent will assume that it is
	// running inside of the cluster and will discover API servers automatically
	// and use the pod's CA certificate and bearer token file at
	// /var/run/secrets/kubernetes.io/serviceaccount.
	APIServerConfig *prom_v1.APIServerConfig `json:"apiServer,omitempty"`
	// PodMetadata configures Labels and Annotations which are propagated to
	// created Grafana Agent pods.
	PodMetadata *prom_v1.EmbeddedObjectMetadata `json:"podMetadata,omitempty"`
	// Version of Grafana Agent to be deployed.
	Version string `json:"version,omitempty"`
	// Paused prevents actions except for deletion to be performed on the
	// underlying managed objects.
	Paused bool `json:"paused,omitempty"`
	// Image, when specified, overrides the image used to run the Agent. It
	// should be specified along with a tag. Version must still be set to ensure
	// the Grafana Agent Operator knows which version of Grafana Agent is being
	// configured.
	Image *string `json:"image,omitempty"`
	// ImagePullSecrets holds an optional list of references to secrets within
	// the same namespace to use for pulling the Grafana Agent image from
	// registries.
	// More info: https://kubernetes.io/docs/user-guide/images#specifying-imagepullsecrets-on-a-pod
	ImagePullSecrets []v1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
	// Storage spec to specify how storage will be used.
	Storage *prom_v1.StorageSpec `json:"storage,omitempty"`
	// Volumes allows configuration of additional volumes on the output
	// StatefulSet definition. Volumes specified will be appended to other
	// volumes that are generated as a result of StorageSpec objects.
	Volumes []v1.Volume `json:"volumes,omitempty"`
	// VolumeMounts allows configuration of additional VolumeMounts on the output
	// StatefulSet definition. VolumEMounts specified will be appended to other
	// VolumeMounts in the Grafana Agent container that are generated as a result
	// of StorageSpec objects.
	VolumeMounts []v1.VolumeMount `json:"volumeMounts,omitempty"`
	// Resources holds requests and limits for individual pods.
	Resources v1.ResourceRequirements `json:"resources,omitempty"`
	// NodeSelector defines which nodes pods should be scheduling on.
	NodeSelector map[string]string `json:"nodeSelector,omitempty"`
	// ServiceAccountName is the name of the ServiceAccount to use for running Grafana Agent pods.
	ServiceAccountName string `json:"serviceAccountName,omitempty"`
	// Secrets is a list of secrets in the same namespace as the GrafanaAgent
	// object which will be mounted into each running Grafana Agent pod.
	// The secrets are mounted into /etc/grafana-agent/extra-secrets/<secret-name>.
	Secrets []string `json:"secrets,omitempty"`
	// ConfigMaps is a liset of config maps in the same namespace as the
	// GrafanaAgent object which will be mounted into each running Grafana Agent
	// pod.
	// The ConfigMaps are mounted into /etc/grafana-agent/extra-configmaps/<configmap-name>.
	ConfigMaps []string `json:"configMaps,omitempty"`
	// Affinity, if specified, controls pod scheduling constraints.
	Affinity *v1.Affinity `json:"affinity,omitempty"`
	// Tolerations, if specified, controls the pod's tolerations.
	Tolerations []v1.Toleration `json:"tolerations,omitempty"`
	// TopologySpreadConstraints, if specified, controls the pod's topology spread constraints.
	TopologySpreadConstraints []v1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"`
	// SecurityContext holds pod-level security attributes and common container
	// settings. When unspecified, defaults to the default PodSecurityContext.
	SecurityContext *v1.PodSecurityContext `json:"securityContext,omitempty"`
	// Containers allows injecting additional containers or modifying operator
	// generated containers. This can be used to allow adding an authentication
	// proxy to a Grafana Agent pod or to change the behavior of an
	// operator-generated container. Containers described here modify an operator
	// generated container if they share the same name and modifications are done
	// via a strategic merge patch. The current container names are:
	// `grafana-agent` and `config-reloader`. Overriding containers is entirely
	// outside the scope of what the Grafana Agent team will support and by doing
	// so, you accept that this behavior may break at any time without notice.
	Containers []v1.Container `json:"containers,omitempty"`
	// InitContainers allows adding initContainers to the pod definition. These
	// can be used to, for example, fetch secrets for injection into the Grafana
	// Agent configuration from external sources. Any errors during the execution
	// of an initContainer will lead to a restart of the pod.
	// More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/
	// Using initContainers for any use case other than secret fetching is
	// entirely outside the scope of what the Grafana Agent maintainers will
	// support and by doing so, you accept that this behavior may break at any
	// time without notice.
	InitContainers []v1.Container `json:"initContainers,omitempty"`
	// PriorityClassName is the priority class assigned to pods.
	PriorityClassName string `json:"priorityClassName,omitempty"`
	// Port name used for the pods and governing service. This defaults to agent-metrics.
	PortName string `json:"portName,omitempty"`

	// Metrics controls the metrics subsystem of the Agent and settings
	// unique to metrics-specific pods that are deployed.
	Metrics MetricsSubsystemSpec `json:"metrics,omitempty"`

	// Logs controls the logging subsystem of the Agent and settings unique to
	// logging-specific pods that are deployed.
	Logs LogsSubsystemSpec `json:"logs,omitempty"`

	// enableConfigReadAPI enables the read API for viewing currently running
	// config port 8080 on the agent.
	// +kubebuilder:default=false
	EnableConfigReadAPI bool `json:"enableConfigReadAPI,omitempty"`
}

GrafanaAgentSpec is a specification of the desired behavior of the Grafana Agent cluster.

func (*GrafanaAgentSpec) DeepCopy

func (in *GrafanaAgentSpec) DeepCopy() *GrafanaAgentSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GrafanaAgentSpec.

func (*GrafanaAgentSpec) DeepCopyInto

func (in *GrafanaAgentSpec) DeepCopyInto(out *GrafanaAgentSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type JSONStageSpec added in v0.19.0

type JSONStageSpec struct {
	// Name from the extracted data to parse as JSON. If empty, uses entire log
	// message.
	Source string `json:"source,omitempty"`

	// Set of the key/value pairs of JMESPath expressions. The key will be the
	// key in the extracted data while the expression will be the value,
	// evaluated as a JMESPath from the source data.
	//
	// Literal JMESPath exprssions can be done by wrapping a key in double
	// quotes, which then must be wrapped again in single quotes in YAML
	// so they get passed to the JMESPath parser.
	Expressions map[string]string `json:"expressions,omitempty"`
}

JSONStageSpec is a parsing stage that reads the log line as JSON and accepts JMESPath expressions to extract data.

func (*JSONStageSpec) DeepCopy added in v0.19.0

func (in *JSONStageSpec) DeepCopy() *JSONStageSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JSONStageSpec.

func (*JSONStageSpec) DeepCopyInto added in v0.19.0

func (in *JSONStageSpec) DeepCopyInto(out *JSONStageSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LogsBackoffConfigSpec added in v0.19.0

type LogsBackoffConfigSpec struct {
	// Initial backoff time between retries. Time between retries is
	// increased exponentially.
	MinPeriod string `json:"minPeriod,omitempty"`
	// Maximum backoff time between retries.
	MaxPeriod string `json:"maxPeriod,omitempty"`
	// Maximum number of retries to perform before giving up a request.
	MaxRetries int `json:"maxRetries,omitempty"`
}

LogsBackoffConfigSpec configures timing for retrying failed requests.

func (*LogsBackoffConfigSpec) DeepCopy added in v0.19.0

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LogsBackoffConfigSpec.

func (*LogsBackoffConfigSpec) DeepCopyInto added in v0.19.0

func (in *LogsBackoffConfigSpec) DeepCopyInto(out *LogsBackoffConfigSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LogsClientSpec added in v0.19.0

type LogsClientSpec struct {
	// URL is the URL where Loki is listening. Must be a full HTTP URL, including
	// protocol. Required.
	// Example: https://logs-prod-us-central1.grafana.net/loki/api/v1/push.
	URL string `json:"url"`
	// Tenant ID used by default to push logs to Loki. If omitted assumes remote
	// Loki is running in single-tenant mode or an authentication layer is used
	// to inject an X-Scope-OrgID header.
	TenantID string `json:"tenantId,omitempty"`
	// Maximum amount of time to wait before sending a batch, even if that batch
	// isn't full.
	BatchWait string `json:"batchWait,omitempty"`
	// Maximum batch size (in bytes) of logs to accumulate before sending the
	// batch to Loki.
	BatchSize int `json:"batchSize,omitempty"`
	// BasicAuth for the Loki server.
	BasicAuth *prom_v1.BasicAuth `json:"basicAuth,omitempty"`
	// BearerToken used for remote_write.
	BearerToken string `json:"bearerToken,omitempty"`
	// BearerTokenFile used to read bearer token.
	BearerTokenFile string `json:"bearerTokenFile,omitempty"`
	// ProxyURL to proxy requests through. Optional.
	ProxyURL string `json:"proxyUrl,omitempty"`
	// TLSConfig to use for the client. Only used when the protocol of the URL
	// is https.
	TLSConfig *prom_v1.TLSConfig `json:"tlsConfig,omitempty"`
	// Configures how to retry requests to Loki when a request fails.
	// Defaults to a minPeriod of 500ms, maxPeriod of 5m, and maxRetries of 10.
	BackoffConfig *LogsBackoffConfigSpec `json:"backoffConfig,omitempty"`
	// ExternalLabels are labels to add to any time series when sending data to
	// Loki.
	ExternalLabels map[string]string `json:"externalLabels,omitempty"`
	// Maximum time to wait for a server to respond to a request.
	Timeout string `json:"timeout,omitempty"`
}

LogsClientSpec defines the client integration for logs, indicating which Loki server to send logs to.

func (*LogsClientSpec) DeepCopy added in v0.19.0

func (in *LogsClientSpec) DeepCopy() *LogsClientSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LogsClientSpec.

func (*LogsClientSpec) DeepCopyInto added in v0.19.0

func (in *LogsClientSpec) DeepCopyInto(out *LogsClientSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LogsInstance added in v0.19.0

type LogsInstance struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// Spec holds the specification of the desired behavior for the logs
	// instance.
	Spec LogsInstanceSpec `json:"spec,omitempty"`
}

LogsInstance controls an individual logs instance within a Grafana Agent deployment.

func (*LogsInstance) DeepCopy added in v0.19.0

func (in *LogsInstance) DeepCopy() *LogsInstance

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LogsInstance.

func (*LogsInstance) DeepCopyInto added in v0.19.0

func (in *LogsInstance) DeepCopyInto(out *LogsInstance)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*LogsInstance) DeepCopyObject added in v0.19.0

func (in *LogsInstance) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*LogsInstance) PodLogsSelector added in v0.22.9

func (i *LogsInstance) PodLogsSelector() ObjectSelector

PodLogsSelector returns the selector to discover PodLogs.

type LogsInstanceList added in v0.19.0

type LogsInstanceList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	// Items is the list of LogsInstance.
	Items []*LogsInstance `json:"items"`
}

LogsInstanceList is a list of LogsInstance.

func (*LogsInstanceList) DeepCopy added in v0.19.0

func (in *LogsInstanceList) DeepCopy() *LogsInstanceList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LogsInstanceList.

func (*LogsInstanceList) DeepCopyInto added in v0.19.0

func (in *LogsInstanceList) DeepCopyInto(out *LogsInstanceList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*LogsInstanceList) DeepCopyObject added in v0.19.0

func (in *LogsInstanceList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type LogsInstanceSpec added in v0.19.0

type LogsInstanceSpec struct {
	// Clients controls where logs are written to for this instance.
	Clients []LogsClientSpec `json:"clients,omitempty"`

	// Determines which PodLogs should be selected for including in this
	// instance.
	PodLogsSelector *metav1.LabelSelector `json:"podLogsSelector,omitempty"`
	// Set of labels to determine which namespaces should be watched
	// for PodLogs. If not provided, checks only namespace of the
	// instance.
	PodLogsNamespaceSelector *metav1.LabelSelector `json:"podLogsNamespaceSelector,omitempty"`

	// AdditionalScrapeConfigs allows specifying a key of a Secret containing
	// additional Grafana Agent logging scrape configurations. Scrape
	// configurations specified are appended to the configurations generated by
	// the Grafana Agent Operator.
	//
	// Job configurations specified must have the form as specified in the
	// official Promtail documentation:
	//
	// https://grafana.com/docs/loki/latest/clients/promtail/configuration/#scrape_configs
	//
	// As scrape configs are appended, the user is responsible to make sure it is
	// valid. Note that using this feature may expose the possibility to break
	// upgrades of Grafana Agent. It is advised to review both Grafana Agent and
	// Promtail release notes to ensure that no incompatible scrape configs are
	// going to break Grafana Agent after the upgrade.
	AdditionalScrapeConfigs *v1.SecretKeySelector `json:"additionalScrapeConfigs,omitempty"`

	// Configures how tailed targets will be watched.
	TargetConfig *LogsTargetConfigSpec `json:"targetConfig,omitempty"`
}

LogsInstanceSpec controls how an individual instance will be used to discover LogMonitors.

func (*LogsInstanceSpec) DeepCopy added in v0.19.0

func (in *LogsInstanceSpec) DeepCopy() *LogsInstanceSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LogsInstanceSpec.

func (*LogsInstanceSpec) DeepCopyInto added in v0.19.0

func (in *LogsInstanceSpec) DeepCopyInto(out *LogsInstanceSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LogsSubsystemSpec added in v0.19.0

type LogsSubsystemSpec struct {
	// Global set of clients to use when a discovered LogsInstance does not
	// have any clients defined.
	Clients []LogsClientSpec `json:"clients,omitempty"`
	// LogsExternalLabelName is the name of the external label used to
	// denote Grafana Agent cluster. Defaults to "cluster." External label will
	// _not_ be added when value is set to the empty string.
	LogsExternalLabelName *string `json:"logsExternalLabelName,omitempty"`
	// InstanceSelector determines which LogInstances should be selected
	// for running. Each instance runs its own set of Prometheus components,
	// including service discovery, scraping, and remote_write.
	InstanceSelector *metav1.LabelSelector `json:"instanceSelector,omitempty"`
	// InstanceNamespaceSelector are the set of labels to determine which
	// namespaces to watch for LogInstances. If not provided, only checks own
	// namespace.
	InstanceNamespaceSelector *metav1.LabelSelector `json:"instanceNamespaceSelector,omitempty"`

	// IgnoreNamespaceSelectors, if true, will ignore NamespaceSelector settings
	// from the PodLogs configs, and they will only discover endpoints within
	// their current namespace.
	IgnoreNamespaceSelectors bool `json:"ignoreNamespaceSelectors,omitempty"`
	// EnforcedNamespaceLabel enforces adding a namespace label of origin for
	// each metric that is user-created. The label value will always be the
	// namespace of the object that is being created.
	EnforcedNamespaceLabel string `json:"enforcedNamespaceLabel,omitempty"`
}

LogsSubsystemSpec defines global settings to apply across the logging subsystem.

func (*LogsSubsystemSpec) DeepCopy added in v0.19.0

func (in *LogsSubsystemSpec) DeepCopy() *LogsSubsystemSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LogsSubsystemSpec.

func (*LogsSubsystemSpec) DeepCopyInto added in v0.19.0

func (in *LogsSubsystemSpec) DeepCopyInto(out *LogsSubsystemSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LogsTargetConfigSpec added in v0.19.0

type LogsTargetConfigSpec struct {
	// Period to resync directories being watched and files being tailed to discover
	// new ones or stop watching removed ones.
	SyncPeriod string `json:"syncPeriod,omitempty"`
}

LogsTargetConfigSpec configures how tailed targets are watched.

func (*LogsTargetConfigSpec) DeepCopy added in v0.19.0

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LogsTargetConfigSpec.

func (*LogsTargetConfigSpec) DeepCopyInto added in v0.19.0

func (in *LogsTargetConfigSpec) DeepCopyInto(out *LogsTargetConfigSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MatchStageSpec added in v0.19.0

type MatchStageSpec struct {
	// LogQL stream selector and filter expressions. Required.
	Selector string `json:"selector"`

	// Names the pipeline. When defined, creates an additional label
	// in the pipeline_duration_seconds histogram, where the value is
	// concatenated with job_name using an underscore.
	PipelineName string `json:"pipelineName,omitempty"`

	// Determines what action is taken when the selector matches the log line.
	// Can be keep or drop. Defaults to keep. When set to drop, entries will be
	// dropped and no later metrics will be recorded.
	// Stages must be empty when dropping metrics.
	Action string `json:"action,omitempty"`

	// Every time a log line is dropped the metric logentry_dropped_lines_total
	// will be incremented. A "reason" label is added, and can be customized by
	// providing a custom value here. Defaults to "match_stage."
	DropCounterReason string `json:"dropCounterReason,omitempty"`

	// Nested set of pipeline stages to execute when action: keep and the log
	// line matches selector.
	//
	// An example value for stages may be:
	//
	//   stages: |
	//     - json: {}
	//     - labelAllow: [foo, bar]
	//
	// Note that stages is a string because SIG API Machinery does not
	// support recursive types, and so it cannot be validated for correctness. Be
	// careful not to mistype anything.
	Stages string `json:"stages,omitempty"`
}

MatchStageSpec is a filtering stage that conditionally applies a set of stages or drop entries when a log entry matches a configurable LogQL stream selector and filter expressions.

func (*MatchStageSpec) DeepCopy added in v0.19.0

func (in *MatchStageSpec) DeepCopy() *MatchStageSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MatchStageSpec.

func (*MatchStageSpec) DeepCopyInto added in v0.19.0

func (in *MatchStageSpec) DeepCopyInto(out *MatchStageSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MetadataConfig

type MetadataConfig struct {
	// Send enables metric metadata to be sent to remote storage.
	Send bool `json:"send,omitempty"`
	// SendInterval controls how frequently metric metadata is sent to remote storage.
	SendInterval string `json:"sendInterval,omitempty"`
}

MetadataConfig configures the sending of series metadata to remote storage.

func (*MetadataConfig) DeepCopy

func (in *MetadataConfig) DeepCopy() *MetadataConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetadataConfig.

func (*MetadataConfig) DeepCopyInto

func (in *MetadataConfig) DeepCopyInto(out *MetadataConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MetricsInstance added in v0.19.0

type MetricsInstance struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// Spec holds the specification of the desired behavior for the Metrics
	// instance.
	Spec MetricsInstanceSpec `json:"spec,omitempty"`
}

MetricsInstance controls an individual Metrics instance within a Grafana Agent deployment.

func (*MetricsInstance) DeepCopy added in v0.19.0

func (in *MetricsInstance) DeepCopy() *MetricsInstance

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricsInstance.

func (*MetricsInstance) DeepCopyInto added in v0.19.0

func (in *MetricsInstance) DeepCopyInto(out *MetricsInstance)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*MetricsInstance) DeepCopyObject added in v0.19.0

func (in *MetricsInstance) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*MetricsInstance) PodMonitorSelector added in v0.19.0

func (p *MetricsInstance) PodMonitorSelector() ObjectSelector

PodMonitorSelector returns a selector to find PodMonitors.

func (*MetricsInstance) ProbeSelector added in v0.19.0

func (p *MetricsInstance) ProbeSelector() ObjectSelector

ProbeSelector returns a selector to find Probes.

func (*MetricsInstance) ServiceMonitorSelector added in v0.19.0

func (p *MetricsInstance) ServiceMonitorSelector() ObjectSelector

ServiceMonitorSelector returns a selector to find ServiceMonitors.

type MetricsInstanceList added in v0.19.0

type MetricsInstanceList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	// Items is the list of MetricsInstance.
	Items []*MetricsInstance `json:"items"`
}

MetricsInstanceList is a list of MetricsInstance.

func (*MetricsInstanceList) DeepCopy added in v0.19.0

func (in *MetricsInstanceList) DeepCopy() *MetricsInstanceList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricsInstanceList.

func (*MetricsInstanceList) DeepCopyInto added in v0.19.0

func (in *MetricsInstanceList) DeepCopyInto(out *MetricsInstanceList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*MetricsInstanceList) DeepCopyObject added in v0.19.0

func (in *MetricsInstanceList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type MetricsInstanceSpec added in v0.19.0

type MetricsInstanceSpec struct {
	// WALTruncateFrequency specifies how frequently the WAL truncation process
	// should run. Higher values causes the WAL to increase and for old series to
	// stay in the WAL for longer, but reduces the chances of data loss when
	// remote_write is failing for longer than the given frequency.
	WALTruncateFrequency string `json:"walTruncateFrequency,omitempty"`
	// MinWALTime is the minimum amount of time series and samples may exist in
	// the WAL before being considered for deletion.
	MinWALTime string `json:"minWALTime,omitempty"`
	// MaxWALTime is the maximum amount of time series and asmples may exist in
	// the WAL before being forcibly deleted.
	MaxWALTime string `json:"maxWALTime,omitempty"`
	// RemoteFlushDeadline is the deadline for flushing data when an instance
	// shuts down.
	RemoteFlushDeadline string `json:"remoteFlushDeadline,omitempty"`
	// WriteStaleOnShutdown writes staleness markers on shutdown for all series.
	WriteStaleOnShutdown *bool `json:"writeStaleOnShutdown,omitempty"`
	// ServiceMonitorSelector determines which ServiceMonitors should be selected
	// for target discovery.
	ServiceMonitorSelector *metav1.LabelSelector `json:"serviceMonitorSelector,omitempty"`
	// ServiceMonitorNamespaceSelector are the set of labels to determine which
	// namespaces to watch for ServiceMonitor discovery. If nil, only checks own
	// namespace.
	ServiceMonitorNamespaceSelector *metav1.LabelSelector `json:"serviceMonitorNamespaceSelector,omitempty"`
	// PodMonitorSelector determines which PodMonitors should be selected for target
	// discovery. Experimental.
	PodMonitorSelector *metav1.LabelSelector `json:"podMonitorSelector,omitempty"`
	// PodMonitorNamespaceSelector are the set of labels to determine which
	// namespaces to watch for PodMonitor discovery. If nil, only checks own
	// namespace.
	PodMonitorNamespaceSelector *metav1.LabelSelector `json:"podMonitorNamespaceSelector,omitempty"`
	// ProbeSelector determines which Probes should be selected for target
	// discovery.
	ProbeSelector *metav1.LabelSelector `json:"probeSelector,omitempty"`
	// ProbeNamespaceSelector are the set of labels to determine which namespaces
	// to watch for Probe discovery. If nil, only checks own namespace.
	ProbeNamespaceSelector *metav1.LabelSelector `json:"probeNamespaceSelector,omitempty"`
	// RemoteWrite controls remote_write settings for this instance.
	RemoteWrite []RemoteWriteSpec `json:"remoteWrite,omitempty"`
	// AdditionalScrapeConfigs allows specifying a key of a Secret containing
	// additional Grafana Agent Prometheus scrape configurations. SCrape
	// configurations specified are appended to the configurations generated by
	// the Grafana Agent Operator. Job configurations specified must have the
	// form as specified in the official Prometheus documentation:
	// https://prometheus.io/docs/prometheus/latest/configuration/configuration/#scrape_config.
	// As scrape configs are appended, the user is responsible to make sure it is
	// valid. Note that using this feature may expose the possibility to break
	// upgrades of Grafana Agent. It is advised to review both Grafana Agent and
	// Prometheus release notes to ensure that no incompatible scrape configs are
	// going to break Grafana Agent after the upgrade.
	AdditionalScrapeConfigs *v1.SecretKeySelector `json:"additionalScrapeConfigs,omitempty"`
}

MetricsInstanceSpec controls how an individual instance will be used to discover PodMonitors.

func (*MetricsInstanceSpec) DeepCopy added in v0.19.0

func (in *MetricsInstanceSpec) DeepCopy() *MetricsInstanceSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricsInstanceSpec.

func (*MetricsInstanceSpec) DeepCopyInto added in v0.19.0

func (in *MetricsInstanceSpec) DeepCopyInto(out *MetricsInstanceSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MetricsStageSpec added in v0.19.0

type MetricsStageSpec struct {
	// The metric type to create. Must be one of counter, gauge, histogram.
	// Required.
	Type string `json:"type"`

	// Sets the description for the created metric.
	Description string `json:"description,omitempty"`

	// Sets the custom prefix name for the metric. Defaults to "promtail_custom_".
	Prefix string `json:"prefix,omitempty"`

	// Key from the extracted data map to use for the metric. Defaults to the
	// metrics name if not present.
	Source string `json:"source,omitempty"`

	// Label values on metrics are dynamic which can cause exported metrics
	// to go stale. To prevent unbounded cardinality, any metrics not updated
	// within MaxIdleDuration will be removed.
	//
	// Must be greater or equal to 1s. Defaults to 5m.
	MaxIdleDuration string `json:"maxIdleDuration,omitempty"`

	// If true all log lines will be counted without attempting to match the
	// source to the extracted map. Mutually exclusive with value.
	//
	// Only valid for type: counter.
	MatchAll *bool `json:"matchAll,omitempty"`

	// If true all log line bytes will be counted. Can only be set with
	// matchAll: true and action: add.
	//
	// Only valid for type: counter.
	CountEntryBytes *bool `json:"countEntryBytes,omitempty"`

	// Filters down source data and only changes the metric if the targeted
	// value exactly matches the provided string. If not present, all
	// data will match.
	Value string `json:"value,omitempty"`

	// The action to take against the metric. Required.
	//
	// Must be either "inc" or "add" for type: counter or type: histogram.
	// When type: gauge, must be one of "set", "inc", "dec", "add", or "sub".
	//
	// "add", "set", or "sub" requires the extracted value to be convertible
	// to a positive float.
	Action string `json:"action"`

	// Buckets to create. Bucket values must be convertible to float64s. Extremely
	// large or small numbers are subject to some loss of precision.
	// Only valid for type: histogram.
	Buckets []string `json:"buckets,omitempty"`
}

MetricsStageSpec is an action stage that allows for defining and updating metrics based on data from the extracted map. Created metrics are not pushed to Loki or Prometheus and are instead exposed via the /metrics endpoint of the Grafana Agent pod. The Grafana Agent Operator should be configured with a MetricsInstance that discovers the logging DaemonSet to collect metrics created by this stage.

func (*MetricsStageSpec) DeepCopy added in v0.19.0

func (in *MetricsStageSpec) DeepCopy() *MetricsStageSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricsStageSpec.

func (*MetricsStageSpec) DeepCopyInto added in v0.19.0

func (in *MetricsStageSpec) DeepCopyInto(out *MetricsStageSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MetricsSubsystemSpec added in v0.19.0

type MetricsSubsystemSpec struct {
	// RemoteWrite controls default remote_write settings for all instances. If
	// an instance does not provide its own remoteWrite settings, these will be
	// used instead.
	RemoteWrite []RemoteWriteSpec `json:"remoteWrite,omitempty"`
	// Replicas of each shard to deploy for metrics pods. Number of replicas
	// multiplied by the number of shards is the total number of pods created.
	Replicas *int32 `json:"replicas,omitempty"`
	// Shards to distribute targets onto. Number of replicas multiplied by the
	// number of shards is the total number of pods created. Note that scaling
	// down shards will not reshard data onto remaining instances, it must be
	// manually moved. Increasing shards will not reshard data either but it will
	// continue to be available from the same instances. Sharding is performed on
	// the content of the __address__ target meta-label.
	Shards *int32 `json:"shards,omitempty"`
	// ReplicaExternalLabelName is the name of the metrics external label used
	// to denote replica name. Defaults to __replica__. External label will _not_
	// be added when value is set to the empty string.
	ReplicaExternalLabelName *string `json:"replicaExternalLabelName,omitempty"`
	// MetricsExternalLabelName is the name of the external label used to
	// denote Grafana Agent cluster. Defaults to "cluster." External label will
	// _not_ be added when value is set to the empty string.
	MetricsExternalLabelName *string `json:"metricsExternalLabelName,omitempty"`
	// ScrapeInterval is the time between consecutive scrapes.
	ScrapeInterval string `json:"scrapeInterval,omitempty"`
	// ScrapeTimeout is the time to wait for a target to respond before marking a
	// scrape as failed.
	ScrapeTimeout string `json:"scrapeTimeout,omitempty"`
	// ExternalLabels are labels to add to any time series when sending data over
	// remote_write.
	ExternalLabels map[string]string `json:"externalLabels,omitempty"`
	// ArbitraryFSAccessThroughSMs configures whether configuration based on a
	// ServiceMonitor can access arbitrary files on the file system of the
	// Grafana Agent container e.g. bearer token files.
	ArbitraryFSAccessThroughSMs prom_v1.ArbitraryFSAccessThroughSMsConfig `json:"arbitraryFSAccessThroughSMs,omitempty"`
	// OverrideHonorLabels, if true, overrides all configured honor_labels read
	// from ServiceMonitor or PodMonitor to false.
	OverrideHonorLabels bool `json:"overrideHonorLabels,omitempty"`
	// OverrideHonorTimestamps allows to globally enforce honoring timestamps in all scrape configs.
	OverrideHonorTimestamps bool `json:"overrideHonorTimestamps,omitempty"`
	// IgnoreNamespaceSelectors, if true, will ignore NamespaceSelector settings
	// from the PodMonitor and ServiceMonitor configs, and they will only
	// discover endpoints within their current namespace.
	IgnoreNamespaceSelectors bool `json:"ignoreNamespaceSelectors,omitempty"`
	// EnforcedNamespaceLabel enforces adding a namespace label of origin for
	// each metric that is user-created. The label value will always be the
	// namespace of the object that is being created.
	EnforcedNamespaceLabel string `json:"enforcedNamespaceLabel,omitempty"`
	// EnforcedSampleLimit defines global limit on the number of scraped samples
	// that will be accepted. This overrides any SampleLimit set per
	// ServiceMonitor and/or PodMonitor. It is meant to be used by admins to
	// enforce the SampleLimit to keep the overall number of samples and series
	// under the desired limit. Note that if a SampleLimit from a ServiceMonitor
	// or PodMonitor is lower, that value will be used instead.
	EnforcedSampleLimit *uint64 `json:"enforcedSampleLimit,omitempty"`
	// EnforcedTargetLimit defines a global limit on the number of scraped
	// targets. This overrides any TargetLimit set per ServiceMonitor and/or
	// PodMonitor. It is meant to be used by admins to enforce the TargetLimit to
	// keep the overall number of targets under the desired limit. Note that if a
	// TargetLimit from a ServiceMonitor or PodMonitor is higher, that value will
	// be used instead.
	EnforcedTargetLimit *uint64 `json:"enforcedTargetLimit,omitempty"`

	// InstanceSelector determines which MetricsInstances should be selected
	// for running. Each instance runs its own set of Metrics components,
	// including service discovery, scraping, and remote_write.
	InstanceSelector *metav1.LabelSelector `json:"instanceSelector,omitempty"`
	// InstanceNamespaceSelector are the set of labels to determine which
	// namespaces to watch for MetricsInstances. If not provided, only checks own namespace.
	InstanceNamespaceSelector *metav1.LabelSelector `json:"instanceNamespaceSelector,omitempty"`
}

MetricsSubsystemSpec defines global settings to apply across the Metrics subsystem.

func (*MetricsSubsystemSpec) DeepCopy added in v0.19.0

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricsSubsystemSpec.

func (*MetricsSubsystemSpec) DeepCopyInto added in v0.19.0

func (in *MetricsSubsystemSpec) DeepCopyInto(out *MetricsSubsystemSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MultilineStageSpec added in v0.19.0

type MultilineStageSpec struct {
	// RE2 regular expression. Creates a new multiline block when matched.
	// Required.
	FirstLine string `json:"firstLine"`

	// Maximum time to wait before passing on the multiline block to the next
	// stage if no new lines are received. Defaults to 3s.
	MaxWaitTime string `json:"maxWaitTime,omitempty"`

	// Maximum number of lines a block can have. A new block is started if
	// the number of lines surpasses this value. Defaults to 128.
	MaxLines int `json:"maxLines,omitempty"`
}

MultilineStageSpec merges multiple lines into a multiline block before passing it on to the next stage in the pipeline.

func (*MultilineStageSpec) DeepCopy added in v0.19.0

func (in *MultilineStageSpec) DeepCopy() *MultilineStageSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MultilineStageSpec.

func (*MultilineStageSpec) DeepCopyInto added in v0.19.0

func (in *MultilineStageSpec) DeepCopyInto(out *MultilineStageSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ObjectSelector added in v0.19.0

type ObjectSelector struct {
	ObjectType        client.Object
	ParentNamespace   string
	NamespaceSelector *metav1.LabelSelector
	Labels            *metav1.LabelSelector
}

ObjectSelector is a set of selectors to use for finding an object in the resource hierarchy. When NamespaceSelector is nil, objects should be searched directly in the ParentNamespace.

type OutputStageSpec added in v0.19.0

type OutputStageSpec struct {
	// Name from extract data to use for the log entry. Required.
	Source string `json:"source"`
}

OutputStageSpec is an action stage that takes data from the extracted map and changes the log line that will be sent to Loki.

func (*OutputStageSpec) DeepCopy added in v0.19.0

func (in *OutputStageSpec) DeepCopy() *OutputStageSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OutputStageSpec.

func (*OutputStageSpec) DeepCopyInto added in v0.19.0

func (in *OutputStageSpec) DeepCopyInto(out *OutputStageSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PackStageSpec added in v0.19.0

type PackStageSpec struct {
	// Name from extracted data or line labels. Requiried.
	// Labels provided here are automatically removed from output labels.
	Labels []string `json:"labels"`

	// If the resulting log line should use any existing timestamp or use time.Now()
	// when the line was created. Set to true when combining several log streams from
	// different containers to avoid out of order errors.
	IngestTimestamp bool `json:"ingestTimestamp,omitempty"`
}

PackStageSpec is a transform stage that lets you embed extracted values and labels into the log line by packing the log line and labels inside of a JSON object.

func (*PackStageSpec) DeepCopy added in v0.19.0

func (in *PackStageSpec) DeepCopy() *PackStageSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PackStageSpec.

func (*PackStageSpec) DeepCopyInto added in v0.19.0

func (in *PackStageSpec) DeepCopyInto(out *PackStageSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PipelineStageSpec added in v0.19.0

type PipelineStageSpec struct {
	// CRI is a parsing stage that reads log lines using the standard
	// CRI logging format. Supply cri: {} to enable.
	CRI *CRIStageSpec `json:"cri,omitempty"`
	// Docker is a parsing stage that reads log lines using the standard
	// Docker logging format. Supply docker: {} to enable.
	Docker *DockerStageSpec `json:"docker,omitempty"`
	// Drop is a filtering stage that lets you drop certain logs.
	Drop *DropStageSpec `json:"drop,omitempty"`
	// JSON is a parsing stage that reads the log line as JSON and accepts
	// JMESPath expressions to extract data.
	//
	// Information on JMESPath: http://jmespath.org/
	JSON *JSONStageSpec `json:"json,omitempty"`
	// LabelAllow is an action stage that only allows the provided labels to be
	// included in the label set that is sent to Loki with the log entry.
	LabelAllow []string `json:"labelAllow,omitempty"`
	// LabelDrop is an action stage that drops labels from the label set that
	// is sent to Loki with the log entry.
	LabelDrop []string `json:"labelDrop,omitempty"`
	// Labels is an action stage that takes data from the extracted map and
	// modifies the label set that is sent to Loki with the log entry.
	//
	// The key is REQUIRED and represents the name for the label that will
	// be created. Value is optional and will be the name from extracted data
	// to use for the value of the label. If the value is not provided, it
	// defaults to match the key.
	Labels map[string]string `json:"labels,omitempty"`
	// Match is a filtering stage that conditionally applies a set of stages
	// or drop entries when a log entry matches a configurable LogQL stream
	// selector and filter expressions.
	Match *MatchStageSpec `json:"match,omitempty"`
	// Metrics is an action stage that allows for defining and updating metrics
	// based on data from the extracted map. Created metrics are not pushed to
	// Loki or Prometheus and are instead exposed via the /metrics endpoint of
	// the Grafana Agent pod. The Grafana Agent Operator should be configured
	// with a MetricsInstance that discovers the logging DaemonSet to collect
	// metrics created by this stage.
	Metrics map[string]MetricsStageSpec `json:"metrics,omitempty"`
	// Multiline stage merges multiple lines into a multiline block before
	// passing it on to the next stage in the pipeline.
	Multiline *MultilineStageSpec `json:"multiline,omitempty"`
	// Output stage is an action stage that takes data from the extracted map and
	// changes the log line that will be sent to Loki.
	Output *OutputStageSpec `json:"output,omitempty"`
	// Pack is a transform stage that lets you embed extracted values and labels
	// into the log line by packing the log line and labels inside of a JSON
	// object.
	Pack *PackStageSpec `json:"pack,omitempty"`
	// Regex is a parsing stage that parses a log line using a regular
	// expression.  Named capture groups in the regex allows for adding data into
	// the extracted map.
	Regex *RegexStageSpec `json:"regex,omitempty"`
	// Replace is a parsing stage that parses a log line using a regular
	// expression and replaces the log line. Named capture groups in the regex
	// allows for adding data into the extracted map.
	Replace *ReplaceStageSpec `json:"replace,omitempty"`
	// Template is a transform stage that manipulates the values in the extracted
	// map using Go's template syntax.
	Template *TemplateStageSpec `json:"template,omitempty"`
	// Tenant is an action stage that sets the tenant ID for the log entry picking it from a
	// field in the extracted data map. If the field is missing, the default
	// LogsClientSpec.tenantId will be used.
	Tenant *TenantStageSpec `json:"tenant,omitempty"`
	// Timestamp is an action stage that can change the timestamp of a log line
	// before it is sent to Loki. If not present, the timestamp of a log line
	// defaults to the time when the log line was read.
	Timestamp *TimestampStageSpec `json:"timestamp,omitempty"`
}

PipelineStageSpec defines an individual pipeline stage. Each stage type is mutually exclusive and no more than one may be set per stage.

More information on pipelines can be found in the Promtail documentation: https://grafana.com/docs/loki/latest/clients/promtail/pipelines/

func (*PipelineStageSpec) DeepCopy added in v0.19.0

func (in *PipelineStageSpec) DeepCopy() *PipelineStageSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineStageSpec.

func (*PipelineStageSpec) DeepCopyInto added in v0.19.0

func (in *PipelineStageSpec) DeepCopyInto(out *PipelineStageSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PodLogs added in v0.19.0

type PodLogs struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// Spec holds the specification of the desired behavior for the PodLogs.
	Spec PodLogsSpec `json:"spec,omitempty"`
}

PodLogs defines how to collect logs for a pod.

func (*PodLogs) DeepCopy added in v0.19.0

func (in *PodLogs) DeepCopy() *PodLogs

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodLogs.

func (*PodLogs) DeepCopyInto added in v0.19.0

func (in *PodLogs) DeepCopyInto(out *PodLogs)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*PodLogs) DeepCopyObject added in v0.19.0

func (in *PodLogs) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type PodLogsList added in v0.19.0

type PodLogsList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	// Items is the list of PodLogs.
	Items []*PodLogs `json:"items"`
}

PodLogsList is a list of PodLogs.

func (*PodLogsList) DeepCopy added in v0.19.0

func (in *PodLogsList) DeepCopy() *PodLogsList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodLogsList.

func (*PodLogsList) DeepCopyInto added in v0.19.0

func (in *PodLogsList) DeepCopyInto(out *PodLogsList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*PodLogsList) DeepCopyObject added in v0.19.0

func (in *PodLogsList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type PodLogsSpec added in v0.19.0

type PodLogsSpec struct {
	// The label to use to retrieve the job name from.
	JobLabel string `json:"jobLabel,omitempty"`
	// PodTargetLabels transfers labels on the Kubernetes Pod onto the target.
	PodTargetLabels []string `json:"podTargetLabels,omitempty"`
	// Selector to select Pod objects. Required.
	Selector metav1.LabelSelector `json:"selector"`
	// Selector to select which namespaces the Pod objects are discovered from.
	NamespaceSelector prom_v1.NamespaceSelector `json:"namespaceSelector,omitempty"`

	// Pipeline stages for this pod. Pipeline stages allow for transforming and
	// filtering log lines.
	PipelineStages []*PipelineStageSpec `json:"pipelineStages,omitempty"`

	// RelabelConfigs to apply to logs before delivering.
	// Grafana Agent Operator automatically adds relabelings for a few standard
	// Kubernetes fields and replaces original scrape job name with
	// __tmp_logs_job_name.
	//
	// More info: https://grafana.com/docs/loki/latest/clients/promtail/configuration/#relabel_configs
	RelabelConfigs []*prom_v1.RelabelConfig `json:"relabelings,omitempty"`
}

PodLogsSpec defines how to collect logs for a pod.

func (*PodLogsSpec) DeepCopy added in v0.19.0

func (in *PodLogsSpec) DeepCopy() *PodLogsSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodLogsSpec.

func (*PodLogsSpec) DeepCopyInto added in v0.19.0

func (in *PodLogsSpec) DeepCopyInto(out *PodLogsSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type QueueConfig

type QueueConfig struct {
	// Capacity is the number of samples to buffer per shard before we start dropping them.
	Capacity int `json:"capacity,omitempty"`
	// MinShards is the minimum number of shards, i.e. amount of concurrency.
	MinShards int `json:"minShards,omitempty"`
	// MaxShards is the maximum number of shards, i.e. amount of concurrency.
	MaxShards int `json:"maxShards,omitempty"`
	// MaxSamplesPerSend is the maximum number of samples per send.
	MaxSamplesPerSend int `json:"maxSamplesPerSend,omitempty"`
	// BatchSendDeadline is the maximum time a sample will wait in buffer.
	BatchSendDeadline string `json:"batchSendDeadline,omitempty"`
	// MaxRetries is the maximum number of times to retry a batch on recoverable errors.
	MaxRetries int `json:"maxRetries,omitempty"`
	// MinBackoff is the initial retry delay. Gets doubled for every retry.
	MinBackoff string `json:"minBackoff,omitempty"`
	// MaxBackoff is the maximum retry delay.
	MaxBackoff string `json:"maxBackoff,omitempty"`
	// RetryOnRateLimit retries requests when encountering rate limits.
	RetryOnRateLimit bool `json:"retryOnRateLimit,omitempty"`
}

QueueConfig allows the tuning of remote_write queue_config parameters.

func (*QueueConfig) DeepCopy

func (in *QueueConfig) DeepCopy() *QueueConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QueueConfig.

func (*QueueConfig) DeepCopyInto

func (in *QueueConfig) DeepCopyInto(out *QueueConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RegexStageSpec added in v0.19.0

type RegexStageSpec struct {
	// Name from extracted data to parse. If empty, defaults to using the log
	// message.
	Source string `json:"source,omitempty"`

	// RE2 regular expression. Each capture group MUST be named. Required.
	Expression string `json:"expression"`
}

RegexStageSpec is a parsing stage that parses a log line using a regular expression. Named capture groups in the regex allows for adding data into the extracted map.

func (*RegexStageSpec) DeepCopy added in v0.19.0

func (in *RegexStageSpec) DeepCopy() *RegexStageSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RegexStageSpec.

func (*RegexStageSpec) DeepCopyInto added in v0.19.0

func (in *RegexStageSpec) DeepCopyInto(out *RegexStageSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RemoteWriteSpec

type RemoteWriteSpec struct {
	// Name of the remote_write queue. Must be unique if specified. The name is
	// used in metrics and logging in order to differentiate queues.
	Name string `json:"name,omitempty"`
	// URL of the endpoint to send samples to.
	URL string `json:"url"`
	// RemoteTimeout is the timeout for requests to the remote_write endpoint.
	RemoteTimeout string `json:"remoteTimeout,omitempty"`
	// Headers is a set of custom HTTP headers to be sent along with each
	// remote_write request. Be aware that any headers set by Grafana Agent
	// itself can't be overwritten.
	Headers map[string]string `json:"headers,omitempty"`
	// WriteRelabelConfigs holds relabel_configs to relabel samples before they are
	// sent to the remote_write endpoint.
	WriteRelabelConfigs []prom_v1.RelabelConfig `json:"writeRelabelConfigs,omitempty"`
	// BasicAuth for the URL.
	BasicAuth *prom_v1.BasicAuth `json:"basicAuth,omitempty"`
	// BearerToken used for remote_write.
	BearerToken string `json:"bearerToken,omitempty"`
	// BearerTokenFile used to read bearer token.
	BearerTokenFile string `json:"bearerTokenFile,omitempty"`
	// SigV4 configures SigV4-based authentication to the remote_write endpoint.
	// Will be used if SigV4 is defined, even with an empty object.
	SigV4 *SigV4Config `json:"sigv4,omitempty"`
	// TLSConfig to use for remote_write.
	TLSConfig *prom_v1.TLSConfig `json:"tlsConfig,omitempty"`
	// ProxyURL to proxy requests through. Optional.
	ProxyURL string `json:"proxyUrl,omitempty"`
	// QueueConfig allows tuning of the remote_write queue parameters.
	QueueConfig *QueueConfig `json:"queueConfig,omitempty"`
	// MetadataConfig configures the sending of series metadata to remote storage.
	MetadataConfig *MetadataConfig `json:"metadataConfig,omitempty"`
}

RemoteWriteSpec defines the remote_write configuration for Prometheus.

func (*RemoteWriteSpec) DeepCopy

func (in *RemoteWriteSpec) DeepCopy() *RemoteWriteSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RemoteWriteSpec.

func (*RemoteWriteSpec) DeepCopyInto

func (in *RemoteWriteSpec) DeepCopyInto(out *RemoteWriteSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ReplaceStageSpec added in v0.19.0

type ReplaceStageSpec struct {
	// Name from extracted data to parse. If empty, defaults to using the log
	// message.
	Source string `json:"source,omitempty"`

	// RE2 regular expression. Each capture group MUST be named. Required.
	Expression string `json:"expression"`

	// Value to replace the captured group with.
	Replace string `json:"replace,omitempty"`
}

ReplaceStageSpec is a parsing stage that parses a log line using a regular expression and replaces the log line. Named capture groups in the regex allows for adding data into the extracted map.

func (*ReplaceStageSpec) DeepCopy added in v0.19.0

func (in *ReplaceStageSpec) DeepCopy() *ReplaceStageSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReplaceStageSpec.

func (*ReplaceStageSpec) DeepCopyInto added in v0.19.0

func (in *ReplaceStageSpec) DeepCopyInto(out *ReplaceStageSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SigV4Config

type SigV4Config struct {
	// Region of the AWS endpoint. If blank, the region from the default
	// credentials chain is used.
	Region string `json:"region,omitempty"`
	// AccessKey holds the secret of the AWS API access key to use for signing.
	// If not provided, The environment variable AWS_ACCESS_KEY_ID is used.
	AccessKey *v1.SecretKeySelector `json:"accessKey,omitempty"`
	// SecretKey of the AWS API to use for signing. If blank, the environment
	// variable AWS_SECRET_ACCESS_KEY is used.
	SecretKey *v1.SecretKeySelector `json:"secretKey,omitempty"`
	// Profile is the named AWS profile to use for authentication.
	Profile string `json:"profile,omitempty"`
	// RoleARN is the AWS Role ARN to use for authentication, as an alternative
	// for using the AWS API keys.
	RoleARN string `json:"roleARN,omitempty"`
}

SigV4Config specifies configuration to perform SigV4 authentication.

func (*SigV4Config) DeepCopy

func (in *SigV4Config) DeepCopy() *SigV4Config

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SigV4Config.

func (*SigV4Config) DeepCopyInto

func (in *SigV4Config) DeepCopyInto(out *SigV4Config)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TemplateStageSpec added in v0.19.0

type TemplateStageSpec struct {
	// Name from extracted data to parse. Required. If empty, defaults to using
	// the log message.
	Source string `json:"source"`

	// Go template string to use. Required. In additional to normal template
	// functions, ToLower, ToUpper, Replace, Trim, TrimLeft, TrimRight,
	// TrimPrefix, and TrimSpace are also available.
	Template string `json:"template"`
}

TemplateStageSpec is a transform stage that manipulates the values in the extracted map using Go's template syntax.

func (*TemplateStageSpec) DeepCopy added in v0.19.0

func (in *TemplateStageSpec) DeepCopy() *TemplateStageSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TemplateStageSpec.

func (*TemplateStageSpec) DeepCopyInto added in v0.19.0

func (in *TemplateStageSpec) DeepCopyInto(out *TemplateStageSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TenantStageSpec added in v0.19.0

type TenantStageSpec struct {
	// Name from extracted data to use as the tenant ID. Mutually exclusive with
	// value.
	Source string `json:"source,omitempty"`

	// Value to use for the template ID. Useful when this stage is used within a
	// conditional pipeline such as match. Mutually exclusive with source.
	Value string `json:"value,omitempty"`
}

TenantStageSpec is an action stage that sets the tenant ID for the log entry picking it from a field in the extracted data map.

func (*TenantStageSpec) DeepCopy added in v0.19.0

func (in *TenantStageSpec) DeepCopy() *TenantStageSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TenantStageSpec.

func (*TenantStageSpec) DeepCopyInto added in v0.19.0

func (in *TenantStageSpec) DeepCopyInto(out *TenantStageSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TimestampStageSpec added in v0.19.0

type TimestampStageSpec struct {
	// Name from extracted data to use as the timestamp. Required.
	Source string `json:"source"`

	// Determines format of the time string. Required. Can be one of:
	// ANSIC, UnixDate, RubyDate, RFC822, RFC822Z, RFC850, RFC1123, RFC1123Z,
	// RFC3339, RFC3339Nano, Unix, UnixMs, UnixUs, UnixNs.
	Format string `json:"format"`

	// Fallback formats to try if format fails.
	FallbackFormats []string `json:"fallbackFormats,omitempty"`

	// IANA Timezone Database string.
	Location string `json:"location,omitempty"`

	// Action to take when the timestamp can't be extracted or parsed.
	// Can be skip or fudge. Defaults to fudge.
	ActionOnFailure string `json:"actionOnFailure,omitempty"`
}

TimestampStageSpec is an action stage that can change the timestamp of a log line before it is sent to Loki.

func (*TimestampStageSpec) DeepCopy added in v0.19.0

func (in *TimestampStageSpec) DeepCopy() *TimestampStageSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TimestampStageSpec.

func (*TimestampStageSpec) DeepCopyInto added in v0.19.0

func (in *TimestampStageSpec) DeepCopyInto(out *TimestampStageSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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