Grafana Agent OperatorCustom Resource Definition Reference

Custom Resource Definition Reference

Packages:

monitoring.grafana.com/v1alpha1

Resource Types:

Deployment

Deployment is a set of discovered resources relative to a GrafanaAgent. The tree of resources contained in a Deployment form the resource hierarchy used for reconciling a GrafanaAgent.

FieldDescription
apiVersion
string
monitoring.grafana.com/v1alpha1
kind
string
Deployment
Agent
GrafanaAgent

Root resource in the deployment.

Metrics
[]MetricsDeployment

Metrics resources discovered by Agent.

Logs
[]LogsDeployment

Logs resources discovered by Agent.

Integrations
[]IntegrationsDeployment

Integrations resources discovered by Agent.

Secrets
github.com/grafana/agent/pkg/operator/assets.SecretStore

The full list of Secrets referenced by resources in the Deployment.

GrafanaAgent

(Appears on: Deployment)

GrafanaAgent defines a Grafana Agent deployment.

FieldDescription
apiVersion
string
monitoring.grafana.com/v1alpha1
kind
string
GrafanaAgent
metadata
Kubernetes meta/v1.ObjectMeta
Refer to the Kubernetes API documentation for the fields of the metadata field.
spec
GrafanaAgentSpec

Spec holds the specification of the desired behavior for the Grafana Agent cluster.



logLevel
string

LogLevel controls the log level of the generated pods. Defaults to “info” if not set.

logFormat
string

LogFormat controls the logging format of the generated pods. Defaults to “logfmt” if not set.

apiServer
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1.APIServerConfig

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.

podMetadata
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1.EmbeddedObjectMetadata

PodMetadata configures Labels and Annotations which are propagated to created Grafana Agent pods.

version
string

Version of Grafana Agent to be deployed.

paused
bool

Paused prevents actions except for deletion to be performed on the underlying managed objects.

image
string

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.

imagePullSecrets
[]Kubernetes core/v1.LocalObjectReference

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

storage
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1.StorageSpec

Storage spec to specify how storage will be used.

volumes
[]Kubernetes core/v1.Volume

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.

volumeMounts
[]Kubernetes core/v1.VolumeMount

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.

resources
Kubernetes core/v1.ResourceRequirements

Resources holds requests and limits for individual pods.

nodeSelector
map[string]string

NodeSelector defines which nodes pods should be scheduling on.

serviceAccountName
string

ServiceAccountName is the name of the ServiceAccount to use for running Grafana Agent pods.

secrets
[]string

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/.

configMaps
[]string

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/.

affinity
Kubernetes core/v1.Affinity

Affinity, if specified, controls pod scheduling constraints.

tolerations
[]Kubernetes core/v1.Toleration

Tolerations, if specified, controls the pod’s tolerations.

topologySpreadConstraints
[]Kubernetes core/v1.TopologySpreadConstraint

TopologySpreadConstraints, if specified, controls the pod’s topology spread constraints.

securityContext
Kubernetes core/v1.PodSecurityContext

SecurityContext holds pod-level security attributes and common container settings. When unspecified, defaults to the default PodSecurityContext.

containers
[]Kubernetes core/v1.Container

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.

initContainers
[]Kubernetes core/v1.Container

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.

priorityClassName
string

PriorityClassName is the priority class assigned to pods.

portName
string

Port name used for the pods and governing service. This defaults to agent-metrics.

metrics
MetricsSubsystemSpec

Metrics controls the metrics subsystem of the Agent and settings unique to metrics-specific pods that are deployed.

logs
LogsSubsystemSpec

Logs controls the logging subsystem of the Agent and settings unique to logging-specific pods that are deployed.

integrations
IntegrationsSubsystemSpec

Integrations controls the integration subsystem of the Agent and settings unique to integration-specific pods that are deployed.

enableConfigReadAPI
bool

enableConfigReadAPI enables the read API for viewing currently running config port 8080 on the agent.

disableReporting
bool

disableReporting disable reporting of enabled feature flags to Grafana.

disableSupportBundle
bool

disableSupportBundle disables the generation of support bundles.

IntegrationsDeployment

(Appears on: Deployment)

IntegrationsDeployment is a set of discovered resources relative to an IntegrationsDeployment.

