Caution
Grafana Alloy is the new name for our distribution of the OTel collector. Grafana Agent has been deprecated and is in Long-Term Support (LTS) through October 31, 2025. Grafana Agent will reach an End-of-Life (EOL) on November 1, 2025. Read more about why we recommend migrating to Grafana Alloy.
Custom Resource Definition Reference
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.
Fields
| Field | Description |
|---|---|
| apiVersion | stringmonitoring.grafana.com/v1alpha1 |
| kind | stringDeployment |
AgentGrafanaAgent | 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. |
Secretsgithub.com/grafana/agent/static/operator/assets.SecretStore | The full list of Secrets referenced by resources in the Deployment. |
GrafanaAgent
(Appears on:Deployment) GrafanaAgent defines a Grafana Agent deployment.
Fields
| Field | Description |
|---|---|
| apiVersion | stringmonitoring.grafana.com/v1alpha1 |
| kind | stringGrafanaAgent |
metadataKubernetes meta/v1.ObjectMeta | Refer to the Kubernetes API documentation for the fields of the metadata field. |
specGrafanaAgentSpec | Spec holds the specification of the desired behavior for the Grafana Agent cluster. |
logLevelstring | LogLevel controls the log level of the generated pods. Defaults to "info" if not set. |
logFormatstring | LogFormat controls the logging format of the generated pods. Defaults to "logfmt" if not set. |
apiServergithub.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1.APIServerConfig | APIServerConfig lets you specify a host and auth methods to access the Kubernetes API server. If left empty, the Agent assumes 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. |
podMetadatagithub.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1.EmbeddedObjectMetadata | PodMetadata configures Labels and Annotations which are propagated to created Grafana Agent pods. |
versionstring | Version of Grafana Agent to be deployed. |
pausedbool | Paused prevents actions except for deletion to be performed on the underlying managed objects. |
imagestring | Image, when specified, overrides the image used to run Agent. Specify the image along with a tag. You still need to set the version to ensure Grafana Agent Operator knows which version of Grafana Agent is being configured. |
configReloaderVersionstring | Version of Config Reloader to be deployed. |
configReloaderImagestring | Image, when specified, overrides the image used to run Config Reloader. Specify the image along with a tag. You still need to set the version to ensure 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 used for pulling the Grafana Agent image from registries. More info: https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod |
storagegithub.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. The volumes specified are appended to other volumes that are generated as a result of StorageSpec objects. |
volumeMounts[]Kubernetes core/v1.VolumeMount | VolumeMounts lets you configure additional VolumeMounts on the output StatefulSet definition. Specified VolumeMounts are appended to other VolumeMounts generated as a result of StorageSpec objects in the Grafana Agent container. |
resourcesKubernetes core/v1.ResourceRequirements | Resources holds requests and limits for individual pods. |
nodeSelectormap[string]string | NodeSelector defines which nodes pods should be scheduling on. |
serviceAccountNamestring | 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 /var/lib/grafana-agent/extra-secrets/<secret-name>. |
configMaps[]string | ConfigMaps is a list 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 /var/lib/grafana-agent/extra-configmaps/<configmap-name>. |
affinityKubernetes 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. |
securityContextKubernetes 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 lets you inject additional containers or modify operator-generated containers. This can be used to add 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 if 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 supports and by doing so, you accept that this behavior may break at any time without notice. |
initContainers[]Kubernetes core/v1.Container | InitContainers let you add initContainers to the pod definition. These can be used to, for example, fetch secrets for injection into the Grafana Agent configuration from external sources. Errors during the execution of an initContainer cause the pod to restart. 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 support and by doing so, you accept that this behavior may break at any time without notice. |
priorityClassNamestring | PriorityClassName is the priority class assigned to pods. |
runtimeClassNamestring | RuntimeClassName is the runtime class assigned to pods. |
portNamestring | Port name used for the pods and governing service. This defaults to agent-metrics. |
metricsMetricsSubsystemSpec | Metrics controls the metrics subsystem of the Agent and settings unique to metrics-specific pods that are deployed. |
logsLogsSubsystemSpec | Logs controls the logging subsystem of the Agent and settings unique to logging-specific pods that are deployed. |
integrationsIntegrationsSubsystemSpec | Integrations controls the integration subsystem of the Agent and settings unique to deployed integration-specific pods. |
enableConfigReadAPIbool | enableConfigReadAPI enables the read API for viewing the currently running config port 8080 on the agent. +kubebuilder:default=false |
disableReportingbool | disableReporting disables reporting of enabled feature flags to Grafana. +kubebuilder:default=false |
disableSupportBundlebool | disableSupportBundle disables the generation of support bundles. +kubebuilder:default=false |
IntegrationsDeployment
(Appears on:Deployment) IntegrationsDeployment is a set of discovered resources relative to an IntegrationsDeployment.
Fields
| Field | Description |
|---|---|
| apiVersion | stringmonitoring.grafana.com/v1alpha1 |
| kind | stringIntegrationsDeployment |
InstanceIntegration |
LogsDeployment
(Appears on:Deployment) LogsDeployment is a set of discovered resources relative to a LogsInstance.
Fields
| Field | Description |
|---|---|
| apiVersion | stringmonitoring.grafana.com/v1alpha1 |
| kind | stringLogsDeployment |
InstanceLogsInstance | |
PodLogs[]PodLogs |
MetricsDeployment
(Appears on:Deployment) MetricsDeployment is a set of discovered resources relative to a MetricsInstance.
Fields
| Field | Description |
|---|---|
| apiVersion | stringmonitoring.grafana.com/v1alpha1 |
| kind | stringMetricsDeployment |
InstanceMetricsInstance | |
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.
Fields
| Field | Description |
|---|---|
sourcestring | Name from the extract data to parse. If empty, uses the log message. |
expressionstring | 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. |
valuestring | 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. |
olderThanstring | 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. |
longerThanstring | 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). |
dropCounterReasonstring | 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.
Fields
| Field | Description |
|---|---|
logLevelstring | LogLevel controls the log level of the generated pods. Defaults to "info" if not set. |
logFormatstring | LogFormat controls the logging format of the generated pods. Defaults to "logfmt" if not set. |
apiServergithub.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1.APIServerConfig | APIServerConfig lets you specify a host and auth methods to access the Kubernetes API server. If left empty, the Agent assumes 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. |
podMetadatagithub.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1.EmbeddedObjectMetadata | PodMetadata configures Labels and Annotations which are propagated to created Grafana Agent pods. |
versionstring | Version of Grafana Agent to be deployed. |
pausedbool | Paused prevents actions except for deletion to be performed on the underlying managed objects. |
imagestring | Image, when specified, overrides the image used to run Agent. Specify the image along with a tag. You still need to set the version to ensure Grafana Agent Operator knows which version of Grafana Agent is being configured. |
configReloaderVersionstring | Version of Config Reloader to be deployed. |
configReloaderImagestring | Image, when specified, overrides the image used to run Config Reloader. Specify the image along with a tag. You still need to set the version to ensure 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 used for pulling the Grafana Agent image from registries. More info: https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod |
storagegithub.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. The volumes specified are appended to other volumes that are generated as a result of StorageSpec objects. |
volumeMounts[]Kubernetes core/v1.VolumeMount | VolumeMounts lets you configure additional VolumeMounts on the output StatefulSet definition. Specified VolumeMounts are appended to other VolumeMounts generated as a result of StorageSpec objects in the Grafana Agent container. |
resourcesKubernetes core/v1.ResourceRequirements | Resources holds requests and limits for individual pods. |
nodeSelectormap[string]string | NodeSelector defines which nodes pods should be scheduling on. |
serviceAccountNamestring | 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 /var/lib/grafana-agent/extra-secrets/<secret-name>. |
configMaps[]string | ConfigMaps is a list 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 /var/lib/grafana-agent/extra-configmaps/<configmap-name>. |
affinityKubernetes 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. |
securityContextKubernetes 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 lets you inject additional containers or modify operator-generated containers. This can be used to add 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 if 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 supports and by doing so, you accept that this behavior may break at any time without notice. |
initContainers[]Kubernetes core/v1.Container | InitContainers let you add initContainers to the pod definition. These can be used to, for example, fetch secrets for injection into the Grafana Agent configuration from external sources. Errors during the execution of an initContainer cause the pod to restart. 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 support and by doing so, you accept that this behavior may break at any time without notice. |
priorityClassNamestring | PriorityClassName is the priority class assigned to pods. |
runtimeClassNamestring | RuntimeClassName is the runtime class assigned to pods. |
portNamestring | Port name used for the pods and governing service. This defaults to agent-metrics. |
metricsMetricsSubsystemSpec | Metrics controls the metrics subsystem of the Agent and settings unique to metrics-specific pods that are deployed. |
logsLogsSubsystemSpec | Logs controls the logging subsystem of the Agent and settings unique to logging-specific pods that are deployed. |
integrationsIntegrationsSubsystemSpec | Integrations controls the integration subsystem of the Agent and settings unique to deployed integration-specific pods. |
enableConfigReadAPIbool | enableConfigReadAPI enables the read API for viewing the currently running config port 8080 on the agent. +kubebuilder:default=false |
disableReportingbool | disableReporting disables reporting of enabled feature flags to Grafana. +kubebuilder:default=false |
disableSupportBundlebool | disableSupportBundle disables the generation of support bundles. +kubebuilder:default=false |
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 <namespace>/<name> 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.
Fields
| Field | Description |
|---|---|
metadataKubernetes meta/v1.ObjectMeta | Refer to the Kubernetes API documentation for the fields of the metadata field. |
specIntegrationSpec | Specifies the desired behavior of the Integration. |
namestring | Name of the integration to run (e.g., "node_exporter", "mysqld_exporter"). |
typeIntegrationType | Type informs Grafana Agent Operator about how to manage the integration being configured. |
configk8s.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/<secret_namespace>/<secret_name>/<key>. |
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/<configmap_namespace>/<configmap_name>/<key>. |
IntegrationSpec
(Appears on:Integration) IntegrationSpec specifies the desired behavior of a metrics integration.
Fields
| Field | Description |
|---|---|
namestring | Name of the integration to run (e.g., "node_exporter", "mysqld_exporter"). |
typeIntegrationType | Type informs Grafana Agent Operator about how to manage the integration being configured. |
configk8s.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/<secret_namespace>/<secret_name>/<key>. |
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/<configmap_namespace>/<configmap_name>/<key>. |
IntegrationType
(Appears on:IntegrationSpec) IntegrationType determines specific behaviors of a configured integration.
Fields
| Field | Description |
|---|---|
allNodesbool | 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. |
uniquebool | 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.
Fields
| Field | Description |
|---|---|
selectorKubernetes meta/v1.LabelSelector | Label selector to find Integration resources to run. When nil, no integration resources will be defined. |
namespaceSelectorKubernetes 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.
Fields
| Field | Description |
|---|---|
sourcestring | Name from the extracted data to parse as JSON. If empty, uses entire log message. |
expressionsmap[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. |
LimitStageSpec
(Appears on:PipelineStageSpec) The limit stage is a rate-limiting stage that throttles logs based on several options.
Fields
| Field | Description |
|---|---|
rateint | The rate limit in lines per second that Promtail will push to Loki. |
burstint | The cap in the quantity of burst lines that Promtail will push to Loki. |
dropbool | When drop is true, log lines that exceed the current rate limit are discarded. When drop is false, log lines that exceed the current rate limit wait to enter the back pressure mode. Defaults to false. |
LogsBackoffConfigSpec
(Appears on:LogsClientSpec) LogsBackoffConfigSpec configures timing for retrying failed requests.
Fields
| Field | Description |
|---|---|
minPeriodstring | Initial backoff time between retries. Time between retries is increased exponentially. |
maxPeriodstring | Maximum backoff time between retries. |
maxRetriesint | 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.
Fields
| Field | Description |
|---|---|
urlstring | 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. |
tenantIdstring | 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. |
batchWaitstring | Maximum amount of time to wait before sending a batch, even if that batch isn't full. |
batchSizeint | Maximum batch size (in bytes) of logs to accumulate before sending the batch to Loki. |
basicAuthgithub.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1.BasicAuth | BasicAuth for the Loki server. |
oauth2github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1.OAuth2 | Oauth2 for URL |
bearerTokenstring | BearerToken used for remote_write. |
bearerTokenFilestring | BearerTokenFile used to read bearer token. |
proxyUrlstring | ProxyURL to proxy requests through. Optional. |
tlsConfiggithub.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. |
backoffConfigLogsBackoffConfigSpec | Configures how to retry requests to Loki when a request fails. Defaults to a minPeriod of 500ms, maxPeriod of 5m, and maxRetries of 10. |
externalLabelsmap[string]string | ExternalLabels are labels to add to any time series when sending data to Loki. |
timeoutstring | 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.
Fields
| Field | Description |
|---|---|
metadataKubernetes meta/v1.ObjectMeta | Refer to the Kubernetes API documentation for the fields of the metadata field. |
specLogsInstanceSpec | Spec holds the specification of the desired behavior for the logs instance. |
clients[]LogsClientSpec | Clients controls where logs are written to for this instance. |
podLogsSelectorKubernetes meta/v1.LabelSelector | Determines which PodLogs should be selected for including in this instance. |
podLogsNamespaceSelectorKubernetes meta/v1.LabelSelector | Set of labels to determine which namespaces should be watched for PodLogs. If not provided, checks only namespace of the instance. |
additionalScrapeConfigsKubernetes 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. |
targetConfigLogsTargetConfigSpec | Configures how tailed targets are watched. |
LogsInstanceSpec
(Appears on:LogsInstance) LogsInstanceSpec controls how an individual instance will be used to discover LogMonitors.
Fields
| Field | Description |
|---|---|
clients[]LogsClientSpec | Clients controls where logs are written to for this instance. |
podLogsSelectorKubernetes meta/v1.LabelSelector | Determines which PodLogs should be selected for including in this instance. |
podLogsNamespaceSelectorKubernetes meta/v1.LabelSelector | Set of labels to determine which namespaces should be watched for PodLogs. If not provided, checks only namespace of the instance. |
additionalScrapeConfigsKubernetes 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. |
targetConfigLogsTargetConfigSpec | Configures how tailed targets are watched. |
LogsSubsystemSpec
(Appears on:GrafanaAgentSpec) LogsSubsystemSpec defines global settings to apply across the logging subsystem.
Fields
| Field | Description |
|---|---|
clients[]LogsClientSpec | A global set of clients to use when a discovered LogsInstance does not have any clients defined. |
logsExternalLabelNamestring | 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. |
instanceSelectorKubernetes 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. |
instanceNamespaceSelectorKubernetes meta/v1.LabelSelector | InstanceNamespaceSelector are the set of labels to determine which namespaces to watch for LogInstances. If not provided, only checks own namespace. |
ignoreNamespaceSelectorsbool | IgnoreNamespaceSelectors, if true, will ignore NamespaceSelector settings from the PodLogs configs, and they will only discover endpoints within their current namespace. |
enforcedNamespaceLabelstring | 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.
Fields
| Field | Description |
|---|---|
syncPeriodstring | 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.
Fields
| Field | Description |
|---|---|
selectorstring | LogQL stream selector and filter expressions. Required. |
pipelineNamestring | 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. |
actionstring | 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. |
dropCounterReasonstring | 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." |
stagesstring | 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: |
MetadataConfig
(Appears on:RemoteWriteSpec) MetadataConfig configures the sending of series metadata to remote storage.
Fields
| Field | Description |
|---|---|
sendbool | Send enables metric metadata to be sent to remote storage. |
sendIntervalstring | 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.
Fields
| Field | Description |
|---|---|
metadataKubernetes meta/v1.ObjectMeta | Refer to the Kubernetes API documentation for the fields of the metadata field. |
specMetricsInstanceSpec | Spec holds the specification of the desired behavior for the Metrics instance. |
walTruncateFrequencystring | WALTruncateFrequency specifies how frequently to run the WAL truncation process. Higher values cause the WAL to increase and for old series to stay in the WAL longer, but reduces the chance of data loss when remote_write fails for longer than the given frequency. |
minWALTimestring | MinWALTime is the minimum amount of time that series and samples can exist in the WAL before being considered for deletion. |
maxWALTimestring | MaxWALTime is the maximum amount of time that series and samples can exist in the WAL before being forcibly deleted. |
remoteFlushDeadlinestring | RemoteFlushDeadline is the deadline for flushing data when an instance shuts down. |
writeStaleOnShutdownbool | WriteStaleOnShutdown writes staleness markers on shutdown for all series. |
serviceMonitorSelectorKubernetes meta/v1.LabelSelector | ServiceMonitorSelector determines which ServiceMonitors to select for target discovery. |
serviceMonitorNamespaceSelectorKubernetes meta/v1.LabelSelector | ServiceMonitorNamespaceSelector is the set of labels that determine which namespaces to watch for ServiceMonitor discovery. If nil, it only checks its own namespace. |
podMonitorSelectorKubernetes meta/v1.LabelSelector | PodMonitorSelector determines which PodMonitors to selected for target discovery. Experimental. |
podMonitorNamespaceSelectorKubernetes meta/v1.LabelSelector | PodMonitorNamespaceSelector are the set of labels to determine which namespaces to watch for PodMonitor discovery. If nil, it only checks its own namespace. |
probeSelectorKubernetes meta/v1.LabelSelector | ProbeSelector determines which Probes to select for target discovery. |
probeNamespaceSelectorKubernetes meta/v1.LabelSelector | ProbeNamespaceSelector is the set of labels that determines which namespaces to watch for Probe discovery. If nil, it only checks own namespace. |
remoteWrite[]RemoteWriteSpec | RemoteWrite controls remote_write settings for this instance. |
additionalScrapeConfigsKubernetes core/v1.SecretKeySelector | AdditionalScrapeConfigs lets you specify a key of a Secret containing additional Grafana Agent Prometheus scrape configurations. The specified scrape configurations are appended to the configurations generated by Grafana Agent Operator. Specified job configurations must have the form specified in the official Prometheus documentation: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#scrape_config. As scrape configs are appended, you must make sure the configuration is still valid. Note that it's possible that this feature will break future upgrades of Grafana Agent. Review both Grafana Agent and Prometheus release notes to ensure that no incompatible scrape configs will break Grafana Agent after the upgrade. |
MetricsInstanceSpec
(Appears on:MetricsInstance) MetricsInstanceSpec controls how an individual instance is used to discover PodMonitors.
Fields
| Field | Description |
|---|---|
walTruncateFrequencystring | WALTruncateFrequency specifies how frequently to run the WAL truncation process. Higher values cause the WAL to increase and for old series to stay in the WAL longer, but reduces the chance of data loss when remote_write fails for longer than the given frequency. |
minWALTimestring | MinWALTime is the minimum amount of time that series and samples can exist in the WAL before being considered for deletion. |
maxWALTimestring | MaxWALTime is the maximum amount of time that series and samples can exist in the WAL before being forcibly deleted. |
remoteFlushDeadlinestring | RemoteFlushDeadline is the deadline for flushing data when an instance shuts down. |
writeStaleOnShutdownbool | WriteStaleOnShutdown writes staleness markers on shutdown for all series. |
serviceMonitorSelectorKubernetes meta/v1.LabelSelector | ServiceMonitorSelector determines which ServiceMonitors to select for target discovery. |
serviceMonitorNamespaceSelectorKubernetes meta/v1.LabelSelector | ServiceMonitorNamespaceSelector is the set of labels that determine which namespaces to watch for ServiceMonitor discovery. If nil, it only checks its own namespace. |
podMonitorSelectorKubernetes meta/v1.LabelSelector | PodMonitorSelector determines which PodMonitors to selected for target discovery. Experimental. |
podMonitorNamespaceSelectorKubernetes meta/v1.LabelSelector | PodMonitorNamespaceSelector are the set of labels to determine which namespaces to watch for PodMonitor discovery. If nil, it only checks its own namespace. |
probeSelectorKubernetes meta/v1.LabelSelector | ProbeSelector determines which Probes to select for target discovery. |
probeNamespaceSelectorKubernetes meta/v1.LabelSelector | ProbeNamespaceSelector is the set of labels that determines which namespaces to watch for Probe discovery. If nil, it only checks own namespace. |
remoteWrite[]RemoteWriteSpec | RemoteWrite controls remote_write settings for this instance. |
additionalScrapeConfigsKubernetes core/v1.SecretKeySelector | AdditionalScrapeConfigs lets you specify a key of a Secret containing additional Grafana Agent Prometheus scrape configurations. The specified scrape configurations are appended to the configurations generated by Grafana Agent Operator. Specified job configurations must have the form specified in the official Prometheus documentation: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#scrape_config. As scrape configs are appended, you must make sure the configuration is still valid. Note that it's possible that this feature will break future upgrades of Grafana Agent. Review both Grafana Agent and Prometheus release notes to ensure that no incompatible scrape configs will 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.
Fields
| Field | Description |
|---|---|
typestring | The metric type to create. Must be one of counter, gauge, histogram. Required. |
descriptionstring | Sets the description for the created metric. |
prefixstring | Sets the custom prefix name for the metric. Defaults to "promtail_custom_". |
sourcestring | Key from the extracted data map to use for the metric. Defaults to the metrics name if not present. |
maxIdleDurationstring | 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. |
matchAllbool | 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. |
countEntryBytesbool | If true all log line bytes are counted. Can only be set with matchAll: true and action: add. Only valid for type: counter. |
valuestring | Filters down source data and only changes the metric if the targeted value matches the provided string exactly. If not present, all data matches. |
actionstring | 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.
Fields
| Field | Description |
|---|---|
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. |
replicasint32 | 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. |
shardsint32 | 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 does not reshard data onto remaining instances; it must be manually moved. Increasing shards does 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. |
replicaExternalLabelNamestring | ReplicaExternalLabelName is the name of the metrics external label used to denote the replica name. Defaults to replica. The external label is not added when the value is set to the empty string. |
metricsExternalLabelNamestring | MetricsExternalLabelName is the name of the external label used to denote Grafana Agent cluster. Defaults to "cluster." The external label is not added when the value is set to the empty string. |
scrapeIntervalstring | ScrapeInterval is the time between consecutive scrapes. |
scrapeTimeoutstring | ScrapeTimeout is the time to wait for a target to respond before marking a scrape as failed. |
externalLabelsmap[string]string | ExternalLabels are labels to add to any time series when sending data over remote_write. |
arbitraryFSAccessThroughSMsgithub.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. |
overrideHonorLabelsbool | OverrideHonorLabels, if true, overrides all configured honor_labels read from ServiceMonitor or PodMonitor and sets them to false. |
overrideHonorTimestampsbool | OverrideHonorTimestamps allows global enforcement for honoring timestamps in all scrape configs. |
ignoreNamespaceSelectorsbool | IgnoreNamespaceSelectors, if true, ignores NamespaceSelector settings from the PodMonitor and ServiceMonitor configs, so that they only discover endpoints within their current namespace. |
enforcedNamespaceLabelstring | EnforcedNamespaceLabel enforces adding a namespace label of origin for each metric that is user-created. The label value is always the namespace of the object that is being created. |
enforcedSampleLimituint64 | EnforcedSampleLimit defines a global limit on the number of scraped samples that are 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 is used instead. |
enforcedTargetLimituint64 | 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 is used instead. |
instanceSelectorKubernetes 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. |
instanceNamespaceSelectorKubernetes meta/v1.LabelSelector | InstanceNamespaceSelector is the set of labels that determines which namespaces to watch for MetricsInstances. If not provided, it only checks its 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.
Fields
| Field | Description |
|---|---|
firstLinestring | RE2 regular expression. Creates a new multiline block when matched. Required. |
maxWaitTimestring | Maximum time to wait before passing on the multiline block to the next stage if no new lines are received. Defaults to 3s. |
maxLinesint | 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, search for objects directly in the ParentNamespace.
Fields
| Field | Description |
|---|---|
ObjectTypesigs.k8s.io/controller-runtime/pkg/client.Object | |
ParentNamespacestring | |
NamespaceSelectorKubernetes meta/v1.LabelSelector | |
LabelsKubernetes 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.
Fields
| Field | Description |
|---|---|
sourcestring | 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.
Fields
| Field | Description |
|---|---|
labels[]string | Name from extracted data or line labels. Required. Labels provided here are automatically removed from output labels. |
ingestTimestampbool | 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/
Fields
| Field | Description |
|---|---|
criCRIStageSpec | CRI is a parsing stage that reads log lines using the standard CRI logging format. Supply cri: {} to enable. |
dockerDockerStageSpec | Docker is a parsing stage that reads log lines using the standard Docker logging format. Supply docker: {} to enable. |
dropDropStageSpec | Drop is a filtering stage that lets you drop certain logs. |
jsonJSONStageSpec | 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. |
labelsmap[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. |
limitLimitStageSpec | Limit is a rate-limiting stage that throttles logs based on several options. |
matchMatchStageSpec | 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. |
metricsmap[string]github.com/grafana/agent/static/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. |
multilineMultilineStageSpec | Multiline stage merges multiple lines into a multiline block before passing it on to the next stage in the pipeline. |
outputOutputStageSpec | Output stage is an action stage that takes data from the extracted map and changes the log line that will be sent to Loki. |
packPackStageSpec | 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. |
regexRegexStageSpec | 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. |
replaceReplaceStageSpec | 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. |
templateTemplateStageSpec | Template is a transform stage that manipulates the values in the extracted map using Go's template syntax. |
tenantTenantStageSpec | 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. |
timestampTimestampStageSpec | 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.
Fields
| Field | Description |
|---|---|
metadataKubernetes meta/v1.ObjectMeta | Refer to the Kubernetes API documentation for the fields of the metadata field. |
specPodLogsSpec | Spec holds the specification of the desired behavior for the PodLogs. |
jobLabelstring | The label to use to retrieve the job name from. |
podTargetLabels[]string | PodTargetLabels transfers labels on the Kubernetes Pod onto the target. |
selectorKubernetes meta/v1.LabelSelector | Selector to select Pod objects. Required. |
namespaceSelectorgithub.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.
Fields
| Field | Description |
|---|---|
jobLabelstring | The label to use to retrieve the job name from. |
podTargetLabels[]string | PodTargetLabels transfers labels on the Kubernetes Pod onto the target. |
selectorKubernetes meta/v1.LabelSelector | Selector to select Pod objects. Required. |
namespaceSelectorgithub.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.
Fields
| Field | Description |
|---|---|
capacityint | Capacity is the number of samples to buffer per shard before samples start being dropped. |
minShardsint | MinShards is the minimum number of shards, i.e., the amount of concurrency. |
maxShardsint | MaxShards is the maximum number of shards, i.e., the amount of concurrency. |
maxSamplesPerSendint | MaxSamplesPerSend is the maximum number of samples per send. |
batchSendDeadlinestring | BatchSendDeadline is the maximum time a sample will wait in the buffer. |
maxRetriesint | MaxRetries is the maximum number of times to retry a batch on recoverable errors. |
minBackoffstring | MinBackoff is the initial retry delay. MinBackoff is doubled for every retry. |
maxBackoffstring | MaxBackoff is the maximum retry delay. |
retryOnRateLimitbool | 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.
Fields
| Field | Description |
|---|---|
sourcestring | Name from extracted data to parse. If empty, defaults to using the log message. |
expressionstring | RE2 regular expression. Each capture group MUST be named. Required. |
RemoteWriteSpec
(Appears on:MetricsInstanceSpec, MetricsSubsystemSpec) RemoteWriteSpec defines the remote_write configuration for Prometheus.
Fields
| Field | Description |
|---|---|
namestring | Name of the remote_write queue. Must be unique if specified. The name is used in metrics and logging in order to differentiate queues. |
urlstring | URL of the endpoint to send samples to. |
remoteTimeoutstring | RemoteTimeout is the timeout for requests to the remote_write endpoint. |
headersmap[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. |
basicAuthgithub.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1.BasicAuth | BasicAuth for the URL. |
oauth2github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1.OAuth2 | Oauth2 for URL |
bearerTokenstring | BearerToken used for remote_write. |
bearerTokenFilestring | BearerTokenFile used to read bearer token. |
sigv4SigV4Config | SigV4 configures SigV4-based authentication to the remote_write endpoint. SigV4-based authentication is used if SigV4 is defined, even with an empty object. |
tlsConfiggithub.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1.TLSConfig | TLSConfig to use for remote_write. |
proxyUrlstring | ProxyURL to proxy requests through. Optional. |
queueConfigQueueConfig | QueueConfig allows tuning of the remote_write queue parameters. |
metadataConfigMetadataConfig | 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.
Fields
| Field | Description |
|---|---|
sourcestring | Name from extracted data to parse. If empty, defaults to using the log message. |
expressionstring | RE2 regular expression. Each capture group MUST be named. Required. |
replacestring | Value to replace the captured group with. |
SigV4Config
(Appears on:RemoteWriteSpec) SigV4Config specifies configuration to perform SigV4 authentication.
Fields
| Field | Description |
|---|---|
regionstring | Region of the AWS endpoint. If blank, the region from the default credentials chain is used. |
accessKeyKubernetes 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. |
secretKeyKubernetes core/v1.SecretKeySelector | SecretKey of the AWS API to use for signing. If blank, the environment variable AWS_SECRET_ACCESS_KEY is used. |
profilestring | Profile is the named AWS profile to use for authentication. |
roleARNstring | 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.
Fields
| Field | Description |
|---|---|
sourcestring | Name from extracted data to parse. Required. If empty, defaults to using the log message. |
templatestring | 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.
Fields
| Field | Description |
|---|---|
labelstring | Name from labels whose value should be set as tenant ID. Mutually exclusive with source and value. |
sourcestring | Name from extracted data to use as the tenant ID. Mutually exclusive with label and value. |
valuestring | 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.
Fields
| Field | Description |
|---|---|
sourcestring | Name from extracted data to use as the timestamp. Required. |
formatstring | 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. |
locationstring | IANA Timezone Database string. |
actionOnFailurestring | Action to take when the timestamp can't be extracted or parsed. Can be skip or fudge. Defaults to fudge. |



