[Request] environment variable KUROKO2_WORKER=$worker_id for jobs
gfx opened this issue · comments
Sometimes I'd like to know the process is running on workers or not.
For example, when I configure arproxy to report slow queries to Sentry, the threshold in workers (i.e. OLAP) differs from that in application servers (i.e. OLTP).
Of course I can define that environment variables in each job, but if this idea is worth considering, I'll make a pull request for it.
What do you think of it?
Let me confirm your situation.
- You have 2 (or more) kind of servers (e.g., worker-medium, worker-powerful)
- You have a job X which uses
SOME_THRESHOLD
environment variable SOME_THRESHOLD
depends on the worker kindSOME_THRESHOLD
should be 5 in worker-mediumSOME_THRESHOLD
should be 1 in worker-powerful
- You're thinking of adding
KUROKO2_WORKER
variable and deducing worker kind from it
Is it right?
Ah, in fact, currently I have just single worker; I'd like to distinguish workers from application servers. That is, I won't use $worker_id
for now.
Why you can't configure a environment variable for kuroko2 process in your worker servers?
Of course I can configure so, but I think it might be a general idea that is worth considering.
Feel free to close this issue if you think it's not so useful 😄
Please re-open when you need it. I still don't understand the use case.