FieldDescription
apiVersion
string
monitoring.grafana.com/v1alpha1
kind
string
IntegrationsDeployment
Instance
Integration

LogsDeployment

(Appears on: Deployment)

LogsDeployment is a set of discovered resources relative to a LogsInstance.

FieldDescription
apiVersion
string
monitoring.grafana.com/v1alpha1
kind
string
LogsDeployment
Instance
LogsInstance
PodLogs
[]PodLogs

MetricsDeployment

(Appears on: Deployment)

MetricsDeployment is a set of discovered resources relative to a MetricsInstance.

FieldDescription
apiVersion
string
monitoring.grafana.com/v1alpha1
kind
string
MetricsDeployment
Instance
MetricsInstance
ServiceMonitors
[]github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1.ServiceMonitor
PodMonitors
[]github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1.PodMonitor
Probes
[]github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1.Probe

CRIStageSpec

(Appears on: PipelineStageSpec)

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

DockerStageSpec

(Appears on: PipelineStageSpec)

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

DropStageSpec

(Appears on: PipelineStageSpec)

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

FieldDescription
source
string

Name from the extract data to parse. If empty, uses the log message.

expression
string

RE2 regular expression.

If source is provided, the regex attempts to match the source.

If no source is provided, then the regex attempts to attach the log line.

If the provided regex matches the log line or a provided source, the line is dropped.

value
string

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.

olderThan
string

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.

longerThan
string

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).

dropCounterReason
string

Every time a log line is dropped, the metric logentry_dropped_lines_total is incremented. A “reason” label is added, and can be customized by providing a custom value here. Defaults to “drop_stage”.

GrafanaAgentSpec

(Appears on: GrafanaAgent)

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

FieldDescription
logLevel
string

LogLevel controls the log level of the generated pods. Defaults to “info” if not set.

logFormat
string

LogFormat controls the logging format of the generated pods. Defaults to “logfmt” if not set.

apiServer
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1.APIServerConfig

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.

podMetadata
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1.EmbeddedObjectMetadata

PodMetadata configures Labels and Annotations which are propagated to created Grafana Agent pods.

version
string

Version of Grafana Agent to be deployed.

paused
bool

Paused prevents actions except for deletion to be performed on the underlying managed objects.

image
string

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.

imagePullSecrets
[]Kubernetes core/v1.LocalObjectReference

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

storage
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1.StorageSpec

Storage spec to specify how storage will be used.

volumes
[]Kubernetes core/v1.Volume

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.

volumeMounts
[]Kubernetes core/v1.VolumeMount

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.

resources
Kubernetes core/v1.ResourceRequirements

Resources holds requests and limits for individual pods.

nodeSelector
map[string]string

NodeSelector defines which nodes pods should be scheduling on.

serviceAccountName
string

ServiceAccountName is the name of the ServiceAccount to use for running Grafana Agent pods.

secrets
[]string

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/.

configMaps
[]string

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/.

affinity
Kubernetes core/v1.Affinity

Affinity, if specified, controls pod scheduling constraints.

tolerations
[]Kubernetes core/v1.Toleration

Tolerations, if specified, controls the pod’s tolerations.

topologySpreadConstraints
[]Kubernetes core/v1.TopologySpreadConstraint

TopologySpreadConstraints, if specified, controls the pod’s topology spread constraints.

securityContext
Kubernetes core/v1.PodSecurityContext

SecurityContext holds pod-level security attributes and common container settings. When unspecified, defaults to the default PodSecurityContext.

containers
[]Kubernetes core/v1.Container

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.

initContainers
[]Kubernetes core/v1.Container

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.

priorityClassName
string

PriorityClassName is the priority class assigned to pods.

portName
string

Port name used for the pods and governing service. This defaults to agent-metrics.

metrics
MetricsSubsystemSpec

Metrics controls the metrics subsystem of the Agent and settings unique to metrics-specific pods that are deployed.

logs
LogsSubsystemSpec

Logs controls the logging subsystem of the Agent and settings unique to logging-specific pods that are deployed.

integrations
IntegrationsSubsystemSpec

Integrations controls the integration subsystem of the Agent and settings unique to integration-specific pods that are deployed.

enableConfigReadAPI
bool

enableConfigReadAPI enables the read API for viewing currently running config port 8080 on the agent.

disableReporting
bool

disableReporting disable reporting of enabled feature flags to Grafana.

