Domino on Linux/Unix, Troubleshooting, Best Practices, Tips and more ...

alt

Daniel Nashed

Grafana Alloy configuration with environment variables

Daniel Nashed – 3 February 2026 17:21:48

My first approach was to replace variables using envsubst.
But it turns out there is an easier and better method.
You can add environment variables and it even allows to specify empty values.

This is very helpful specially for container configurations.
You can just define those variables in your container configuration -for example custom trusted root file and an authentication token.

The "trick" here is to use the env ("xyz")

Domino server container entrypoint.sh makes sure variables have a meaningful default for logging for example.



logging {

level = env("ALLOY_LOG_LEVEL")

}


loki.write "loki" {

endpoint {

  url = env("ALLOY_PUSH_TARGET")


  bearer_token = env("ALLOY_LOKI_TOKEN")


  tls_config {

    ca_file = env("ALLOY_LOKI_CA_FILE")

  }

}

}


local.file_match "logfiles" {

path_targets = [

  {

    __path__ = env("ALLOY_LOKI_LOGFILE"),

    job      = env("ALLOY_LOKI_JOB"),

  },

]

}


loki.source.file "domino_log" {

targets    = local.file_match.logfiles.targets

forward_to = [loki.write.loki.receiver]

}

Links

    Archives


    • [HCL Domino]
    • [Domino on Linux]
    • [Nash!Com]
    • [Daniel Nashed]