Reference device variables in environment variables?

Is it possible to reference host os variables like BALENA_DEVICE_NAME_AT_INIT and BALENA_HOST_OS_VERSION in service variables?

For example, I’m looking to add device names to datadog tags like this:

DD_TAGS : nickname:brown-cow

Rather than set these manually, is there a way to reference some of them automatically like this?


Hello! I’m not sure I entirely understand what you’re asking for; a host OS variable is a variable that is available in all Services, while a service variable is one that is scoped to a specific Service (Environment and service variables - Balena Documentation). So any host OS variable is available in any Service, but not all service variables are available in all Services. Where I’m not clear is what this has to do with DataDog tags; depending on where you’re setting these, you should be able to include $BALENA_DEVICE_NAME_AT_INIT as that is a host OS variable that will be exported in to a Service running DataDog. Does that help?