disableSupportBundle
bool

disableSupportBundle disables the generation of support bundles.

Integration

(Appears on: IntegrationsDeployment)

Integration runs a single Grafana Agent integration. Integrations that generate telemetry must be configured to send that telemetry somewhere, such as autoscrape for exporter-based integrations.

Integrations have access to the LogsInstances and MetricsInstances in the same GrafanaAgent resource set, referenced by the / of the Instance resource.

For example, if there is a default/production MetricsInstance, you can configure a supported integration’s autoscrape block with:

autoscrape:
enable: true
metrics_instance: default/production

There is currently no way for telemetry created by an Operator-managed integration to be collected from outside of the integration itself.

FieldDescription
metadata
Kubernetes meta/v1.ObjectMeta
Refer to the Kubernetes API documentation for the fields of the metadata field.
spec
IntegrationSpec

Specifies the desired behavior of the Integration.



name
string

Name of the integration to run (e.g., “node_exporter”, “mysqld_exporter”).

type
IntegrationType

Type informs Grafana Agent Operator about how to manage the integration being configured.

config
k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSON

The configuration for the named integration. Note that Integrations are deployed with the integrations-next feature flag, which has different common settings:

https://grafana.com/docs/agent/latest/configuration/integrations/integrations-next/

volumes
[]Kubernetes core/v1.Volume

An extra list of Volumes to be associated with the Grafana Agent pods running this integration. Volume names are mutated to be unique across all Integrations. Note that the specified volumes should be able to tolerate existing on multiple pods at once when type is daemonset.

Don’t use volumes for loading Secrets or ConfigMaps from the same namespace as the Integration; use the Secrets and ConfigMaps fields instead.

volumeMounts
[]Kubernetes core/v1.VolumeMount

An extra list of VolumeMounts to be associated with the Grafana Agent pods running this integration. VolumeMount names are mutated to be unique across all used IntegrationSpecs.

Mount paths should include the namespace/name of the Integration CR to avoid potentially colliding with other resources.

secrets
[]Kubernetes core/v1.SecretKeySelector

An extra list of keys from Secrets in the same namespace as the Integration which will be mounted into the Grafana Agent pod running this Integration.

Secrets will be mounted at /etc/grafana-agent/integrations/secrets///.

configMaps
[]Kubernetes core/v1.ConfigMapKeySelector

An extra list of keys from ConfigMaps in the same namespace as the Integration which will be mounted into the Grafana Agent pod running this Integration.

ConfigMaps are mounted at /etc/grafana-agent/integrations/configMaps///.

IntegrationSpec

(Appears on: Integration)

IntegrationSpec specifies the desired behavior of a metrics integration.

FieldDescription
name
string

Name of the integration to run (e.g., “node_exporter”, “mysqld_exporter”).

type
IntegrationType

Type informs Grafana Agent Operator about how to manage the integration being configured.

config
k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSON

The configuration for the named integration. Note that Integrations are deployed with the integrations-next feature flag, which has different common settings:

https://grafana.com/docs/agent/latest/configuration/integrations/integrations-next/

volumes
[]Kubernetes core/v1.Volume

An extra list of Volumes to be associated with the Grafana Agent pods running this integration. Volume names are mutated to be unique across all Integrations. Note that the specified volumes should be able to tolerate existing on multiple pods at once when type is daemonset.

Don’t use volumes for loading Secrets or ConfigMaps from the same namespace as the Integration; use the Secrets and ConfigMaps fields instead.

volumeMounts
[]Kubernetes core/v1.VolumeMount

An extra list of VolumeMounts to be associated with the Grafana Agent pods running this integration. VolumeMount names are mutated to be unique across all used IntegrationSpecs.

Mount paths should include the namespace/name of the Integration CR to avoid potentially colliding with other resources.

secrets
[]Kubernetes core/v1.SecretKeySelector

An extra list of keys from Secrets in the same namespace as the Integration which will be mounted into the Grafana Agent pod running this Integration.

Secrets will be mounted at /etc/grafana-agent/integrations/secrets///.

configMaps
[]Kubernetes core/v1.ConfigMapKeySelector

An extra list of keys from ConfigMaps in the same namespace as the Integration which will be mounted into the Grafana Agent pod running this Integration.

ConfigMaps are mounted at /etc/grafana-agent/integrations/configMaps///.

