We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
proto
h2
h3
1 parent 9e7b76c commit 23f0008Copy full SHA for 23f0008
output.go
@@ -243,7 +243,13 @@ func (ms *metricStore) DeriveMetrics() {
243
244
func() {
245
strCode, _ := ts.tags.Get("proto")
246
- newValue, _ := strconv.ParseFloat(strings.TrimPrefix(strCode, "HTTP/"), 32)
+ strCode = strings.ToLower(strCode)
247
+ strCode = strings.TrimPrefix(strCode, "http/") // Leave bare version for "HTTP/1.1"
248
+ strCode = strings.TrimPrefix(strCode, "h") // Leave bare version for "h2"
249
+ newValue, err := strconv.ParseFloat(strCode, 32)
250
+ if err != nil {
251
+ return // Invalid protocol, skip timeseries.
252
+ }
253
httpVersionTS := timeseries{
254
name: "http_version",
255
metricType: metrics.Gauge,
0 commit comments