Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

feat(statsreporter): open the stats endpoint to every authenticated caller (#13152)

Vikrant Gupta65ad9b5f38a2
diff --git a/docs/api/openapi.yml b/docs/api/openapi.yml
index e5066defae..3f048fe89b 100644
--- a/docs/api/openapi.yml
+++ b/docs/api/openapi.yml
@@ -16064,10 +16064,8 @@ paths:
$ref: '#/components/schemas/RenderErrorResponse'
description: Internal Server Error
security:
- - api_key:
- - VIEWER
- - tokenizer:
- - VIEWER
+ - api_key: []
+ - tokenizer: []
summary: Get stats
tags:
- stats
diff --git a/pkg/apiserver/signozapiserver/statsreporter.go b/pkg/apiserver/signozapiserver/statsreporter.go
index bcba58f1da..29d83fb828 100644
--- a/pkg/apiserver/signozapiserver/statsreporter.go
+++ b/pkg/apiserver/signozapiserver/statsreporter.go
@@ -4,13 +4,12 @@ import (
"net/http"
"github.com/SigNoz/signoz/pkg/http/handler"
- "github.com/SigNoz/signoz/pkg/types"
"github.com/gorilla/mux"
)
func (provider *provider) addStatsReporterRoutes(router *mux.Router) error {
if err := router.Handle("/api/v1/stats", handler.New(
- provider.authzMiddleware.ViewAccess(provider.statsHandler.Get),
+ provider.authzMiddleware.OpenAccess(provider.statsHandler.Get),
handler.OpenAPIDef{
ID: "GetStats",
Tags: []string{"stats"},
@@ -23,7 +22,7 @@ func (provider *provider) addStatsReporterRoutes(router *mux.Router) error {
SuccessStatusCode: http.StatusOK,
ErrorStatusCodes: []int{},
Deprecated: false,
- SecuritySchemes: newSecuritySchemes(types.RoleViewer),
+ SecuritySchemes: newScopedSecuritySchemes(nil),
},
)).Methods(http.MethodGet).GetError(); err != nil {
return err