IntegrationType

(Appears on: IntegrationSpec)

IntegrationType determines specific behaviors of a configured integration.

FieldDescription
allNodes
bool

When true, the configured integration should be run on every Node in the cluster. This is required for Integrations that generate Node-specific metrics like node_exporter, otherwise it must be false to avoid generating duplicate metrics.

unique
bool

Whether this integration can only be defined once for a Grafana Agent process, such as statsd_exporter. It is invalid for a GrafanaAgent to discover multiple unique Integrations with the same Integration name (i.e., a single GrafanaAgent cannot deploy two statsd_exporters).

IntegrationsSubsystemSpec

(Appears on: GrafanaAgentSpec)

IntegrationsSubsystemSpec defines global settings to apply across the integrations subsystem.

FieldDescription
selector
Kubernetes meta/v1.LabelSelector

Label selector to find Integration resources to run. When nil, no integration resources will be defined.

namespaceSelector
Kubernetes meta/v1.LabelSelector

Label selector for namespaces to search when discovering integration resources. If nil, integration resources are only discovered in the namespace of the GrafanaAgent resource.

Set to {} to search all namespaces.

JSONStageSpec

(Appears on: PipelineStageSpec)

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

FieldDescription
source
string

Name from the extracted data to parse as JSON. If empty, uses entire log message.

expressions
map[string]string

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 expressions can be used 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.

LogsBackoffConfigSpec

(Appears on: LogsClientSpec)

LogsBackoffConfigSpec configures timing for retrying failed requests.

FieldDescription
minPeriod
string

Initial backoff time between retries. Time between retries is increased exponentially.

maxPeriod
string

Maximum backoff time between retries.

maxRetries
int

Maximum number of retries to perform before giving up a request.

LogsClientSpec

(Appears on: LogsInstanceSpec, LogsSubsystemSpec)

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

FieldDescription
url
string

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.

tenantId
string

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.

batchWait
string

Maximum amount of time to wait before sending a batch, even if that batch isn’t full.

batchSize
int

Maximum batch size (in bytes) of logs to accumulate before sending the batch to Loki.

basicAuth
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1.BasicAuth

BasicAuth for the Loki server.

bearerToken
string

BearerToken used for remote_write.

bearerTokenFile
string

BearerTokenFile used to read bearer token.

proxyUrl
string

ProxyURL to proxy requests through. Optional.

tlsConfig
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1.TLSConfig

TLSConfig to use for the client. Only used when the protocol of the URL is https.

backoffConfig
LogsBackoffConfigSpec

Configures how to retry requests to Loki when a request fails. Defaults to a minPeriod of 500ms, maxPeriod of 5m, and maxRetries of 10.

externalLabels
map[string]string

ExternalLabels are labels to add to any time series when sending data to Loki.

timeout
string

Maximum time to wait for a server to respond to a request.

LogsInstance

(Appears on: LogsDeployment)

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

FieldDescription
metadata
Kubernetes meta/v1.ObjectMeta
Refer to the Kubernetes API documentation for the fields of the metadata field.
spec
LogsInstanceSpec

Spec holds the specification of the desired behavior for the logs instance.



clients
[]LogsClientSpec

Clients controls where logs are written to for this instance.

podLogsSelector
Kubernetes meta/v1.LabelSelector

Determines which PodLogs should be selected for including in this instance.

podLogsNamespaceSelector
Kubernetes meta/v1.LabelSelector

Set of labels to determine which namespaces should be watched for PodLogs. If not provided, checks only namespace of the instance.

additionalScrapeConfigs
Kubernetes core/v1.SecretKeySelector

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.

targetConfig
LogsTargetConfigSpec

Configures how tailed targets are watched.

LogsInstanceSpec

(Appears on: LogsInstance)

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

FieldDescription
clients
[]LogsClientSpec

Clients controls where logs are written to for this instance.

podLogsSelector
Kubernetes meta/v1.LabelSelector

Determines which PodLogs should be selected for including in this instance.

podLogsNamespaceSelector
Kubernetes meta/v1.LabelSelector

Set of labels to determine which namespaces should be watched for PodLogs. If not provided, checks only namespace of the instance.

additionalScrapeConfigs
Kubernetes core/v1.SecretKeySelector

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.

targetConfig
LogsTargetConfigSpec

