Menu
Choose a product
Scroll for more
Documentation
Grafana Cloud
Instrument and send data
Grafana Alloy
Reference
Configuration blocks
export
General availability (GA)
Open source
Grafana Cloud
export
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.
Usage
Alloy
export "<ARGUMENT_NAME>" {
value = <ARGUMENT_VALUE>
}Arguments
You can use the following arguments with export:
| Name | Type | Description | Default | Required |
|---|---|---|---|---|
value | any | Value to export. | yes |
The value argument determines what the value of the export is.
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:
Alloy
declare "pods_and_nodes" {
discovery.kubernetes "pods" {
role = "pod"
}
discovery.kubernetes "nodes" {
role = "node"
}
export "kubernetes_resources" {
value = array.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 managing your metrics, logs, and traces using Grafana
In this webinar, we’ll demo how to get started using the LGTM Stack: Loki for logs, Grafana for visualization, Tempo for traces, and Mimir for metrics.
Video

Intro to Kubernetes monitoring in Grafana Cloud
In this webinar you’ll learn how Grafana offers developers and SREs a simple and quick-to-value solution for monitoring their Kubernetes infrastructure.
Video

Building advanced Grafana dashboards
In this webinar, we’ll demo how to build and format Grafana dashboards.