Skip to content

Commit

Permalink
create http_version metric
Browse files Browse the repository at this point in the history
  • Loading branch information
nadiamoe committed Jan 15, 2025
1 parent 231d799 commit 980c3ba
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions output.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,18 @@ func (ms *metricStore) DeriveMetrics() {
log.Debugf("Created %q from %q", statusCodeTS.name, ts.name)
}()

func() {
strCode, _ := ts.tags.Get("proto")
newValue, _ := strconv.ParseFloat(strings.TrimPrefix(strCode, "HTTP/"), 32)
httpVersionTS := timeseries{
name: "http_version",
metricType: metrics.Gauge,
tags: ts.tags,
}
ms.store[httpVersionTS] = value{newValue, 1}
log.Debugf("Created %q from %q", httpVersionTS.name, ts.name)
}()

// Rename to http_requests_failed_total
case "http_req_failed":
newTS := ts
Expand Down

0 comments on commit 980c3ba

Please sign in to comment.