Configures how tailed targets are watched.

LogsSubsystemSpec

(Appears on: GrafanaAgentSpec)

LogsSubsystemSpec defines global settings to apply across the logging subsystem.

FieldDescription
clients
[]LogsClientSpec

A global set of clients to use when a discovered LogsInstance does not have any clients defined.

logsExternalLabelName
string

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.

instanceSelector
Kubernetes meta/v1.LabelSelector

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.

instanceNamespaceSelector
Kubernetes meta/v1.LabelSelector

InstanceNamespaceSelector are the set of labels to determine which namespaces to watch for LogInstances. If not provided, only checks own namespace.

ignoreNamespaceSelectors
bool

IgnoreNamespaceSelectors, if true, will ignore NamespaceSelector settings from the PodLogs configs, and they will only discover endpoints within their current namespace.

enforcedNamespaceLabel
string

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.

LogsTargetConfigSpec

(Appears on: LogsInstanceSpec)

LogsTargetConfigSpec configures how tailed targets are watched.

FieldDescription
syncPeriod
string

Period to resync directories being watched and files being tailed to discover new ones or stop watching removed ones.

MatchStageSpec

(Appears on: PipelineStageSpec)

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.

FieldDescription
selector
string

LogQL stream selector and filter expressions. Required.

pipelineName
string

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.

action
string

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 are dropped and no later metrics are recorded. Stages must be empty when dropping metrics.

dropCounterReason
string

Every time a log line is dropped, the metric logentry_dropped_lines_total is incremented. A “reason” label is added, and can be customized by providing a custom value here. Defaults to “match_stage.”

stages
string

Nested set of pipeline stages to execute when action is 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.

MetadataConfig

(Appears on: RemoteWriteSpec)

MetadataConfig configures the sending of series metadata to remote storage.

FieldDescription
send
bool

Send enables metric metadata to be sent to remote storage.

sendInterval
string

SendInterval controls how frequently metric metadata is sent to remote storage.

MetricsInstance

(Appears on: MetricsDeployment)

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

FieldDescription
metadata
Kubernetes meta/v1.ObjectMeta
Refer to the Kubernetes API documentation for the fields of the metadata field.
spec
MetricsInstanceSpec

Spec holds the specification of the desired behavior for the Metrics instance.



walTruncateFrequency
string

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.

minWALTime
string

MinWALTime is the minimum amount of time series and samples may exist in the WAL before being considered for deletion.

maxWALTime
string

MaxWALTime is the maximum amount of time series and asmples may exist in the WAL before being forcibly deleted.

remoteFlushDeadline
string

RemoteFlushDeadline is the deadline for flushing data when an instance shuts down.

writeStaleOnShutdown
bool

WriteStaleOnShutdown writes staleness markers on shutdown for all series.

serviceMonitorSelector
Kubernetes meta/v1.LabelSelector

ServiceMonitorSelector determines which ServiceMonitors should be selected for target discovery.

serviceMonitorNamespaceSelector
Kubernetes meta/v1.LabelSelector

ServiceMonitorNamespaceSelector are the set of labels to determine which namespaces to watch for ServiceMonitor discovery. If nil, only checks own namespace.

podMonitorSelector
Kubernetes meta/v1.LabelSelector

PodMonitorSelector determines which PodMonitors should be selected for target discovery. Experimental.

podMonitorNamespaceSelector
Kubernetes meta/v1.LabelSelector

PodMonitorNamespaceSelector are the set of labels to determine which namespaces to watch for PodMonitor discovery. If nil, only checks own namespace.

probeSelector
Kubernetes meta/v1.LabelSelector

ProbeSelector determines which Probes should be selected for target discovery.

probeNamespaceSelector
Kubernetes meta/v1.LabelSelector

ProbeNamespaceSelector are the set of labels to determine which namespaces to watch for Probe discovery. If nil, only checks own namespace.

remoteWrite
[]RemoteWriteSpec

RemoteWrite controls remote_write settings for this instance.

additionalScrapeConfigs
Kubernetes core/v1.SecretKeySelector

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.

MetricsInstanceSpec

(Appears on: MetricsInstance)

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

FieldDescription
walTruncateFrequency
string

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.

minWALTime
string

MinWALTime is the minimum amount of time series and samples may exist in the WAL before being considered for deletion.

maxWALTime
string

