-
Notifications
You must be signed in to change notification settings - Fork 815
Fix bug of multiprocess mode by path
argument
#395
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Vladimír Kašpar <vladimir.kaspar@heureka.cz>
117d591
to
ec84762
Compare
How exactly isn't the latter working? |
before my change - If you don't set the environment variable the library doesn't create that .db files because at values it consumes only the environemnt variable and doesn't consume the after my change - if you set the path by |
This is the expected behaviour, you must set the environment variable for the multi processing to work. There's however no need to set it for MultiProcessCollector to work. |
<
8000
/tr>
Why is there the |
My change doesn't block to use the environment variable.. |
In case you want to point it at a different directory for some reason. Your change doesn't make sense overall I'm afraid, the path for collectors needs to be configured before the process starts. |
Ok, I got it.. However, the use of an environment variable seems unhappy to me in this case (as a flag for library).. Do you think of another solution how to change it to active multiprocess mode without ENV variable? |
I try another change.. It sets the global variable during the process starts from the environment variable or it's overwritten by the |
Signed-off-by: Vladimír Kašpar <vladimir.kaspar@heureka.cz>
bc4e547
to
3c79a56
Compare
The whole root of this pull request is our misunderstanding of the Then there's the attempt to 'improve' this and make the environmental variable an alternative rather than a requirement. After @Sparkycz sent me the link to this PR we went together through the code and realized that due to the singleton nature of this library it's quite clearly not worth it to implement that and any attempt would just break the current behavior that some might rely on already. |
path
argument atmultiprocess.MultiProcessCollector.__init__()
is only for merging multiprocess files but it doesn't work for processing metrics and creating that files (without setos.environ.['prometheus_multiproc_dir']
). Everybody has to activate the mode by the environment variableprometheus_multiproc_dir
.works:
doesn't work: