File tree 2 files changed +4
-2
lines changed
pkg/metrics/internal/config
2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ type MetricGauge struct {
32
32
// ValueFrom is the path to a numeric field under Path that will be the metric value.
33
33
ValueFrom []string `yaml:"valueFrom" json:"valueFrom"`
34
34
// LabelFromKey adds a label with the given name if Path is an object. The label value will be the object key.
35
- LabelFromKey string `yaml:"labelFromKey" json:"labelFromKey"`
35
+ LabelFromKey string `yaml:"labelFromKey,omitempty " json:"labelFromKey,omitempty "`
36
36
// NilIsZero indicates that if a value is nil it will be treated as zero value.
37
37
NilIsZero bool `yaml:"nilIsZero" json:"nilIsZero"`
38
38
}
@@ -42,7 +42,7 @@ type MetricGauge struct {
42
42
type MetricInfo struct {
43
43
MetricMeta `yaml:",inline" json:",inline"`
44
44
// LabelFromKey adds a label with the given name if Path is an object. The label value will be the object key.
45
- LabelFromKey string `yaml:"labelFromKey" json:"labelFromKey"`
45
+ LabelFromKey string `yaml:"labelFromKey,omitempty " json:"labelFromKey,omitempty "`
46
46
}
47
47
48
48
// MetricStateSet is a metric which represent a series of related boolean values, also called a bitset.
Original file line number Diff line number Diff line change @@ -35,4 +35,6 @@ limitations under the License.
35
35
// * Rename the package to `config`.
36
36
// * Add `omitempty` to:
37
37
// - `MetricMeta.LabelsFromPath
38
+ // - `MetricGauge.LabelFromkey`
39
+ // - `MetricInfo.LabelFromkey`
38
40
package config
You can’t perform that action at this time.
0 commit comments