MaxWALTime is the maximum amount of time series and asmples may exist in the WAL before being forcibly deleted.

remoteFlushDeadline
string

RemoteFlushDeadline is the deadline for flushing data when an instance shuts down.

writeStaleOnShutdown
bool

WriteStaleOnShutdown writes staleness markers on shutdown for all series.

serviceMonitorSelector
Kubernetes meta/v1.LabelSelector

ServiceMonitorSelector determines which ServiceMonitors should be selected for target discovery.

serviceMonitorNamespaceSelector
Kubernetes meta/v1.LabelSelector

ServiceMonitorNamespaceSelector are the set of labels to determine which namespaces to watch for ServiceMonitor discovery. If nil, only checks own namespace.

podMonitorSelector
Kubernetes meta/v1.LabelSelector

PodMonitorSelector determines which PodMonitors should be selected for target discovery. Experimental.

podMonitorNamespaceSelector
Kubernetes meta/v1.LabelSelector

PodMonitorNamespaceSelector are the set of labels to determine which namespaces to watch for PodMonitor discovery. If nil, only checks own namespace.

probeSelector
Kubernetes meta/v1.LabelSelector

ProbeSelector determines which Probes should be selected for target discovery.

probeNamespaceSelector
Kubernetes meta/v1.LabelSelector

ProbeNamespaceSelector are the set of labels to determine which namespaces to watch for Probe discovery. If nil, only checks own namespace.

remoteWrite
[]RemoteWriteSpec

RemoteWrite controls remote_write settings for this instance.

additionalScrapeConfigs
Kubernetes core/v1.SecretKeySelector

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.

MetricsStageSpec

(Appears on: PipelineStageSpec)

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.

FieldDescription
type
string

The metric type to create. Must be one of counter, gauge, histogram. Required.

description
string

Sets the description for the created metric.

prefix
string

Sets the custom prefix name for the metric. Defaults to “promtailcustom”.

source
string

Key from the extracted data map to use for the metric. Defaults to the metrics name if not present.

maxIdleDuration
string

Label values on metrics are dynamic which can cause exported metrics to go stale. To prevent unbounded cardinality, any metrics not updated within MaxIdleDuration are removed.

Must be greater or equal to 1s. Defaults to 5m.

matchAll
bool

If true, all log lines are counted without attempting to match the source to the extracted map. Mutually exclusive with value.

Only valid for type: counter.

countEntryBytes
bool

If true all log line bytes are counted. Can only be set with matchAll: true and action: add.

Only valid for type: counter.

value
string

Filters down source data and only changes the metric if the targeted value matches the provided string exactly. If not present, all data matches.

action
string

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.

buckets
[]string

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.

MetricsSubsystemSpec

(Appears on: GrafanaAgentSpec)

MetricsSubsystemSpec defines global settings to apply across the Metrics subsystem.

FieldDescription
remoteWrite
[]RemoteWriteSpec

RemoteWrite controls default remote_write settings for all instances. If an instance does not provide its own remoteWrite settings, these will be used instead.

replicas
int32

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.

shards
int32

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.

replicaExternalLabelName
string

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.

metricsExternalLabelName
string

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.

scrapeInterval
string

ScrapeInterval is the time between consecutive scrapes.

scrapeTimeout
string

ScrapeTimeout is the time to wait for a target to respond before marking a scrape as failed.

externalLabels
map[string]string

ExternalLabels are labels to add to any time series when sending data over remote_write.

arbitraryFSAccessThroughSMs
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1.ArbitraryFSAccessThroughSMsConfig

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.

overrideHonorLabels
bool

OverrideHonorLabels, if true, overrides all configured honor_labels read from ServiceMonitor or PodMonitor to false.

overrideHonorTimestamps
bool

OverrideHonorTimestamps allows to globally enforce honoring timestamps in all scrape configs.

ignoreNamespaceSelectors
bool

IgnoreNamespaceSelectors, if true, will ignore NamespaceSelector settings from the PodMonitor and ServiceMonitor configs, and they will only discover endpoints within their current namespace.

enforcedNamespaceLabel
string

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.

enforcedSampleLimit
uint64

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.

enforcedTargetLimit
uint64

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.

instanceSelector
Kubernetes meta/v1.LabelSelector

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.

instanceNamespaceSelector
Kubernetes meta/v1.LabelSelector

