injectMuxVars uses the mux.SetVars method to add vars into the context that can be used by downstream handlers. a few Tempo endpoints rely on the mux routing package extracting vars from the request path. this method allows us to do the same for MCP tools.
(ctx context.Context, req *http.Request, vars map[string]string)
| 362 | // a few Tempo endpoints rely on the mux routing package extracting vars from the request path. this method allows |
| 363 | // us to do the same for MCP tools. |
| 364 | func injectMuxVars(ctx context.Context, req *http.Request, vars map[string]string) (*http.Request, context.Context) { |
| 365 | req = req.WithContext(ctx) |
| 366 | req = mux.SetURLVars(req, vars) |
| 367 | |
| 368 | return req, req.Context() |
| 369 | } |
| 370 | |
| 371 | // buildPath is a helper method to build a path with the path prefix |
| 372 | func (s *MCPServer) buildPath(p string) string { |