Menu
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.
Open source
export block
export
is an optional configuration block used to specify an emitted value of a custom component.
export
blocks must be given a label which determine the name of the export.
The export
block may only be specified inside the definition of a declare
block.
Note
In classic modules, theexport
block is valid as a top-level block in a classic module. Classic modules are deprecated and scheduled to be removed in the release after v0.40.
Example
river
export "ARGUMENT_NAME" {
value = ARGUMENT_VALUE
}
Arguments
The following arguments are supported:
Name | Type | Description | Default | Required |
---|---|---|---|---|
value | any | Value to export. | yes |
The value
argument determines what the value of the export will be.
To expose an exported field of another component, set value
to an expression that references that exported value.
Exported fields
The export
block doesn’t export any fields.
Example
This example creates a custom component where the output of discovering Kubernetes pods and nodes are exposed to the user:
river
declare "pods_and_nodes" {
discovery.kubernetes "pods" {
role = "pod"
}
discovery.kubernetes "nodes" {
role = "nodes"
}
export "kubernetes_resources" {
value = concat(
discovery.kubernetes.pods.targets,
discovery.kubernetes.nodes.targets,
)
}
}
Was this page helpful?
Related resources from Grafana Labs
Additional helpful documentation, links, and articles:
Video
Getting started with Grafana dashboard design
In this webinar, you'll learn how to design stylish and easily accessible Grafana dashboards that tell a story.
Video
Building advanced Grafana dashboards
In this webinar, we’ll demo how to build and format Grafana dashboards.
Video
Intro to Alerting with Grafana
Master alerting with Grafana: Navigate the complexities, reduce false positives, and boost reliability for your systems.