InstanceNamespaceSelector are the set of labels to determine which namespaces to watch for MetricsInstances. If not provided, only checks own namespace.

MultilineStageSpec

(Appears on: PipelineStageSpec)

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

FieldDescription
firstLine
string

RE2 regular expression. Creates a new multiline block when matched. Required.

maxWaitTime
string

Maximum time to wait before passing on the multiline block to the next stage if no new lines are received. Defaults to 3s.

maxLines
int

Maximum number of lines a block can have. A new block is started if the number of lines surpasses this value. Defaults to 128.

ObjectSelector

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.

FieldDescription
ObjectType
sigs.k8s.io/controller-runtime/pkg/client.Object
ParentNamespace
string
NamespaceSelector
Kubernetes meta/v1.LabelSelector
Labels
Kubernetes meta/v1.LabelSelector

OutputStageSpec

(Appears on: PipelineStageSpec)

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

FieldDescription
source
string

Name from extract data to use for the log entry. Required.

PackStageSpec

(Appears on: PipelineStageSpec)

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.

FieldDescription
labels
[]string

Name from extracted data or line labels. Required. Labels provided here are automatically removed from output labels.

ingestTimestamp
bool

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.

PipelineStageSpec

(Appears on: PodLogsSpec)

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/

FieldDescription
cri
CRIStageSpec

CRI is a parsing stage that reads log lines using the standard CRI logging format. Supply cri: {} to enable.

docker
DockerStageSpec

Docker is a parsing stage that reads log lines using the standard Docker logging format. Supply docker: {} to enable.

drop
DropStageSpec

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

json
JSONStageSpec

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/

labelAllow
[]string

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.

labelDrop
[]string

LabelDrop is an action stage that drops labels from the label set that is sent to Loki with the log entry.

labels
map[string]string

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.

match
MatchStageSpec

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.

metrics
map[string]github.com/grafana/agent/pkg/operator/apis/monitoring/v1alpha1.MetricsStageSpec

Metrics is an action stage that supports 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.

multiline
MultilineStageSpec

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

output
OutputStageSpec

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

pack
PackStageSpec

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.

regex
RegexStageSpec

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.

replace
ReplaceStageSpec

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.

template
TemplateStageSpec

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

tenant
TenantStageSpec

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.

timestamp
TimestampStageSpec

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.

PodLogs

(Appears on: LogsDeployment)

PodLogs defines how to collect logs for a pod.

FieldDescription
metadata
Kubernetes meta/v1.ObjectMeta
Refer to the Kubernetes API documentation for the fields of the metadata field.
spec
PodLogsSpec

Spec holds the specification of the desired behavior for the PodLogs.



jobLabel
string

The label to use to retrieve the job name from.

podTargetLabels
[]string

PodTargetLabels transfers labels on the Kubernetes Pod onto the target.

selector
Kubernetes meta/v1.LabelSelector

Selector to select Pod objects. Required.

namespaceSelector
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1.NamespaceSelector

Selector to select which namespaces the Pod objects are discovered from.

pipelineStages
[]PipelineStageSpec

Pipeline stages for this pod. Pipeline stages support transforming and filtering log lines.

relabelings
[]github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1.RelabelConfig

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

PodLogsSpec

(Appears on: PodLogs)

PodLogsSpec defines how to collect logs for a pod.

FieldDescription
jobLabel
string

The label to use to retrieve the job name from.

podTargetLabels
[]string

PodTargetLabels transfers labels on the Kubernetes Pod onto the target.

selector
Kubernetes meta/v1.LabelSelector

Selector to select Pod objects. Required.

namespaceSelector
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1.NamespaceSelector

Selector to select which namespaces the Pod objects are discovered from.

pipelineStages
[]PipelineStageSpec

Pipeline stages for this pod. Pipeline stages support transforming and filtering log lines.

relabelings
[]github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1.RelabelConfig

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

QueueConfig

(Appears on: RemoteWriteSpec)

QueueConfig allows the tuning of remote_write queue_config parameters.

FieldDescription
capacity
int

Capacity is the number of samples to buffer per shard before we start dropping them.

minShards
int

MinShards is the minimum number of shards, i.e. amount of concurrency.

maxShards
int

MaxShards is the maximum number of shards, i.e. amount of concurrency.

maxSamplesPerSend
int

