Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upRelabelling the address of a TargetGroup from k8s namespace, results in duplication of metrics #2761
Comments
This comment has been minimized.
This comment has been minimized.
|
After hours of browsing the source code repository :), i have learned how to activate the debug and ended up at a structure definition. i was using the latest Prometheus release on my local machine. My presumption is that when i am trying to relabel the Is this correct and can someone at least confirm this ? i can reproduce it on multiple kubernetes clusters and i think it is can only be reproduce inside a k8s namespace. also for the below structure wouldn't be a better idea to use // TargetGroup is a set of targets with a common label set.
type TargetGroup struct {
// Targets is a list of targets identified by a label set. Each target is
// uniquely identifiable in the group by its address label.
Targets []model.LabelSet
// Labels is a set of labels that is common across all targets in the group.
Labels model.LabelSet
// Source is an identifier that describes a group of targets.
Source string
}
func (tg TargetGroup) String() string {
return tg.Source
}
|
ionutvilie
changed the title
Groups regex relabel address, duplicate or triples metrics
Relabelling the address of a TargetGroup from k8s namespace, results in duplication of metrics
May 25, 2017
This comment has been minimized.
This comment has been minimized.
|
more info after i have cloned the master repository and started experimenting: |
This comment has been minimized.
This comment has been minimized.
|
miss-configuration, the metrics are scraped correctly, the issue comes from the k8s loadbalancer. |
ionutvilie
closed this
May 30, 2017
This comment has been minimized.
This comment has been minimized.
|
@ionutvilie Ah, was starting to look into this yesterday and didn't get anywhere yet - glad it got resolved :) |
This comment has been minimized.
This comment has been minimized.
|
@juliusv, i didn't have the time to answer but thanks for looking into it and sorry for the lost time. :) Maybe In the feature it would be great if someone, from the community, gave some hints for were to look or check, code test. I didn't actually expect help but i was feeling very lonely. A few more days and was ready to start logging with "day 7, if someone ever find this i'm lost in the queue manager" I probably now, know half of the Prometheus code and how to properly code a Golang app ;) |
This comment has been minimized.
This comment has been minimized.
|
@ionutvilie Heh, well at least you learned a lot of code now :) Sorry, but we get a lot of filed issues, mailing list questions, IRC questions, etc., and with a lot of the time spent on Prometheus being "free" personal time, it's not always feasible to get to everything. Everyone's trying their best though. |
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
Mar 23, 2019
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
ionutvilie commentedMay 24, 2017
•
edited
What did you do?
replace the address label using a group regex where port is optional from data received from kubernetes_sd_configs
related to this: #2434
What did you expect to see?
one metric with the label address changed
What did you see instead? Under which circumstances?
i am seeing the targets reported correctly, the metric however depending on how many regex groups i use it is doubled or tripled
Environment
Linux 3.13.0-85-generic x86_64I have checked new versions release notes and nothing seems to be related to any regex fix.
From my point of view is not relevant to update to the newer version.
insert Prometheus and Alertmanager logs relevant to the issue here
