Closed lorenzofelletti closed 1 month ago
I guess question from my side what is the use case of optional selector? I feel like "job" label is almost mandatory concept in Prometheus, so I'm not sure what are we solving here?
The thing I'm trying to solve is when I have cases in which I don't know which value this is, because different clusters use different values. If that was a regex for example, I could have set it to something like .+
, but this is not. So in my case I set it to empty, and what happens is that the resulting expressions have invalid syntaxes, such as double commas ({,,something="value"}
) for example.
Although I do agree that this PR is probably not the best way to solve the issue. I am happy to close this, and open an issue to generally discuss the possibility to add support for empty selectors without generating invalid syntaxes in output.
I don't really think we should support empty selectors, you are working on data and you should know where your data should come from.
If you are not you might be mixing matching data you shouldn't. If you have two jobs scraping cadvisor, the dashboards will look weird
what I meant was that each individual cluster has is own key=value pair, and I'd like to generate the rules only once, without having N different configuration for the N different combination of that pair.
Not sure if this is common use case, and if we want to complicate our side to support your inconsitent clusters.
Why each individual cluster has their own key=value pair?
Why each individual cluster has their own key=value pair?
I don't really have a good answer for that...
Add support for
cadvisorSelector
being empty without the resulting generated queries having invalid syntax like{, label="something"}
. That could also be easily extended to support more labels being empty.