Quick sanity check about the “context_uuid” and “p...
# contributing
q
Quick sanity check about the “context_uuid” and “parent_context_uuid” variables. If I have a continuously-running
meltano invoke airflow scheduler
process, I should expect each “job” (or is it airflow task?) that gets spun off by that main parent process to have their own unique context_uuid and the same shared parent_context_uuid, right?
w
That is correct
q
Awesome, thanks!
Hm. It seems like
$MELTANO_PARENT_CONTEXT_UUID
is accessible via meltano.yml, but
$MELTANO_CONTEXT_UUID
is not.
In other words, if I use
$MELTANO_PARENT_CONTEXT_UUID
somewhere in the yaml file, it gets filled in correctly. But setting either of these (
$MELTANO_CONTEXT_UUID
,
$CONTEXT_UUID
) throws the below error
Environment variable '[whatever]' referenced but not set. Make sure the environment variable is set.
w
That's expected, since it's part of our telemetry system, and not meant to be relied upon for regular non-telemetry uses. We don't expose that value as an env var because it isn't a setting.
The parent context UUID is exposed as an env var just because that's how we expose it to the child processes
Out of curiosity, what are you trying to do with it @quinn_batten? Maybe I can be of assistance
q
Ahh I see, gotcha. I’m adding query tags to snowflake queries using pipelinewise-target-snowflake’s query_tag config, with the goal of tracking costs for each pipeline. The tags are in the form of a json text blob, and I want to mark each query with an identifier for that “run”. I have to rely on variables that can be expanded inline in the YAML file by meltano itself, bc the plugin’s query_tag feature itself doesn’t expose much context or info (just the target db+schema). The sort of dumb/hacky way that I can think of for solving it is just having a cronjob that runs every 5min and that sets an env var with the current timestamp. Then I can expand that env_var in the yaml file itself and presumably it’ll be a single value for each individual “run”, as long as each job doesn’t run more frequently than that. It doesnt feel like a clean solution tho
The UUIDs could be perfect here bc they seem to… do the thing lol
Would love any other ideas or thoughts