Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: pass metric prefix to handler for consistency with otlp (backport #15444) #15515

Merged
merged 2 commits into from
Jan 31, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions internal/beater/api/mux.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func NewMux(
{AgentConfigRUMPath, builder.rumAgentConfigHandler(fetcher, meterProvider)},
{IntakeRUMPath, rumIntakeHandler},
{IntakeRUMV3Path, rumIntakeHandler},
{IntakePath, builder.backendIntakeHandler(meterProvider)},
{IntakePath, builder.backendIntakeHandler("apm-server.server.", meterProvider)},
{OTLPTracesIntakePath, builder.otlpHandler(otlpHandlers.HandleTraces, "apm-server.otlp.http.traces.", meterProvider)},
{OTLPMetricsIntakePath, builder.otlpHandler(otlpHandlers.HandleMetrics, "apm-server.otlp.http.metrics.", meterProvider)},
{OTLPLogsIntakePath, builder.otlpHandler(otlpHandlers.HandleLogs, "apm-server.otlp.http.logs.", meterProvider)},
Expand Down Expand Up @@ -171,10 +171,10 @@ type routeBuilder struct {
intakeSemaphore input.Semaphore
}

func (r *routeBuilder) backendIntakeHandler(mp metric.MeterProvider) func() (request.Handler, error) {
func (r *routeBuilder) backendIntakeHandler(metricsPrefix string, mp metric.MeterProvider) func() (request.Handler, error) {
return func() (request.Handler, error) {
h := intake.Handler(mp, r.intakeProcessor, backendRequestMetadataFunc(r.cfg), r.batchProcessor)
return middleware.Wrap(h, backendMiddleware(r.cfg, r.authenticator, r.ratelimitStore, "apm-server.server.", mp)...)
return middleware.Wrap(h, backendMiddleware(r.cfg, r.authenticator, r.ratelimitStore, metricsPrefix, mp)...)
}
}

Expand Down
Loading