Skip to content

Commit 215ce79

Browse files
committed
Add compatibility mode for label changes
1 parent 25b3877 commit 215ce79

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

azure_insights.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ func (m *AzureInsightMetrics) CreatePrometheusMetricsGauge(metricName string) (g
7171
"metric",
7272
"unit",
7373
"aggregation",
74+
// deprecated
75+
"type",
76+
"data",
7477
})
7578
}
7679

@@ -108,6 +111,9 @@ func (r *AzureInsightMetricsResult) SetGauge(gauge *prometheus.GaugeVec, setting
108111
"metric": *metric.Name.Value,
109112
"unit": string(metric.Unit),
110113
"aggregation": "total",
114+
// deprecated
115+
"type":*metric.Name.Value,
116+
"data": "total",
111117
}).Set(*timeseriesData.Total)
112118
}
113119

@@ -117,6 +123,9 @@ func (r *AzureInsightMetricsResult) SetGauge(gauge *prometheus.GaugeVec, setting
117123
"metric": *metric.Name.Value,
118124
"unit": string(metric.Unit),
119125
"aggregation": "minimum",
126+
// deprecated
127+
"type":*metric.Name.Value,
128+
"data": "minimum",
120129
}).Set(*timeseriesData.Minimum)
121130
}
122131

@@ -126,6 +135,9 @@ func (r *AzureInsightMetricsResult) SetGauge(gauge *prometheus.GaugeVec, setting
126135
"metric": *metric.Name.Value,
127136
"unit": string(metric.Unit),
128137
"aggregation": "maximum",
138+
// deprecated
139+
"type":*metric.Name.Value,
140+
"data": "maximum",
129141
}).Set(*timeseriesData.Maximum)
130142
}
131143

@@ -135,6 +147,9 @@ func (r *AzureInsightMetricsResult) SetGauge(gauge *prometheus.GaugeVec, setting
135147
"metric": *metric.Name.Value,
136148
"unit": string(metric.Unit),
137149
"aggregation": "average",
150+
// deprecated
151+
"type":*metric.Name.Value,
152+
"data": "average",
138153
}).Set(*timeseriesData.Average)
139154
}
140155

@@ -144,6 +159,9 @@ func (r *AzureInsightMetricsResult) SetGauge(gauge *prometheus.GaugeVec, setting
144159
"metric": *metric.Name.Value,
145160
"unit": string(metric.Unit),
146161
"aggregation": "count",
162+
// deprecated
163+
"type":*metric.Name.Value,
164+
"data": "count",
147165
}).Set(*timeseriesData.Count)
148166
}
149167
}

0 commit comments

Comments
 (0)