MaxSamplesPerSend is the maximum number of samples per send.

batchSendDeadline
string

BatchSendDeadline is the maximum time a sample will wait in buffer.

maxRetries
int

MaxRetries is the maximum number of times to retry a batch on recoverable errors.

minBackoff
string

MinBackoff is the initial retry delay. Gets doubled for every retry.

maxBackoff
string

MaxBackoff is the maximum retry delay.

retryOnRateLimit
bool

RetryOnRateLimit retries requests when encountering rate limits.

RegexStageSpec

(Appears on: PipelineStageSpec)

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.

FieldDescription
source
string

Name from extracted data to parse. If empty, defaults to using the log message.

expression
string

RE2 regular expression. Each capture group MUST be named. Required.

RemoteWriteSpec

(Appears on: MetricsInstanceSpec, MetricsSubsystemSpec)

RemoteWriteSpec defines the remote_write configuration for Prometheus.

FieldDescription
name
string

Name of the remote_write queue. Must be unique if specified. The name is used in metrics and logging in order to differentiate queues.

url
string

URL of the endpoint to send samples to.

remoteTimeout
string

RemoteTimeout is the timeout for requests to the remote_write endpoint.

headers
map[string]string

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.

writeRelabelConfigs
[]github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1.RelabelConfig

WriteRelabelConfigs holds relabel_configs to relabel samples before they are sent to the remote_write endpoint.

basicAuth
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1.BasicAuth

BasicAuth for the URL.

oauth2
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1.OAuth2

Oauth2 for URL

bearerToken
string

BearerToken used for remote_write.

bearerTokenFile
string

BearerTokenFile used to read bearer token.

sigv4
SigV4Config

SigV4 configures SigV4-based authentication to the remote_write endpoint. Will be used if SigV4 is defined, even with an empty object.

tlsConfig
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1.TLSConfig

TLSConfig to use for remote_write.

proxyUrl
string

ProxyURL to proxy requests through. Optional.

queueConfig
QueueConfig

QueueConfig allows tuning of the remote_write queue parameters.

metadataConfig
MetadataConfig

MetadataConfig configures the sending of series metadata to remote storage.

ReplaceStageSpec

(Appears on: PipelineStageSpec)

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.

FieldDescription
source
string

Name from extracted data to parse. If empty, defaults to using the log message.

expression
string

RE2 regular expression. Each capture group MUST be named. Required.

replace
string

Value to replace the captured group with.

SigV4Config

(Appears on: RemoteWriteSpec)

SigV4Config specifies configuration to perform SigV4 authentication.

FieldDescription
region
string

Region of the AWS endpoint. If blank, the region from the default credentials chain is used.

accessKey
Kubernetes core/v1.SecretKeySelector

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.

secretKey
Kubernetes core/v1.SecretKeySelector

SecretKey of the AWS API to use for signing. If blank, the environment variable AWS_SECRET_ACCESS_KEY is used.

profile
string

Profile is the named AWS profile to use for authentication.

roleARN
string

RoleARN is the AWS Role ARN to use for authentication, as an alternative for using the AWS API keys.

TemplateStageSpec

(Appears on: PipelineStageSpec)

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

FieldDescription
source
string

Name from extracted data to parse. Required. If empty, defaults to using the log message.

template
string

Go template string to use. Required. In addition to normal template functions, ToLower, ToUpper, Replace, Trim, TrimLeft, TrimRight, TrimPrefix, and TrimSpace are also available.

TenantStageSpec

(Appears on: PipelineStageSpec)

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

FieldDescription
label
string

Name from labels whose value should be set as tenant ID. Mutually exclusive with source and value.

source
string

Name from extracted data to use as the tenant ID. Mutually exclusive with label and value.

value
string

Value to use for the template ID. Useful when this stage is used within a conditional pipeline such as match. Mutually exclusive with label and source.

TimestampStageSpec

(Appears on: PipelineStageSpec)

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

FieldDescription
source
string

Name from extracted data to use as the timestamp. Required.

format
string

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.

fallbackFormats
[]string

Fallback formats to try if format fails.

location
string

IANA Timezone Database string.

actionOnFailure
string

Action to take when the timestamp can’t be extracted or parsed. Can be skip or fudge. Defaults to fudge.


Generated with gen-crd-api-reference-docs on git commit 022b9c17.