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


