Caution
Grafana Agent has reached End-of-Life (EOL) on November 1, 2025. Agent is no longer receiving vendor support and will no longer receive security or bug fixes. Current users of Agent Static mode, Agent Flow mode, and Agent Operator should proceed with migrating to Grafana Alloy. If you have already migrated to Alloy, no further action is required. Read more about why we recommend migrating to Grafana Alloy.
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
Function calls is one more River feature that lets users build richer expressions.
Functions take zero or more arguments as their input and always return a single value as their output. Functions cannot be constructed by users, but can be either called from River’s standard library, or when exported by a component.
In case a function fails, the expression will not be evaluated and an error will be reported.
Standard library functions
River contains a standard library of useful functions. Some enable interaction with the host system (e.g. reading from an environment variable), or allow for more complex expressions (e.g. concatenating arrays or decoding JSON strings into objects).
env("HOME")
json_decode(local.file.cfg.contents)["namespace"]


