Documentation for automated readers
A curated documentation index is available at: https://grafana.com/llms.txt
A complete documentation index is available at: https://grafana.com/llms-full.txt
These indexes can help with page discovery before fetching individual documents.
This page is also available in Markdown, which may be easier for automated readers and AI tools to parse than HTML. The Markdown version is available at https://grafana.com/docs/alloy/latest/reference/config-blocks/export.md, or by sending Accept: text/markdown to https://grafana.com/docs/alloy/latest/reference/config-blocks/export/. For broader documentation discovery, the curated index is available at https://grafana.com/llms.txt and the complete index is available at https://grafana.com/llms-full.txt.
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
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:
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


