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.

chore: cloud integrations: include cloud account id in account status response (#6833)

Raj Kamal Singh8e11a988be13
diff --git a/pkg/query-service/app/cloudintegrations/controller.go b/pkg/query-service/app/cloudintegrations/controller.go
index 23b8c9ac74..04b0407847 100644
--- a/pkg/query-service/app/cloudintegrations/controller.go
+++ b/pkg/query-service/app/cloudintegrations/controller.go
@@ -127,8 +127,9 @@ func (c *Controller) GenerateConnectionUrl(
}
type AccountStatusResponse struct {
- Id string `json:"id"`
- Status AccountStatus `json:"status"`
+ Id string `json:"id"`
+ CloudAccountId *string `json:"cloud_account_id,omitempty"`
+ Status AccountStatus `json:"status"`
}
func (c *Controller) GetAccountStatus(
@@ -146,8 +147,9 @@ func (c *Controller) GetAccountStatus(
}
resp := AccountStatusResponse{
- Id: account.Id,
- Status: account.status(),
+ Id: account.Id,
+ CloudAccountId: account.CloudAccountId,
+ Status: account.status(),
}
return &resp, nil
diff --git a/pkg/query-service/tests/integration/signoz_cloud_integrations_test.go b/pkg/query-service/tests/integration/signoz_cloud_integrations_test.go
index 55f337742d..07424b1816 100644
--- a/pkg/query-service/tests/integration/signoz_cloud_integrations_test.go
+++ b/pkg/query-service/tests/integration/signoz_cloud_integrations_test.go
@@ -52,6 +52,7 @@ func TestAWSIntegrationAccountLifecycle(t *testing.T) {
accountStatusResp := testbed.GetAccountStatusFromQS("aws", testAccountId)
require.Equal(testAccountId, accountStatusResp.Id)
require.Nil(accountStatusResp.Status.Integration.LastHeartbeatTsMillis)
+ require.Nil(accountStatusResp.CloudAccountId)
// The unconnected account should not show up in connected accounts list yet
accountsListResp1 := testbed.GetConnectedAccountsListFromQS("aws")
@@ -75,6 +76,8 @@ func TestAWSIntegrationAccountLifecycle(t *testing.T) {
// Polling for connection status from UI should now return latest status
accountStatusResp1 := testbed.GetAccountStatusFromQS("aws", testAccountId)
require.Equal(testAccountId, accountStatusResp1.Id)
+ require.NotNil(accountStatusResp1.CloudAccountId)
+ require.Equal(testAWSAccountId, *accountStatusResp1.CloudAccountId)
require.NotNil(accountStatusResp1.Status.Integration.LastHeartbeatTsMillis)
require.LessOrEqual(
tsMillisBeforeAgentCheckIn,