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/v1.9/get-started/configuration-syntax/expressions/function_calls.md, or by sending Accept: text/markdown to https://grafana.com/docs/alloy/v1.9/get-started/configuration-syntax/expressions/function_calls/. 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.
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.
Function calls
You can use Alloy function calls to create richer expressions.
Functions take zero or more arguments as input and always return a single value as output. You can’t construct functions. You can call functions from the standard library or export them from a component.
If a function fails, the expression isn’t evaluated, and the system reports an error.
Standard library functions
The Alloy configuration syntax includes a standard library of functions. Some functions interact with the host system, for example, reading from an environment variable. Other functions enable more complex expressions, for example, concatenating arrays or decoding JSON strings into objects.
sys.env("HOME")
encoding.from_json(local.file.cfg.content)["namespace"]Was this page helpful?
Related resources from Grafana Labs


