Skip to content

Commit

Permalink
Add support for logs OLTP route (#714)
Browse files Browse the repository at this point in the history
  • Loading branch information
periklis committed Jul 31, 2024
1 parent 542818a commit 7ae225e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion api/logs/v1/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ const (
volumeRoute = "/loki/api/v1/index/volume"
volumeRangeRoute = "/loki/api/v1/index/volume_range"

otlpRoute = "/otlp/v1/logs"
pushRoute = "/loki/api/v1/push"

prometheusRulesRoute = "/prometheus/api/v1/rules"
prometheusAlertsRoute = "/prometheus/api/v1/alerts"

Expand Down Expand Up @@ -396,7 +399,10 @@ func NewHandler(read, tail, write, rules *url.URL, rulesReadOnly bool, tlsOption
}
r.Group(func(r chi.Router) {
r.Use(c.writeMiddlewares...)
const pushRoute = "/loki/api/v1/push"
r.Handle(otlpRoute, c.instrument.NewHandler(
prometheus.Labels{"group": "logsv1", "handler": "otlp"},
otelhttp.WithRouteTag(c.spanRoutePrefix+otlpRoute, proxyWrite),
))
r.Handle(pushRoute, c.instrument.NewHandler(
prometheus.Labels{"group": "logsv1", "handler": "push"},
otelhttp.WithRouteTag(c.spanRoutePrefix+pushRoute, proxyWrite),
Expand Down

0 comments on commit 7ae225e

Please sign in to comment.