mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 10:51:29 +00:00
fix parsing error on labels
Change-Id: I990967b93b10dbfa9a564ca4286ffbd051c69697
This commit is contained in:
parent
49c08947f7
commit
0e7814a647
@ -29,6 +29,7 @@ var metricsOptionStructuresNames = []string{
|
|||||||
"GaugeOpts",
|
"GaugeOpts",
|
||||||
"HistogramOpts",
|
"HistogramOpts",
|
||||||
"SummaryOpts",
|
"SummaryOpts",
|
||||||
|
"TimingHistogramOpts",
|
||||||
}
|
}
|
||||||
|
|
||||||
func findStableMetricDeclaration(tree ast.Node, metricsImportName string) ([]*ast.CallExpr, []error) {
|
func findStableMetricDeclaration(tree ast.Node, metricsImportName string) ([]*ast.CallExpr, []error) {
|
||||||
@ -98,7 +99,7 @@ func (f *stableMetricFinder) Visit(node ast.Node) (w ast.Visitor) {
|
|||||||
func isMetricOps(name string) bool {
|
func isMetricOps(name string) bool {
|
||||||
var found = false
|
var found = false
|
||||||
for _, optsName := range metricsOptionStructuresNames {
|
for _, optsName := range metricsOptionStructuresNames {
|
||||||
if name != optsName {
|
if name == optsName {
|
||||||
found = true
|
found = true
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
@ -494,7 +494,13 @@ func Register(collectors ...metrics.StableCollector) {
|
|||||||
return 0
|
return 0
|
||||||
},
|
},
|
||||||
))
|
))
|
||||||
|
_ = metrics.Labels{
|
||||||
|
"probe_type": "1",
|
||||||
|
"container": "2",
|
||||||
|
"pod": "podName",
|
||||||
|
"namespace": "space",
|
||||||
|
"pod_uid": "123",
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user