I need to be able to leverage information about the machine that dbt is running on within my dbt project. This is primarily to aid in troubleshooting and providing environment status to developers and users. We have dbt running on multiple containers/vm’s in parallel across environments. I’d like to be able to create a log table in snowflake that includes the ip, machine name, or any other identifiable information about the machine that dbt is running on at the time.
Snowflake logs don’t help because the IP is always the firewall IP, regardless of the container running dbt.
I know I can do this via a macro that a script could inject the ip in as a variable, something like:
dbt run-operation inject_ip --args '{myIP: 111.222.333.444}'
But this would be a separate command that would have to run independent of the dbt build.
If possible, I would prefer to do this inside my project.
Is there any way to accomplish this using an underlying dbt or jinja command?