-
Notifications
You must be signed in to change notification settings - Fork 150
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
Allow for customizing process identification #214
Conversation
1 similar comment
Hello Joel, thank you for your PR. Could you explain a little bit more of your use case, please? The way I understand this code, this would only affect Gauges with their aggregation mode set to ALL, and you are overriding the But if you wanted to expose something else in the labels (in your example, Or am I misunderstanding what you are trying to do here? |
Hey @dmagliola! Pretty sure this is affecting all of the metrics when the aggregation is set to Initially, I wanted to be able to disable the My thought was that if an individual does not want the With this approach, there still is the possibility that two concurrently running processes collide, but that can be intentional and beneficial. In my use case, I am using yabeda with prometheus where I can nicely define a |
Ok, fair, but realistically, it'd be pretty unusual to set anything but Gauges to
My point was that by default, you'd only get This seems easier to understand for me than the parameters you added, and I think it'd be a pretty unusual use case to begin with, so i'm a bit unsure about adding what seems like a reasonably complex interface for a situation that probably won't arise much. |
I can see the value in not using system PIDs as a label in specifically the situation where:
In that situation, it is a rather pointless source of cardinality and it would be nice to have a way of avoiding it. I assume the situation you've run into hits both of those bullet points? The caveat of an override like that would be that you'd need to think harder about your other labels. If you were running a single webserver per host, then host would be fine. If you were running multliple, you'd need some other way of distinguishing between them, as you'd no longer have the server-unique PIDs to rely on. This was something that crossed my mind when implementing #127 and you can see it mentioned in #131. I didn't do anything about it at the time as @dmagliola and I talked through it and decided that it was more complexity than it was worth. I'm not totally opposed to revising that decision, but I definitely want to think carefully about adding more options to the library that come with big new caveats for users. |
Yup!
We aren't doing this to ourselves, but we still inject the a
Would a |
Right. What i'm proposing is you can get around that by not choosing I propose documenting that, instead of adding complexity to the interface when declaring your metrics. The reason for this is that we're adding parameters that are quite hard to explain correctly to the majority of users, whereas the minority that'll have this problem, already comes in pre-loaded with the context they'd need to understand the solution I'm proposing above.
I like this in principle, as a way of making the interface much, much simpler than passing in that lambda. To me, that's a pretty large footgun. 😬 I'm not adamant on this one, though, happy to go that route if you think i'm wrong. But this is why i'm reluctant to do this. |
Closing this because the complexity this adds in using the store doesn't justify the value, given that there's a fairly straightforward workaround in using any aggregation that is not |
My primary use case is to use the puma
index
label and forked worker's index to set the identity of the process, but it can also be useful with the process name ($0
) since various rake/rails commands would be identified based on what task was used.With the puma index label, that is nice on long running containers since a new deploy (or restart of the service) does not cause new processes to generate a new label value. With docker containers, it is less relevant since the puma parent is going to be 1 and the child processes are going to be a semi-consistent set of pids.