Skip to content

Commit

Permalink
Add Loki Volume API (#722)
Browse files Browse the repository at this point in the history
  • Loading branch information
jatinsu authored Jul 2, 2024
1 parent 597f7a4 commit 40f9a39
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions api/logs/v1/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ const (
rulesRoute = "/loki/api/v1/rules"
rulesPerNamespaceRoute = "/loki/api/v1/rules/{namespace}"
rulesPerGroupNameRoute = "/loki/api/v1/rules/{namespace}/{groupName}"
volumeRoute = "/loki/api/v1/index/volume"
volumeRangeRoute = "/loki/api/v1/index/volume_range"

prometheusRulesRoute = "/prometheus/api/v1/rules"
prometheusAlertsRoute = "/prometheus/api/v1/alerts"
Expand Down Expand Up @@ -199,6 +201,14 @@ func NewHandler(read, tail, write, rules *url.URL, rulesReadOnly bool, upstreamC
prometheus.Labels{"group": "logsv1", "handler": "labels"},
otelhttp.WithRouteTag(c.spanRoutePrefix+labelsRoute, proxyRead),
))
r.Handle(volumeRoute, c.instrument.NewHandler(
prometheus.Labels{"group": "logsv1", "handler": "volume"},
otelhttp.WithRouteTag(c.spanRoutePrefix+volumeRoute, proxyRead),
))
r.Handle(volumeRangeRoute, c.instrument.NewHandler(
prometheus.Labels{"group": "logsv1", "handler": "volume_range"},
otelhttp.WithRouteTag(c.spanRoutePrefix+volumeRangeRoute, proxyRead),
))
r.Handle(labelValuesRoute, c.instrument.NewHandler(
prometheus.Labels{"group": "logsv1", "handler": "label_values"},
otelhttp.WithRouteTag(c.spanRoutePrefix+labelValuesRoute, proxyRead),
Expand Down

0 comments on commit 40f9a39

Please sign in to comment.