Caution

Grafana Agent has reached End-of-Life (EOL) on November 1, 2025. Agent is no longer receiving vendor support and will no longer receive security or bug fixes. Current users of Agent Static mode, Agent Flow mode, and Agent Operator should proceed with migrating to Grafana Alloy. If you have already migrated to Alloy, no further action is required. Read more about why we recommend migrating to Grafana Alloy.

Important: This documentation is about an older version. It's relevant only to the release noted, many of the features and functions have been updated or replaced. Please view the current version.

Open source

export block

export is an optional configuration block used to specify an emitted value of a Module. export blocks must be given a label which determine the name of the export.

The export block may not be specified in the main configuration file given to Grafana Agent Flow.

Example

Alloy
export "ARGUMENT_NAME" {
  value = ARGUMENT_VALUE
}

Arguments

The following arguments are supported:

NameTypeDescriptionDefaultRequired
valueanyValue to export.yes

The value argument determines what the value of the export will be. To expose an exported field of another component to the module loader, set value to an expression which references that exported value.

Exported fields

The export block does not export any fields.

Example

This example creates a module where the output of discovering Kubernetes pods and nodes are exposed to the module loader:

Alloy
discovery.kubernetes "pods" {
  role = "pod"
}

discovery.kubernetes "nodes" {
  role = "nodes"
}

export "kubernetes_resources" {
  value = concat(
    discovery.kubernetes.pods.targets,
    discovery.kubernetes.nodes.targets,
  )
}