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.

fix(dashboard): send public dashboard id on create (#9755)

Vikrant Gupta81167c694761
diff --git a/pkg/modules/dashboard/impldashboard/handler.go b/pkg/modules/dashboard/impldashboard/handler.go
index fffffeadf7..ff1ffa67ef 100644
--- a/pkg/modules/dashboard/impldashboard/handler.go
+++ b/pkg/modules/dashboard/impldashboard/handler.go
@@ -15,6 +15,7 @@ import (
"github.com/SigNoz/signoz/pkg/modules/dashboard"
"github.com/SigNoz/signoz/pkg/querier"
"github.com/SigNoz/signoz/pkg/transition"
+ "github.com/SigNoz/signoz/pkg/types"
"github.com/SigNoz/signoz/pkg/types/authtypes"
"github.com/SigNoz/signoz/pkg/types/ctxtypes"
"github.com/SigNoz/signoz/pkg/types/dashboardtypes"
@@ -244,7 +245,7 @@ func (handler *handler) CreatePublic(rw http.ResponseWriter, r *http.Request) {
return
}
- render.Success(rw, http.StatusCreated, nil)
+ render.Success(rw, http.StatusCreated, types.Identifiable{ID: publicDashboard.ID})
}
func (handler *handler) GetPublic(rw http.ResponseWriter, r *http.Request) {
diff --git a/tests/integration/src/dashboard/a_public_dashboard.py b/tests/integration/src/dashboard/a_public_dashboard.py
index 2d6d07f7b3..1752956e54 100644
--- a/tests/integration/src/dashboard/a_public_dashboard.py
+++ b/tests/integration/src/dashboard/a_public_dashboard.py
@@ -26,7 +26,6 @@ def test_create_and_get_public_dashboard(
):
admin_token = get_token(USER_ADMIN_EMAIL, USER_ADMIN_PASSWORD)
- # Get domains which should be an empty list
response = requests.post(
signoz.self.host_configs["8080"].get("/api/v1/dashboards"),
json={
@@ -54,6 +53,7 @@ def test_create_and_get_public_dashboard(
)
assert response.status_code == HTTPStatus.CREATED
+ assert "id" in response.json()["data"]
response = requests.get(
signoz.self.host_configs["8080"].get(f"/api/v1/dashboards/{id}/public"),