diff --git a/pkg/query-service/app/cloudintegrations/availableServices.go b/pkg/query-service/app/cloudintegrations/availableServices.go index f2cf7c8067..bf2262e7f8 100644 --- a/pkg/query-service/app/cloudintegrations/availableServices.go +++ b/pkg/query-service/app/cloudintegrations/availableServices.go @@ -190,18 +190,10 @@ func validateServiceDefinition(s *CloudServiceDetails) error { // Validate dashboard data seenDashboardIds := map[string]interface{}{} for _, dd := range s.Assets.Dashboards { - did, exists := dd["id"] - if !exists { - return fmt.Errorf("id is required. not specified in dashboard titled %v", dd["title"]) + if _, seen := seenDashboardIds[dd.Id]; seen { + return fmt.Errorf("multiple dashboards found with id %s", dd.Id) } - dashboardId, ok := did.(string) - if !ok { - return fmt.Errorf("id must be string in dashboard titled %v", dd["title"]) - } - if _, seen := seenDashboardIds[dashboardId]; seen { - return fmt.Errorf("multiple dashboards found with id %s", dashboardId) - } - seenDashboardIds[dashboardId] = nil + seenDashboardIds[dd.Id] = nil } if s.TelemetryCollectionStrategy == nil { diff --git a/pkg/query-service/app/cloudintegrations/controller.go b/pkg/query-service/app/cloudintegrations/controller.go index 7d7bab77bf..8f0d69194e 100644 --- a/pkg/query-service/app/cloudintegrations/controller.go +++ b/pkg/query-service/app/cloudintegrations/controller.go @@ -3,10 +3,13 @@ package cloudintegrations import ( "context" "fmt" + "net/url" "slices" + "strings" "time" "github.com/jmoiron/sqlx" + "go.signoz.io/signoz/pkg/query-service/app/dashboards" "go.signoz.io/signoz/pkg/query-service/model" "golang.org/x/exp/maps" ) @@ -120,12 +123,30 @@ func (c *Controller) GenerateConnectionUrl( return nil, model.WrapApiError(apiErr, "couldn't upsert cloud account") } - // TODO(Raj): Add actual cloudformation template for AWS integration after it has been shipped. + // TODO(Raj): parameterized this in follow up changes + agentVersion := "latest" + connectionUrl := fmt.Sprintf( - "https://%s.console.aws.amazon.com/cloudformation/home?region=%s#/stacks/quickcreate?stackName=SigNozIntegration/", + "https://%s.console.aws.amazon.com/cloudformation/home?region=%s#/stacks/quickcreate?", req.AgentConfig.Region, req.AgentConfig.Region, ) + for qp, value := range map[string]string{ + "param_SigNozIntegrationAgentVersion": agentVersion, + "param_SigNozApiUrl": req.AgentConfig.SigNozAPIUrl, + "param_SigNozApiKey": req.AgentConfig.SigNozAPIKey, + "param_SigNozAccountId": account.Id, + "param_IngestionUrl": req.AgentConfig.IngestionUrl, + "param_IngestionKey": req.AgentConfig.IngestionKey, + "stackName": "signoz-integration", + "templateURL": fmt.Sprintf( + "https://signoz-integrations.s3.us-east-1.amazonaws.com/aws-quickcreate-template-%s.json", + agentVersion, + ), + } { + connectionUrl += fmt.Sprintf("&%s=%s", qp, url.QueryEscape(value)) + } + return &GenerateConnectionUrlResponse{ AccountId: account.Id, ConnectionUrl: connectionUrl, @@ -403,6 +424,18 @@ func (c *Controller) GetServiceDetails( if config != nil { service.Config = config + + if config.Metrics != nil && config.Metrics.Enabled { + // add links to service dashboards, making them clickable. + for i, d := range service.Assets.Dashboards { + dashboardUuid := c.dashboardUuid( + cloudProvider, serviceId, d.Id, + ) + service.Assets.Dashboards[i].Url = fmt.Sprintf( + "/dashboard/%s", dashboardUuid, + ) + } + } } } @@ -456,3 +489,134 @@ func (c *Controller) UpdateServiceConfig( Config: *updatedConfig, }, nil } + +// All dashboards that are available based on cloud integrations configuration +// across all cloud providers +func (c *Controller) AvailableDashboards(ctx context.Context) ( + []dashboards.Dashboard, *model.ApiError, +) { + allDashboards := []dashboards.Dashboard{} + + for _, provider := range []string{"aws"} { + providerDashboards, apiErr := c.AvailableDashboardsForCloudProvider(ctx, provider) + if apiErr != nil { + return nil, model.WrapApiError( + apiErr, fmt.Sprintf("couldn't get available dashboards for %s", provider), + ) + } + + allDashboards = append(allDashboards, providerDashboards...) + } + + return allDashboards, nil +} + +func (c *Controller) AvailableDashboardsForCloudProvider( + ctx context.Context, cloudProvider string, +) ([]dashboards.Dashboard, *model.ApiError) { + + accountRecords, apiErr := c.accountsRepo.listConnected(ctx, cloudProvider) + if apiErr != nil { + return nil, model.WrapApiError(apiErr, "couldn't list connected cloud accounts") + } + + // for v0, service dashboards are only available when metrics are enabled. + servicesWithAvailableMetrics := map[string]*time.Time{} + + for _, ar := range accountRecords { + if ar.CloudAccountId != nil { + configsBySvcId, apiErr := c.serviceConfigRepo.getAllForAccount( + ctx, cloudProvider, *ar.CloudAccountId, + ) + if apiErr != nil { + return nil, apiErr + } + + for svcId, config := range configsBySvcId { + if config.Metrics != nil && config.Metrics.Enabled { + servicesWithAvailableMetrics[svcId] = &ar.CreatedAt + } + } + } + } + + allServices, apiErr := listCloudProviderServices(cloudProvider) + if apiErr != nil { + return nil, apiErr + } + + svcDashboards := []dashboards.Dashboard{} + for _, svc := range allServices { + serviceDashboardsCreatedAt := servicesWithAvailableMetrics[svc.Id] + if serviceDashboardsCreatedAt != nil { + for _, d := range svc.Assets.Dashboards { + isLocked := 1 + author := fmt.Sprintf("%s-integration", cloudProvider) + svcDashboards = append(svcDashboards, dashboards.Dashboard{ + Uuid: c.dashboardUuid(cloudProvider, svc.Id, d.Id), + Locked: &isLocked, + Data: *d.Definition, + CreatedAt: *serviceDashboardsCreatedAt, + CreateBy: &author, + UpdatedAt: *serviceDashboardsCreatedAt, + UpdateBy: &author, + }) + } + servicesWithAvailableMetrics[svc.Id] = nil + } + } + + return svcDashboards, nil +} +func (c *Controller) GetDashboardById( + ctx context.Context, + dashboardUuid string, +) (*dashboards.Dashboard, *model.ApiError) { + cloudProvider, _, _, apiErr := c.parseDashboardUuid(dashboardUuid) + if apiErr != nil { + return nil, apiErr + } + + allDashboards, apiErr := c.AvailableDashboardsForCloudProvider(ctx, cloudProvider) + if apiErr != nil { + return nil, model.WrapApiError( + apiErr, fmt.Sprintf("couldn't list available dashboards"), + ) + } + + for _, d := range allDashboards { + if d.Uuid == dashboardUuid { + return &d, nil + } + } + + return nil, model.NotFoundError(fmt.Errorf( + "couldn't find dashboard with uuid: %s", dashboardUuid, + )) +} + +func (c *Controller) dashboardUuid( + cloudProvider string, svcId string, dashboardId string, +) string { + return fmt.Sprintf( + "cloud-integration--%s--%s--%s", cloudProvider, svcId, dashboardId, + ) +} + +func (c *Controller) parseDashboardUuid(dashboardUuid string) ( + cloudProvider string, svcId string, dashboardId string, apiErr *model.ApiError, +) { + parts := strings.SplitN(dashboardUuid, "--", 4) + if len(parts) != 4 || parts[0] != "cloud-integration" { + return "", "", "", model.BadRequest(fmt.Errorf( + "invalid cloud integration dashboard id", + )) + } + + return parts[1], parts[2], parts[3], nil +} + +func (c *Controller) IsCloudIntegrationDashboardUuid(dashboardUuid string) bool { + _, _, _, apiErr := c.parseDashboardUuid(dashboardUuid) + return apiErr == nil +} diff --git a/pkg/query-service/app/cloudintegrations/model.go b/pkg/query-service/app/cloudintegrations/model.go index f64def30bb..909d13c5ab 100644 --- a/pkg/query-service/app/cloudintegrations/model.go +++ b/pkg/query-service/app/cloudintegrations/model.go @@ -183,7 +183,16 @@ type CloudServiceMetricsConfig struct { } type CloudServiceAssets struct { - Dashboards []dashboards.Data `json:"dashboards"` + Dashboards []CloudServiceDashboard `json:"dashboards"` +} + +type CloudServiceDashboard struct { + Id string `json:"id"` + Url string `json:"url"` + Title string `json:"title"` + Description string `json:"description"` + Image string `json:"image"` + Definition *dashboards.Data `json:"definition,omitempty"` } type SupportedSignals struct { diff --git a/pkg/query-service/app/cloudintegrations/serviceDefinitions/aws/ec2/assets/dashboards/overview.json b/pkg/query-service/app/cloudintegrations/serviceDefinitions/aws/ec2/assets/dashboards/overview.json new file mode 100644 index 0000000000..85d61f992f --- /dev/null +++ b/pkg/query-service/app/cloudintegrations/serviceDefinitions/aws/ec2/assets/dashboards/overview.json @@ -0,0 +1,884 @@ +{ + "description": "Overview of EC2 instances", + "image": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iODAwcHgiIGhlaWdodD0iODAwcHgiIHZpZXdCb3g9IjAgMCAxNiAxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBmaWxsPSJub25lIj4KICA8cGF0aCBmaWxsPSIjOUQ1MDI1IiBkPSJNMS43MDIgMi45OEwxIDMuMzEydjkuMzc2bC43MDIuMzMyIDIuODQyLTQuNzc3TDEuNzAyIDIuOTh6IiAvPgogIDxwYXRoIGZpbGw9IiNGNTg1MzYiIGQ9Ik0zLjMzOSAxMi42NTdsLTEuNjM3LjM2M1YyLjk4bDEuNjM3LjM1M3Y5LjMyNHoiIC8+CiAgPHBhdGggZmlsbD0iIzlENTAyNSIgZD0iTTIuNDc2IDIuNjEybC44NjMtLjQwNiA0LjA5NiA2LjIxNi00LjA5NiA1LjM3Mi0uODYzLS40MDZWMi42MTJ6IiAvPgogIDxwYXRoIGZpbGw9IiNGNTg1MzYiIGQ9Ik01LjM4IDEzLjI0OGwtMi4wNDEuNTQ2VjIuMjA2bDIuMDQuNTQ4djEwLjQ5NHoiIC8+CiAgPHBhdGggZmlsbD0iIzlENTAyNSIgZD0iTTQuMyAxLjc1bDEuMDgtLjUxMiA2LjA0MyA3Ljg2NC02LjA0MyA1LjY2LTEuMDgtLjUxMVYxLjc0OXoiIC8+CiAgPHBhdGggZmlsbD0iI0Y1ODUzNiIgZD0iTTcuOTk4IDEzLjg1NmwtMi42MTguOTA2VjEuMjM4bDIuNjE4LjkwOHYxMS43MXoiIC8+CiAgPHBhdGggZmlsbD0iIzlENTAyNSIgZD0iTTYuNjAyLjY2TDcuOTk4IDBsNi41MzggOC40NTNMNy45OTggMTZsLTEuMzk2LS42NlYuNjZ6IiAvPgogIDxwYXRoIGZpbGw9IiNGNTg1MzYiIGQ9Ik0xNSAxMi42ODZMNy45OTggMTZWMEwxNSAzLjMxNHY5LjM3MnoiIC8+Cjwvc3ZnPg==", + "layout": [ + { + "h": 6, + "i": "b7a8d21e-d0e9-42de-a83f-5399f37db96c", + "moved": false, + "static": false, + "w": 6, + "x": 0, + "y": 0 + }, + { + "h": 6, + "i": "24b502cc-8f30-4a72-9dce-b6ee4555643a", + "moved": false, + "static": false, + "w": 6, + "x": 6, + "y": 0 + }, + { + "h": 6, + "i": "87422d3b-4128-4450-a0fe-317dbdcb9f83", + "moved": false, + "static": false, + "w": 6, + "x": 0, + "y": 6 + }, + { + "h": 6, + "i": "676c985b-de96-490f-ae1c-b2843deba7f8", + "moved": false, + "static": false, + "w": 6, + "x": 6, + "y": 6 + }, + { + "h": 6, + "i": "1f0c2eea-3f63-4c38-93e1-eff6d3981dfd", + "moved": false, + "static": false, + "w": 6, + "x": 0, + "y": 12 + }, + { + "h": 6, + "i": "0548fe05-e13d-4110-b012-013b675f690f", + "moved": false, + "static": false, + "w": 6, + "x": 6, + "y": 12 + } + ], + "panelMap": {}, + "tags": [], + "title": "EC2 Overview", + "uploadedGrafana": false, + "variables": { + "1de21552-5c52-4484-ad9f-065ec51fd8e9": { + "allSelected": false, + "customValue": "", + "description": "AWS Account", + "id": "1de21552-5c52-4484-ad9f-065ec51fd8e9", + "key": "1de21552-5c52-4484-ad9f-065ec51fd8e9", + "modificationUUID": "a48382b3-010e-45e1-8e77-a6a3f5e8d138", + "multiSelect": false, + "name": "Account", + "order": 0, + "queryValue": "SELECT JSONExtractString(labels, 'cloud_account_id') as cloud_account_id\nFROM signoz_metrics.distributed_time_series_v4_1day\nWHERE \n metric_name like 'CPUUtilization'\n and JSONExtractString(labels, 'cloud_provider') like 'aws'\n and JSONExtractString(labels, 'service_name') like 'EC2'\nGROUP BY cloud_account_id", + "showALLOption": false, + "sort": "DISABLED", + "textboxValue": "", + "type": "QUERY" + }, + "d4088f55-111c-479c-84bd-445dce8ba210": { + "allSelected": false, + "customValue": "", + "description": "AWS Region", + "id": "d4088f55-111c-479c-84bd-445dce8ba210", + "modificationUUID": "fc1b8b85-dfa9-4250-a04a-ff77bca0398c", + "multiSelect": false, + "name": "Region", + "order": 0, + "queryValue": "SELECT JSONExtractString(labels, 'cloud_region') as cloud_region\nFROM signoz_metrics.distributed_time_series_v4_1day\nWHERE \n metric_name like 'CPUUtilization'\n and JSONExtractString(labels, 'cloud_account_id') IN {{.Account}}\n and JSONExtractString(labels, 'cloud_provider') like 'aws'\n and JSONExtractString(labels, 'service_name') like 'EC2'\nGROUP BY cloud_region", + "showALLOption": false, + "sort": "DISABLED", + "textboxValue": "", + "type": "QUERY" + } + }, + "version": "v4", + "widgets": [ + { + "bucketCount": 30, + "bucketWidth": 0, + "columnUnits": {}, + "description": "", + "fillSpans": false, + "id": "b7a8d21e-d0e9-42de-a83f-5399f37db96c", + "isStacked": false, + "mergeAllActiveQueries": false, + "nullZeroValues": "zero", + "opacity": "1", + "panelTypes": "graph", + "query": { + "builder": { + "queryData": [ + { + "aggregateAttribute": { + "dataType": "float64", + "id": "CPUUtilization_count--float64--Sum--true", + "isColumn": true, + "isJSON": false, + "key": "CPUUtilization_count", + "type": "Sum" + }, + "aggregateOperator": "increase", + "dataSource": "metrics", + "disabled": false, + "expression": "B", + "filters": { + "items": [], + "op": "AND" + }, + "functions": [], + "groupBy": [ + { + "dataType": "string", + "id": "service_instance_id--string--tag--false", + "isColumn": false, + "isJSON": false, + "key": "service_instance_id", + "type": "tag" + } + ], + "having": [], + "legend": "", + "limit": null, + "orderBy": [], + "queryName": "B", + "reduceTo": "avg", + "spaceAggregation": "max", + "stepInterval": 60, + "timeAggregation": "increase" + } + ], + "queryFormulas": [] + }, + "clickhouse_sql": [ + { + "disabled": false, + "legend": "", + "name": "A", + "query": "" + } + ], + "id": "c933d8b2-036b-4a64-8935-6c253c1da6a3", + "promql": [ + { + "disabled": false, + "legend": "{{service_instance_id}} ", + "name": "A", + "query": "CPUUtilization{cloud_provider=\"aws\",cloud_account_id=\"$Account\",cloud_region=\"$Region\",service_name=\"EC2\", service_instance_id!=\"\",quantile=\"1\"}" + } + ], + "queryType": "promql" + }, + "selectedLogFields": [ + { + "dataType": "string", + "name": "body", + "type": "" + }, + { + "dataType": "string", + "name": "timestamp", + "type": "" + } + ], + "selectedTracesFields": [ + { + "dataType": "string", + "id": "serviceName--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "serviceName", + "type": "tag" + }, + { + "dataType": "string", + "id": "name--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "name", + "type": "tag" + }, + { + "dataType": "float64", + "id": "durationNano--float64--tag--true", + "isColumn": true, + "isJSON": false, + "key": "durationNano", + "type": "tag" + }, + { + "dataType": "string", + "id": "httpMethod--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "httpMethod", + "type": "tag" + }, + { + "dataType": "string", + "id": "responseStatusCode--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "responseStatusCode", + "type": "tag" + } + ], + "softMax": 0, + "softMin": 0, + "stackedBarChart": false, + "thresholds": [], + "timePreferance": "GLOBAL_TIME", + "title": "CPU Utilization", + "yAxisUnit": "percent" + }, + { + "bucketCount": 30, + "bucketWidth": 0, + "columnUnits": {}, + "description": "Percentage of available CPU credits that were utilizaed", + "fillSpans": false, + "id": "24b502cc-8f30-4a72-9dce-b6ee4555643a", + "isStacked": false, + "mergeAllActiveQueries": false, + "nullZeroValues": "zero", + "opacity": "1", + "panelTypes": "graph", + "query": { + "builder": { + "queryData": [ + { + "aggregateAttribute": { + "dataType": "", + "id": "CPUCredit------false", + "isColumn": false, + "key": "CPUCredit", + "type": "" + }, + "aggregateOperator": "count", + "dataSource": "metrics", + "disabled": false, + "expression": "A", + "filters": { + "items": [], + "op": "AND" + }, + "functions": [], + "groupBy": [], + "having": [], + "legend": "", + "limit": null, + "orderBy": [], + "queryName": "A", + "reduceTo": "avg", + "spaceAggregation": "", + "stepInterval": 60, + "timeAggregation": "" + } + ], + "queryFormulas": [] + }, + "clickhouse_sql": [ + { + "disabled": false, + "legend": "", + "name": "A", + "query": "" + } + ], + "id": "d97f6a4d-f66e-4688-9daf-172f24c87984", + "promql": [ + { + "disabled": false, + "legend": "{{service_instance_id}}", + "name": "A", + "query": "CPUCreditUsage{cloud_provider=\"aws\",cloud_account_id=\"$Account\",cloud_region=\"$Region\",service_name=\"EC2\", service_instance_id!=\"\",quantile=\"1\"}" + } + ], + "queryType": "promql" + }, + "selectedLogFields": [ + { + "dataType": "string", + "name": "body", + "type": "" + }, + { + "dataType": "string", + "name": "timestamp", + "type": "" + } + ], + "selectedTracesFields": [ + { + "dataType": "string", + "id": "serviceName--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "serviceName", + "type": "tag" + }, + { + "dataType": "string", + "id": "name--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "name", + "type": "tag" + }, + { + "dataType": "float64", + "id": "durationNano--float64--tag--true", + "isColumn": true, + "isJSON": false, + "key": "durationNano", + "type": "tag" + }, + { + "dataType": "string", + "id": "httpMethod--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "httpMethod", + "type": "tag" + }, + { + "dataType": "string", + "id": "responseStatusCode--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "responseStatusCode", + "type": "tag" + } + ], + "softMax": 0, + "softMin": 0, + "stackedBarChart": false, + "thresholds": [], + "timePreferance": "GLOBAL_TIME", + "title": "CPU Credits Utilization", + "yAxisUnit": "percentunit" + }, + { + "bucketCount": 30, + "bucketWidth": 0, + "columnUnits": {}, + "description": "", + "fillSpans": false, + "id": "676c985b-de96-490f-ae1c-b2843deba7f8", + "isStacked": false, + "mergeAllActiveQueries": false, + "nullZeroValues": "zero", + "opacity": "1", + "panelTypes": "graph", + "query": { + "builder": { + "queryData": [ + { + "aggregateAttribute": { + "dataType": "", + "id": "EBSRea------false", + "isColumn": false, + "key": "EBSRea", + "type": "" + }, + "aggregateOperator": "count", + "dataSource": "metrics", + "disabled": false, + "expression": "A", + "filters": { + "items": [], + "op": "AND" + }, + "functions": [], + "groupBy": [], + "having": [], + "legend": "", + "limit": null, + "orderBy": [], + "queryName": "A", + "reduceTo": "avg", + "spaceAggregation": "", + "stepInterval": 60, + "timeAggregation": "" + } + ], + "queryFormulas": [] + }, + "clickhouse_sql": [ + { + "disabled": false, + "legend": "", + "name": "A", + "query": "" + } + ], + "id": "8267701a-10e4-4405-bb1c-53f0dba4b711", + "promql": [ + { + "disabled": false, + "legend": "{{service_instance_id}} - Reads", + "name": "A", + "query": "EBSReadOps{cloud_provider=\"aws\",cloud_account_id=\"$Account\",cloud_region=\"$Region\",service_name=\"EC2\", service_instance_id!=\"\",quantile=\"1\"}" + }, + { + "disabled": false, + "legend": "{{service_instance_id}} - Writes", + "name": "B", + "query": "EBSWriteOps{cloud_provider=\"aws\",cloud_account_id=\"$Account\",cloud_region=\"$Region\",service_name=\"EC2\", service_instance_id!=\"\",quantile=\"1\"}" + } + ], + "queryType": "promql" + }, + "selectedLogFields": [ + { + "dataType": "string", + "name": "body", + "type": "" + }, + { + "dataType": "string", + "name": "timestamp", + "type": "" + } + ], + "selectedTracesFields": [ + { + "dataType": "string", + "id": "serviceName--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "serviceName", + "type": "tag" + }, + { + "dataType": "string", + "id": "name--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "name", + "type": "tag" + }, + { + "dataType": "float64", + "id": "durationNano--float64--tag--true", + "isColumn": true, + "isJSON": false, + "key": "durationNano", + "type": "tag" + }, + { + "dataType": "string", + "id": "httpMethod--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "httpMethod", + "type": "tag" + }, + { + "dataType": "string", + "id": "responseStatusCode--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "responseStatusCode", + "type": "tag" + } + ], + "softMax": 0, + "softMin": 0, + "stackedBarChart": false, + "thresholds": [], + "timePreferance": "GLOBAL_TIME", + "title": "EBS Ops", + "yAxisUnit": "none" + }, + { + "bucketCount": 30, + "bucketWidth": 0, + "columnUnits": {}, + "description": "", + "fillSpans": false, + "id": "87422d3b-4128-4450-a0fe-317dbdcb9f83", + "isStacked": false, + "mergeAllActiveQueries": false, + "nullZeroValues": "zero", + "opacity": "1", + "panelTypes": "graph", + "query": { + "builder": { + "queryData": [ + { + "aggregateAttribute": { + "dataType": "", + "id": "EBS------false", + "isColumn": false, + "key": "EBS", + "type": "" + }, + "aggregateOperator": "count", + "dataSource": "metrics", + "disabled": false, + "expression": "A", + "filters": { + "items": [], + "op": "AND" + }, + "functions": [], + "groupBy": [], + "having": [], + "legend": "", + "limit": null, + "orderBy": [], + "queryName": "A", + "reduceTo": "avg", + "spaceAggregation": "", + "stepInterval": 60, + "timeAggregation": "" + } + ], + "queryFormulas": [] + }, + "clickhouse_sql": [ + { + "disabled": false, + "legend": "", + "name": "A", + "query": "" + } + ], + "id": "0cf58200-a2bc-4a08-ab41-7b2a7d2ec92e", + "promql": [ + { + "disabled": false, + "legend": "{{service_instance_id}} - Reads", + "name": "A", + "query": "EBSReadBytes{cloud_provider=\"aws\",cloud_account_id=\"$Account\",cloud_region=\"$Region\",service_name=\"EC2\", service_instance_id!=\"\",quantile=\"1\"}" + }, + { + "disabled": false, + "legend": "{{service_instance_id}} - Writes", + "name": "B", + "query": "EBSWriteBytes{cloud_provider=\"aws\",cloud_account_id=\"$Account\",cloud_region=\"$Region\",service_name=\"EC2\", service_instance_id!=\"\",quantile=\"1\"}" + } + ], + "queryType": "promql" + }, + "selectedLogFields": [ + { + "dataType": "string", + "name": "body", + "type": "" + }, + { + "dataType": "string", + "name": "timestamp", + "type": "" + } + ], + "selectedTracesFields": [ + { + "dataType": "string", + "id": "serviceName--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "serviceName", + "type": "tag" + }, + { + "dataType": "string", + "id": "name--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "name", + "type": "tag" + }, + { + "dataType": "float64", + "id": "durationNano--float64--tag--true", + "isColumn": true, + "isJSON": false, + "key": "durationNano", + "type": "tag" + }, + { + "dataType": "string", + "id": "httpMethod--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "httpMethod", + "type": "tag" + }, + { + "dataType": "string", + "id": "responseStatusCode--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "responseStatusCode", + "type": "tag" + } + ], + "softMax": 0, + "softMin": 0, + "stackedBarChart": false, + "thresholds": [], + "timePreferance": "GLOBAL_TIME", + "title": "EBS Read/Write Bytes", + "yAxisUnit": "binBps" + }, + { + "bucketCount": 30, + "bucketWidth": 0, + "columnUnits": {}, + "description": "", + "fillSpans": false, + "id": "1f0c2eea-3f63-4c38-93e1-eff6d3981dfd", + "isStacked": false, + "mergeAllActiveQueries": false, + "nullZeroValues": "zero", + "opacity": "1", + "panelTypes": "graph", + "query": { + "builder": { + "queryData": [ + { + "aggregateAttribute": { + "dataType": "", + "id": "------false", + "isColumn": false, + "key": "", + "type": "" + }, + "aggregateOperator": "count", + "dataSource": "metrics", + "disabled": false, + "expression": "A", + "filters": { + "items": [], + "op": "AND" + }, + "functions": [], + "groupBy": [], + "having": [], + "legend": "", + "limit": null, + "orderBy": [], + "queryName": "A", + "reduceTo": "avg", + "spaceAggregation": "", + "stepInterval": 60, + "timeAggregation": "" + } + ], + "queryFormulas": [] + }, + "clickhouse_sql": [ + { + "disabled": false, + "legend": "", + "name": "A", + "query": "" + } + ], + "id": "6378c4a2-d0fd-485f-a768-89910ff2d934", + "promql": [ + { + "disabled": false, + "legend": "{{service_instance_id}}", + "name": "A", + "query": "NetworkIn{cloud_provider=\"aws\",cloud_account_id=\"$Account\",cloud_region=\"$Region\",service_name=\"EC2\", service_instance_id!=\"\",quantile=\"1\"}" + } + ], + "queryType": "promql" + }, + "selectedLogFields": [ + { + "dataType": "string", + "name": "body", + "type": "" + }, + { + "dataType": "string", + "name": "timestamp", + "type": "" + } + ], + "selectedTracesFields": [ + { + "dataType": "string", + "id": "serviceName--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "serviceName", + "type": "tag" + }, + { + "dataType": "string", + "id": "name--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "name", + "type": "tag" + }, + { + "dataType": "float64", + "id": "durationNano--float64--tag--true", + "isColumn": true, + "isJSON": false, + "key": "durationNano", + "type": "tag" + }, + { + "dataType": "string", + "id": "httpMethod--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "httpMethod", + "type": "tag" + }, + { + "dataType": "string", + "id": "responseStatusCode--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "responseStatusCode", + "type": "tag" + } + ], + "softMax": 0, + "softMin": 0, + "stackedBarChart": false, + "thresholds": [], + "timePreferance": "GLOBAL_TIME", + "title": "Network Incoming", + "yAxisUnit": "binBps" + }, + { + "bucketCount": 30, + "bucketWidth": 0, + "columnUnits": {}, + "description": "", + "fillSpans": false, + "id": "0548fe05-e13d-4110-b012-013b675f690f", + "isStacked": false, + "mergeAllActiveQueries": false, + "nullZeroValues": "zero", + "opacity": "1", + "panelTypes": "graph", + "query": { + "builder": { + "queryData": [ + { + "aggregateAttribute": { + "dataType": "", + "id": "------false", + "isColumn": false, + "key": "", + "type": "" + }, + "aggregateOperator": "count", + "dataSource": "metrics", + "disabled": false, + "expression": "A", + "filters": { + "items": [], + "op": "AND" + }, + "functions": [], + "groupBy": [], + "having": [], + "legend": "", + "limit": null, + "orderBy": [], + "queryName": "A", + "reduceTo": "avg", + "spaceAggregation": "", + "stepInterval": 60, + "timeAggregation": "" + } + ], + "queryFormulas": [] + }, + "clickhouse_sql": [ + { + "disabled": false, + "legend": "", + "name": "A", + "query": "" + } + ], + "id": "5c1479bc-1e10-4643-b797-006e97f42b6d", + "promql": [ + { + "disabled": false, + "legend": "{{service_instance_id}}", + "name": "A", + "query": "NetworkOut{cloud_provider=\"aws\",cloud_account_id=\"$Account\",cloud_region=\"$Region\",service_name=\"EC2\", service_instance_id!=\"\",quantile=\"1\"}" + } + ], + "queryType": "promql" + }, + "selectedLogFields": [ + { + "dataType": "string", + "name": "body", + "type": "" + }, + { + "dataType": "string", + "name": "timestamp", + "type": "" + } + ], + "selectedTracesFields": [ + { + "dataType": "string", + "id": "serviceName--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "serviceName", + "type": "tag" + }, + { + "dataType": "string", + "id": "name--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "name", + "type": "tag" + }, + { + "dataType": "float64", + "id": "durationNano--float64--tag--true", + "isColumn": true, + "isJSON": false, + "key": "durationNano", + "type": "tag" + }, + { + "dataType": "string", + "id": "httpMethod--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "httpMethod", + "type": "tag" + }, + { + "dataType": "string", + "id": "responseStatusCode--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "responseStatusCode", + "type": "tag" + } + ], + "softMax": 0, + "softMin": 0, + "stackedBarChart": false, + "thresholds": [], + "timePreferance": "GLOBAL_TIME", + "title": "Network Outgoing", + "yAxisUnit": "binBps" + } + ] +} \ No newline at end of file diff --git a/pkg/query-service/app/cloudintegrations/serviceDefinitions/aws/ec2/assets/dashboards/overview.png b/pkg/query-service/app/cloudintegrations/serviceDefinitions/aws/ec2/assets/dashboards/overview.png new file mode 100644 index 0000000000..fd2740c294 Binary files /dev/null and b/pkg/query-service/app/cloudintegrations/serviceDefinitions/aws/ec2/assets/dashboards/overview.png differ diff --git a/pkg/query-service/app/cloudintegrations/serviceDefinitions/aws/ec2/integration.json b/pkg/query-service/app/cloudintegrations/serviceDefinitions/aws/ec2/integration.json index e9ef4944d8..7a96405c16 100644 --- a/pkg/query-service/app/cloudintegrations/serviceDefinitions/aws/ec2/integration.json +++ b/pkg/query-service/app/cloudintegrations/serviceDefinitions/aws/ec2/integration.json @@ -3,9 +3,6 @@ "title": "EC2", "icon": "file://icon.svg", "overview": "file://overview.md", - "assets": { - "dashboards": [] - }, "supported_signals": { "metrics": true, "logs": false @@ -13,16 +10,346 @@ "data_collected": { "metrics": [ { - "name": "ec2_cpuutilization_average", - "type": "Gauge", - "unit": "number", - "description": "CloudWatch metric CPUUtilization" + "name": "CPUCreditBalance", + "unit": "Count", + "type": "Summary", + "description": "" }, { - "name": "ec2_cpuutilization_maximum", - "type": "Gauge", - "unit": "number", - "description": "CloudWatch metric CPUUtilization" + "name": "CPUCreditBalance_count", + "unit": "Count", + "type": "Sum", + "description": "" + }, + { + "name": "CPUCreditBalance_sum", + "unit": "Count", + "type": "Sum", + "description": "" + }, + { + "name": "CPUCreditUsage", + "unit": "Count", + "type": "Summary", + "description": "" + }, + { + "name": "CPUCreditUsage_count", + "unit": "Count", + "type": "Sum", + "description": "" + }, + { + "name": "CPUCreditUsage_sum", + "unit": "Count", + "type": "Sum", + "description": "" + }, + { + "name": "CPUSurplusCreditBalance", + "unit": "Count", + "type": "Summary", + "description": "" + }, + { + "name": "CPUSurplusCreditBalance_count", + "unit": "Count", + "type": "Sum", + "description": "" + }, + { + "name": "CPUSurplusCreditBalance_sum", + "unit": "Count", + "type": "Sum", + "description": "" + }, + { + "name": "CPUSurplusCreditsCharged", + "unit": "Count", + "type": "Summary", + "description": "" + }, + { + "name": "CPUSurplusCreditsCharged_count", + "unit": "Count", + "type": "Sum", + "description": "" + }, + { + "name": "CPUSurplusCreditsCharged_sum", + "unit": "Count", + "type": "Sum", + "description": "" + }, + { + "name": "CPUUtilization", + "unit": "Percent", + "type": "Summary", + "description": "" + }, + { + "name": "CPUUtilization_count", + "unit": "Percent", + "type": "Sum", + "description": "" + }, + { + "name": "CPUUtilization_sum", + "unit": "Percent", + "type": "Sum", + "description": "" + }, + { + "name": "EBSByteBalance_", + "unit": "Percent", + "type": "Summary", + "description": "" + }, + { + "name": "EBSByteBalance__count", + "unit": "Percent", + "type": "Sum", + "description": "" + }, + { + "name": "EBSByteBalance__sum", + "unit": "Percent", + "type": "Sum", + "description": "" + }, + { + "name": "EBSIOBalance_", + "unit": "Percent", + "type": "Summary", + "description": "" + }, + { + "name": "EBSIOBalance__count", + "unit": "Percent", + "type": "Sum", + "description": "" + }, + { + "name": "EBSIOBalance__sum", + "unit": "Percent", + "type": "Sum", + "description": "" + }, + { + "name": "EBSReadBytes", + "unit": "Bytes", + "type": "Summary", + "description": "" + }, + { + "name": "EBSReadBytes_count", + "unit": "Bytes", + "type": "Sum", + "description": "" + }, + { + "name": "EBSReadBytes_sum", + "unit": "Bytes", + "type": "Sum", + "description": "" + }, + { + "name": "EBSReadOps", + "unit": "Count", + "type": "Summary", + "description": "" + }, + { + "name": "EBSReadOps_count", + "unit": "Count", + "type": "Sum", + "description": "" + }, + { + "name": "EBSReadOps_sum", + "unit": "Count", + "type": "Sum", + "description": "" + }, + { + "name": "EBSWriteBytes", + "unit": "Bytes", + "type": "Summary", + "description": "" + }, + { + "name": "EBSWriteBytes_count", + "unit": "Bytes", + "type": "Sum", + "description": "" + }, + { + "name": "EBSWriteBytes_sum", + "unit": "Bytes", + "type": "Sum", + "description": "" + }, + { + "name": "EBSWriteOps", + "unit": "Count", + "type": "Summary", + "description": "" + }, + { + "name": "EBSWriteOps_count", + "unit": "Count", + "type": "Sum", + "description": "" + }, + { + "name": "EBSWriteOps_sum", + "unit": "Count", + "type": "Sum", + "description": "" + }, + { + "name": "MetadataNoToken", + "unit": "None", + "type": "Summary", + "description": "" + }, + { + "name": "MetadataNoToken_count", + "unit": "None", + "type": "Sum", + "description": "" + }, + { + "name": "MetadataNoToken_sum", + "unit": "None", + "type": "Sum", + "description": "" + }, + { + "name": "NetworkIn", + "unit": "Bytes", + "type": "Summary", + "description": "" + }, + { + "name": "NetworkIn_count", + "unit": "Bytes", + "type": "Sum", + "description": "" + }, + { + "name": "NetworkIn_sum", + "unit": "Bytes", + "type": "Sum", + "description": "" + }, + { + "name": "NetworkOut", + "unit": "Bytes", + "type": "Summary", + "description": "" + }, + { + "name": "NetworkOut_count", + "unit": "Bytes", + "type": "Sum", + "description": "" + }, + { + "name": "NetworkOut_sum", + "unit": "Bytes", + "type": "Sum", + "description": "" + }, + { + "name": "NetworkPacketsIn", + "unit": "Count", + "type": "Summary", + "description": "" + }, + { + "name": "NetworkPacketsIn_count", + "unit": "Count", + "type": "Sum", + "description": "" + }, + { + "name": "NetworkPacketsIn_sum", + "unit": "Count", + "type": "Sum", + "description": "" + }, + { + "name": "NetworkPacketsOut", + "unit": "Count", + "type": "Summary", + "description": "" + }, + { + "name": "NetworkPacketsOut_count", + "unit": "Count", + "type": "Sum", + "description": "" + }, + { + "name": "NetworkPacketsOut_sum", + "unit": "Count", + "type": "Sum", + "description": "" + }, + { + "name": "StatusCheckFailed", + "unit": "Count", + "type": "Summary", + "description": "" + }, + { + "name": "StatusCheckFailed_Instance", + "unit": "Count", + "type": "Summary", + "description": "" + }, + { + "name": "StatusCheckFailed_Instance_count", + "unit": "Count", + "type": "Sum", + "description": "" + }, + { + "name": "StatusCheckFailed_Instance_sum", + "unit": "Count", + "type": "Sum", + "description": "" + }, + { + "name": "StatusCheckFailed_System", + "unit": "Count", + "type": "Summary", + "description": "" + }, + { + "name": "StatusCheckFailed_System_count", + "unit": "Count", + "type": "Sum", + "description": "" + }, + { + "name": "StatusCheckFailed_System_sum", + "unit": "Count", + "type": "Sum", + "description": "" + }, + { + "name": "StatusCheckFailed_count", + "unit": "Count", + "type": "Sum", + "description": "" + }, + { + "name": "StatusCheckFailed_sum", + "unit": "Count", + "type": "Sum", + "description": "" } ], "logs": [] @@ -35,5 +362,16 @@ } ] } + }, + "assets": { + "dashboards": [ + { + "id": "overview", + "title": "EC2 Overview", + "description": "Overview of EC2", + "image": "file://assets/dashboards/overview.png", + "definition": "file://assets/dashboards/overview.json" + } + ] } } \ No newline at end of file diff --git a/pkg/query-service/app/cloudintegrations/serviceDefinitions/aws/rds/assets/dashboards/overview.json b/pkg/query-service/app/cloudintegrations/serviceDefinitions/aws/rds/assets/dashboards/overview.json new file mode 100644 index 0000000000..dcab95f4f1 --- /dev/null +++ b/pkg/query-service/app/cloudintegrations/serviceDefinitions/aws/rds/assets/dashboards/overview.json @@ -0,0 +1,1160 @@ +{ + "description": "Overview of RDS instances in a region", + "image": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iODBweCIgaGVpZ2h0PSI4MHB4IiB2aWV3Qm94PSIwIDAgODAgODAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4KICA8dGl0bGU+SWNvbi1BcmNoaXRlY3R1cmUvNjQvQXJjaF9BbWF6b24tUkRTXzY0PC90aXRsZT4KICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KICA8ZGVmcz4KICAgIDxsaW5lYXJHcmFkaWVudCB4MT0iMCUiIHkxPSIxMDAlIiB4Mj0iMTAwJSIgeTI9IjAlIiBpZD0ibGluZWFyR3JhZGllbnQtMSI+CiAgICAgIDxzdG9wIHN0b3AtY29sb3I9IiMyRTI3QUQiIG9mZnNldD0iMCUiPjwvc3RvcD4KICAgICAgPHN0b3Agc3RvcC1jb2xvcj0iIzUyN0ZGRiIgb2Zmc2V0PSIxMDAlIj48L3N0b3A+CiAgICA8L2xpbmVhckdyYWRpZW50PgogIDwvZGVmcz4KICA8ZyBpZD0iSWNvbi1BcmNoaXRlY3R1cmUvNjQvQXJjaF9BbWF6b24tUkRTXzY0IiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIKICAgIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICA8ZyBpZD0iSWNvbi1BcmNoaXRlY3R1cmUtQkcvNjQvRGF0YWJhc2UiIGZpbGw9InVybCgjbGluZWFyR3JhZGllbnQtMSkiPgogICAgICA8cmVjdCBpZD0iUmVjdGFuZ2xlIiB4PSIwIiB5PSIwIiB3aWR0aD0iODAiIGhlaWdodD0iODAiPjwvcmVjdD4KICAgIDwvZz4KICAgIDxwYXRoCiAgICAgIGQ9Ik0xNS40MTQsMTQgTDI0LjcwNywyMy4yOTMgTDIzLjI5MywyNC43MDcgTDE0LDE1LjQxNCBMMTQsMjMgTDEyLDIzIEwxMiwxMyBDMTIsMTIuNDQ4IDEyLjQ0NywxMiAxMywxMiBMMjMsMTIgTDIzLDE0IEwxNS40MTQsMTQgWiBNNjgsMTMgTDY4LDIzIEw2NiwyMyBMNjYsMTUuNDE0IEw1Ni43MDcsMjQuNzA3IEw1NS4yOTMsMjMuMjkzIEw2NC41ODYsMTQgTDU3LDE0IEw1NywxMiBMNjcsMTIgQzY3LjU1MywxMiA2OCwxMi40NDggNjgsMTMgTDY4LDEzIFogTTY2LDU3IEw2OCw1NyBMNjgsNjcgQzY4LDY3LjU1MiA2Ny41NTMsNjggNjcsNjggTDU3LDY4IEw1Nyw2NiBMNjQuNTg2LDY2IEw1NS4yOTMsNTYuNzA3IEw1Ni43MDcsNTUuMjkzIEw2Niw2NC41ODYgTDY2LDU3IFogTTY1LjUsMzkuMjEzIEM2NS41LDM1Ljg5NCA2MS42NjgsMzIuNjE1IDU1LjI1LDMwLjQ0MiBMNTUuODkxLDI4LjU0OCBDNjMuMjY4LDMxLjA0NSA2Ny41LDM0LjkzMiA2Ny41LDM5LjIxMyBDNjcuNSw0My40OTUgNjMuMjY4LDQ3LjM4MyA1NS44OSw0OS44NzkgTDU1LjI0OSw0Ny45ODQgQzYxLjY2OCw0NS44MTIgNjUuNSw0Mi41MzQgNjUuNSwzOS4yMTMgTDY1LjUsMzkuMjEzIFogTTE0LjU1NiwzOS4yMTMgQzE0LjU1Niw0Mi4zOTMgMTguMTQzLDQ1LjU4NSAyNC4xNTIsNDcuNzUzIEwyMy40NzMsNDkuNjM0IEMxNi41MzUsNDcuMTMxIDEyLjU1Niw0My4zMzMgMTIuNTU2LDM5LjIxMyBDMTIuNTU2LDM1LjA5NCAxNi41MzUsMzEuMjk2IDIzLjQ3MywyOC43OTIgTDI0LjE1MiwzMC42NzMgQzE4LjE0MywzMi44NDIgMTQuNTU2LDM2LjAzNCAxNC41NTYsMzkuMjEzIEwxNC41NTYsMzkuMjEzIFogTTI0LjcwNyw1Ni43MDcgTDE1LjQxNCw2NiBMMjMsNjYgTDIzLDY4IEwxMyw2OCBDMTIuNDQ3LDY4IDEyLDY3LjU1MiAxMiw2NyBMMTIsNTcgTDE0LDU3IEwxNCw2NC41ODYgTDIzLjI5Myw1NS4yOTMgTDI0LjcwNyw1Ni43MDcgWiBNNDAsMzEuMjg2IEMzMi44NTQsMzEuMjg2IDI5LDI5LjQ0IDI5LDI4LjY4NiBDMjksMjcuOTMxIDMyLjg1NCwyNi4wODYgNDAsMjYuMDg2IEM0Ny4xNDUsMjYuMDg2IDUxLDI3LjkzMSA1MSwyOC42ODYgQzUxLDI5LjQ0IDQ3LjE0NSwzMS4yODYgNDAsMzEuMjg2IEw0MCwzMS4yODYgWiBNNDAuMDI5LDM5LjAzMSBDMzMuMTg3LDM5LjAzMSAyOSwzNy4xNjIgMjksMzYuMTQ1IEwyOSwzMS4yODQgQzMxLjQ2MywzMi42NDMgMzUuODMyLDMzLjI4NiA0MCwzMy4yODYgQzQ0LjE2OCwzMy4yODYgNDguNTM3LDMyLjY0MyA1MSwzMS4yODQgTDUxLDM2LjE0NSBDNTEsMzcuMTYzIDQ2LjgzNSwzOS4wMzEgNDAuMDI5LDM5LjAzMSBMNDAuMDI5LDM5LjAzMSBaIE00MC4wMjksNDYuNjY3IEMzMy4xODcsNDYuNjY3IDI5LDQ0Ljc5OCAyOSw0My43ODEgTDI5LDM4Ljg2MiBDMzEuNDMxLDQwLjI5MSAzNS43NDIsNDEuMDMxIDQwLjAyOSw0MS4wMzEgQzQ0LjI5Miw0MS4wMzEgNDguNTc4LDQwLjI5MiA1MSwzOC44NjcgTDUxLDQzLjc4MSBDNTEsNDQuNzk5IDQ2LjgzNSw0Ni42NjcgNDAuMDI5LDQ2LjY2NyBMNDAuMDI5LDQ2LjY2NyBaIE00MCw1My41MTggQzMyLjg4Myw1My41MTggMjksNTEuNjA1IDI5LDUwLjYyMiBMMjksNDYuNDk4IEMzMS40MzEsNDcuOTI3IDM1Ljc0Miw0OC42NjcgNDAuMDI5LDQ4LjY2NyBDNDQuMjkyLDQ4LjY2NyA0OC41NzgsNDcuOTI5IDUxLDQ2LjUwMyBMNTEsNTAuNjIyIEM1MSw1MS42MDUgNDcuMTE3LDUzLjUxOCA0MCw1My41MTggTDQwLDUzLjUxOCBaIE00MCwyNC4wODYgQzMzLjczOSwyNC4wODYgMjcsMjUuNTI1IDI3LDI4LjY4NiBMMjcsNTAuNjIyIEMyNyw1My44MzYgMzMuNTQsNTUuNTE4IDQwLDU1LjUxOCBDNDYuNDYsNTUuNTE4IDUzLDUzLjgzNiA1Myw1MC42MjIgTDUzLDI4LjY4NiBDNTMsMjUuNTI1IDQ2LjI2MSwyNC4wODYgNDAsMjQuMDg2IEw0MCwyNC4wODYgWiIKICAgICAgaWQ9IkFtYXpvbi1SRFNfSWNvbl82NF9TcXVpZCIgZmlsbD0iI0ZGRkZGRiI+PC9wYXRoPgogIDwvZz4KPC9zdmc+", + "layout": [ + { + "h": 5, + "i": "85a58979-a0d5-4bea-8e8b-2141bbe9a3de", + "moved": false, + "static": false, + "w": 6, + "x": 0, + "y": 0 + }, + { + "h": 5, + "i": "d4dd7bc0-7fbd-4697-aed5-870de8dd26d8", + "moved": false, + "static": false, + "w": 6, + "x": 6, + "y": 0 + }, + { + "h": 5, + "i": "5145172f-69ce-4b9a-b96c-7e7c46c9435d", + "moved": false, + "static": false, + "w": 6, + "x": 0, + "y": 5 + }, + { + "h": 5, + "i": "935ce065-35bf-442b-be8a-df3231e53862", + "moved": false, + "static": false, + "w": 6, + "x": 6, + "y": 5 + }, + { + "h": 6, + "i": "ac41a973-1d06-44d6-9609-de0fa3211ae0", + "moved": false, + "static": false, + "w": 6, + "x": 0, + "y": 10 + }, + { + "h": 6, + "i": "b9bd5864-6317-43f6-af2a-f595c3206216", + "moved": false, + "static": false, + "w": 6, + "x": 6, + "y": 10 + }, + { + "h": 6, + "i": "ca60d14e-c0d1-4764-b24d-06fe7104ab50", + "moved": false, + "static": false, + "w": 6, + "x": 0, + "y": 16 + }, + { + "h": 6, + "i": "cadb30be-31f6-4cb9-ad75-6a3d140d4325", + "moved": false, + "static": false, + "w": 6, + "x": 6, + "y": 16 + } + ], + "panelMap": {}, + "tags": [], + "title": "RDS Overview", + "uploadedGrafana": false, + "variables": { + "Account": { + "allSelected": false, + "customValue": "", + "description": "AWS Account", + "id": "b3e3a481-f198-472c-9e3f-e38ebe3c4141", + "key": "b3e3a481-f198-472c-9e3f-e38ebe3c4141", + "modificationUUID": "0b1d4ccd-3722-4026-9a5d-a45e5023b8bb", + "multiSelect": false, + "name": "Account", + "order": 0, + "queryValue": "SELECT JSONExtractString(labels, 'cloud_account_id') as cloud_account_id\nFROM signoz_metrics.distributed_time_series_v4_1day\nWHERE \n metric_name like 'CPUUtilization'\n and JSONExtractString(labels, 'cloud_provider') like 'aws'\n and JSONExtractString(labels, 'service_name') like 'RDS'\nGROUP BY cloud_account_id", + "showALLOption": false, + "sort": "DISABLED", + "textboxValue": "", + "type": "QUERY" + }, + "Region": { + "allSelected": false, + "customValue": "", + "description": "AWS Region", + "id": "5aaf8d9a-deeb-4a36-8f01-70ee4afe86f6", + "key": "5aaf8d9a-deeb-4a36-8f01-70ee4afe86f6", + "modificationUUID": "75cf9374-61a8-4885-9fd9-6e003eb99f81", + "multiSelect": false, + "name": "Region", + "order": 1, + "queryValue": "SELECT JSONExtractString(labels, 'cloud_region') as cloud_region\nFROM signoz_metrics.distributed_time_series_v4_1day\nWHERE \n metric_name like 'CPUUtilization'\n and JSONExtractString(labels, 'cloud_account_id') IN {{.Account}}\n and JSONExtractString(labels, 'cloud_provider') like 'aws'\n and JSONExtractString(labels, 'service_name') like 'RDS'\nGROUP BY cloud_region", + "showALLOption": false, + "sort": "DISABLED", + "textboxValue": "", + "type": "QUERY" + } + }, + "version": "v4", + "widgets": [ + { + "bucketCount": 30, + "bucketWidth": 0, + "columnUnits": {}, + "description": "", + "fillSpans": false, + "id": "85a58979-a0d5-4bea-8e8b-2141bbe9a3de", + "isStacked": false, + "mergeAllActiveQueries": false, + "nullZeroValues": "zero", + "opacity": "1", + "panelTypes": "graph", + "query": { + "builder": { + "queryData": [ + { + "aggregateAttribute": { + "dataType": "", + "id": "------false", + "isColumn": false, + "isJSON": false, + "key": "", + "type": "" + }, + "aggregateOperator": "count", + "dataSource": "metrics", + "disabled": false, + "expression": "A", + "filters": { + "items": [], + "op": "AND" + }, + "functions": [], + "groupBy": [], + "having": [], + "legend": "", + "limit": null, + "orderBy": [], + "queryName": "A", + "reduceTo": "avg", + "spaceAggregation": "sum", + "stepInterval": 60, + "timeAggregation": "rate" + } + ], + "queryFormulas": [] + }, + "clickhouse_sql": [ + { + "disabled": false, + "legend": "", + "name": "A", + "query": "" + } + ], + "id": "a1ba90cd-81cf-492f-b387-760bf776ef03", + "promql": [ + { + "disabled": false, + "legend": "{{DBInstanceIdentifier}}", + "name": "A", + "query": "CPUUtilization{cloud_provider=\"aws\",cloud_account_id=\"$Account\",cloud_region=\"$Region\",service_name=\"RDS\", DBInstanceIdentifier!=\"\",quantile=\"1\"}" + } + ], + "queryType": "promql" + }, + "selectedLogFields": [ + { + "dataType": "string", + "name": "body", + "type": "" + }, + { + "dataType": "string", + "name": "timestamp", + "type": "" + } + ], + "selectedTracesFields": [ + { + "dataType": "string", + "id": "serviceName--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "serviceName", + "type": "tag" + }, + { + "dataType": "string", + "id": "name--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "name", + "type": "tag" + }, + { + "dataType": "float64", + "id": "durationNano--float64--tag--true", + "isColumn": true, + "isJSON": false, + "key": "durationNano", + "type": "tag" + }, + { + "dataType": "string", + "id": "httpMethod--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "httpMethod", + "type": "tag" + }, + { + "dataType": "string", + "id": "responseStatusCode--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "responseStatusCode", + "type": "tag" + } + ], + "softMax": 0, + "softMin": 0, + "stackedBarChart": false, + "thresholds": [], + "timePreferance": "GLOBAL_TIME", + "title": "CPU Utilization", + "yAxisUnit": "percent" + }, + { + "bucketCount": 30, + "bucketWidth": 0, + "columnUnits": {}, + "description": "The amount of available random access memory.\n\nFor MariaDB, MySQL, Oracle, and PostgreSQL DB instances, this metric reports the value of the MemAvailable field of /proc/meminfo.", + "fillSpans": false, + "id": "d4dd7bc0-7fbd-4697-aed5-870de8dd26d8", + "isStacked": false, + "mergeAllActiveQueries": false, + "nullZeroValues": "zero", + "opacity": "1", + "panelTypes": "graph", + "query": { + "builder": { + "queryData": [ + { + "aggregateAttribute": { + "dataType": "", + "id": "------false", + "isColumn": false, + "isJSON": false, + "key": "", + "type": "" + }, + "aggregateOperator": "count", + "dataSource": "metrics", + "disabled": false, + "expression": "A", + "filters": { + "items": [], + "op": "AND" + }, + "functions": [], + "groupBy": [], + "having": [], + "legend": "", + "limit": null, + "orderBy": [], + "queryName": "A", + "reduceTo": "avg", + "spaceAggregation": "sum", + "stepInterval": 60, + "timeAggregation": "rate" + } + ], + "queryFormulas": [] + }, + "clickhouse_sql": [ + { + "disabled": false, + "legend": "", + "name": "A", + "query": "" + } + ], + "id": "d5e59d39-8c7a-4614-8e20-651bf140eb80", + "promql": [ + { + "disabled": false, + "legend": "{{DBInstanceIdentifier}}", + "name": "A", + "query": "FreeableMemory{cloud_provider=\"aws\",cloud_account_id=\"$Account\",cloud_region=\"$Region\",service_name=\"RDS\", DBInstanceIdentifier!=\"\",quantile=\"1\"}" + } + ], + "queryType": "promql" + }, + "selectedLogFields": [ + { + "dataType": "string", + "name": "body", + "type": "" + }, + { + "dataType": "string", + "name": "timestamp", + "type": "" + } + ], + "selectedTracesFields": [ + { + "dataType": "string", + "id": "serviceName--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "serviceName", + "type": "tag" + }, + { + "dataType": "string", + "id": "name--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "name", + "type": "tag" + }, + { + "dataType": "float64", + "id": "durationNano--float64--tag--true", + "isColumn": true, + "isJSON": false, + "key": "durationNano", + "type": "tag" + }, + { + "dataType": "string", + "id": "httpMethod--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "httpMethod", + "type": "tag" + }, + { + "dataType": "string", + "id": "responseStatusCode--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "responseStatusCode", + "type": "tag" + } + ], + "softMax": 0, + "softMin": 0, + "stackedBarChart": false, + "thresholds": [], + "timePreferance": "GLOBAL_TIME", + "title": "Free Memory", + "yAxisUnit": "decbytes" + }, + { + "bucketCount": 30, + "bucketWidth": 0, + "columnUnits": {}, + "description": "", + "fillSpans": false, + "id": "cadb30be-31f6-4cb9-ad75-6a3d140d4325", + "isStacked": false, + "mergeAllActiveQueries": false, + "nullZeroValues": "zero", + "opacity": "1", + "panelTypes": "graph", + "query": { + "builder": { + "queryData": [ + { + "aggregateAttribute": { + "dataType": "", + "id": "------false", + "isColumn": false, + "key": "", + "type": "" + }, + "aggregateOperator": "count", + "dataSource": "metrics", + "disabled": false, + "expression": "A", + "filters": { + "items": [], + "op": "AND" + }, + "functions": [], + "groupBy": [], + "having": [], + "legend": "", + "limit": null, + "orderBy": [], + "queryName": "A", + "reduceTo": "avg", + "spaceAggregation": "", + "stepInterval": 60, + "timeAggregation": "" + } + ], + "queryFormulas": [] + }, + "clickhouse_sql": [ + { + "disabled": false, + "legend": "", + "name": "A", + "query": "" + } + ], + "id": "bd011f26-5da1-4163-9dc0-951c3c364143", + "promql": [ + { + "disabled": false, + "legend": "{{DBInstanceIdentifier}}", + "name": "A", + "query": "FreeStorageSpace{cloud_provider=\"aws\",cloud_account_id=\"$Account\",cloud_region=\"$Region\",service_name=\"RDS\", DBInstanceIdentifier!=\"\",quantile=\"1\"}" + } + ], + "queryType": "promql" + }, + "selectedLogFields": [ + { + "dataType": "string", + "name": "body", + "type": "" + }, + { + "dataType": "string", + "name": "timestamp", + "type": "" + } + ], + "selectedTracesFields": [ + { + "dataType": "string", + "id": "serviceName--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "serviceName", + "type": "tag" + }, + { + "dataType": "string", + "id": "name--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "name", + "type": "tag" + }, + { + "dataType": "float64", + "id": "durationNano--float64--tag--true", + "isColumn": true, + "isJSON": false, + "key": "durationNano", + "type": "tag" + }, + { + "dataType": "string", + "id": "httpMethod--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "httpMethod", + "type": "tag" + }, + { + "dataType": "string", + "id": "responseStatusCode--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "responseStatusCode", + "type": "tag" + } + ], + "softMax": 0, + "softMin": 0, + "stackedBarChart": false, + "thresholds": [], + "timePreferance": "GLOBAL_TIME", + "title": "Free Storage Space", + "yAxisUnit": "decbytes" + }, + { + "bucketCount": 30, + "bucketWidth": 0, + "columnUnits": {}, + "description": "", + "fillSpans": false, + "id": "b9bd5864-6317-43f6-af2a-f595c3206216", + "isStacked": false, + "mergeAllActiveQueries": false, + "nullZeroValues": "zero", + "opacity": "1", + "panelTypes": "graph", + "query": { + "builder": { + "queryData": [ + { + "aggregateAttribute": { + "dataType": "", + "id": "------false", + "isColumn": false, + "isJSON": false, + "key": "", + "type": "" + }, + "aggregateOperator": "count", + "dataSource": "metrics", + "disabled": false, + "expression": "A", + "filters": { + "items": [], + "op": "AND" + }, + "functions": [], + "groupBy": [], + "having": [], + "legend": "", + "limit": null, + "orderBy": [], + "queryName": "A", + "reduceTo": "avg", + "spaceAggregation": "sum", + "stepInterval": 60, + "timeAggregation": "rate" + } + ], + "queryFormulas": [] + }, + "clickhouse_sql": [ + { + "disabled": false, + "legend": "", + "name": "A", + "query": "" + } + ], + "id": "8e79fb06-8089-4d14-afe0-af914d13dca9", + "promql": [ + { + "disabled": false, + "legend": "{{DBInstanceIdentifier}}", + "name": "A", + "query": "DiskQueueDepth{cloud_provider=\"aws\",cloud_account_id=\"$Account\",cloud_region=\"$Region\",service_name=\"RDS\", DBInstanceIdentifier!=\"\",quantile=\"1\"}" + } + ], + "queryType": "promql" + }, + "selectedLogFields": [ + { + "dataType": "string", + "name": "body", + "type": "" + }, + { + "dataType": "string", + "name": "timestamp", + "type": "" + } + ], + "selectedTracesFields": [ + { + "dataType": "string", + "id": "serviceName--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "serviceName", + "type": "tag" + }, + { + "dataType": "string", + "id": "name--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "name", + "type": "tag" + }, + { + "dataType": "float64", + "id": "durationNano--float64--tag--true", + "isColumn": true, + "isJSON": false, + "key": "durationNano", + "type": "tag" + }, + { + "dataType": "string", + "id": "httpMethod--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "httpMethod", + "type": "tag" + }, + { + "dataType": "string", + "id": "responseStatusCode--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "responseStatusCode", + "type": "tag" + } + ], + "softMax": 0, + "softMin": 0, + "stackedBarChart": false, + "thresholds": [], + "timePreferance": "GLOBAL_TIME", + "title": "Disk Queue Depth", + "yAxisUnit": "none" + }, + { + "bucketCount": 30, + "bucketWidth": 0, + "columnUnits": {}, + "description": "", + "fillSpans": false, + "id": "ac41a973-1d06-44d6-9609-de0fa3211ae0", + "isStacked": false, + "mergeAllActiveQueries": false, + "nullZeroValues": "zero", + "opacity": "1", + "panelTypes": "graph", + "query": { + "builder": { + "queryData": [ + { + "aggregateAttribute": { + "dataType": "", + "id": "------false", + "isColumn": false, + "isJSON": false, + "key": "", + "type": "" + }, + "aggregateOperator": "count", + "dataSource": "metrics", + "disabled": false, + "expression": "A", + "filters": { + "items": [], + "op": "AND" + }, + "functions": [], + "groupBy": [], + "having": [], + "legend": "", + "limit": null, + "orderBy": [], + "queryName": "A", + "reduceTo": "avg", + "spaceAggregation": "sum", + "stepInterval": 60, + "timeAggregation": "rate" + } + ], + "queryFormulas": [] + }, + "clickhouse_sql": [ + { + "disabled": false, + "legend": "", + "name": "A", + "query": "" + } + ], + "id": "a8394fa7-fd1e-4051-a738-146f64240174", + "promql": [ + { + "disabled": false, + "legend": "{{DBInstanceIdentifier}} - Reads", + "name": "A", + "query": "ReadIOPS{cloud_provider=\"aws\",cloud_account_id=\"$Account\",cloud_region=\"$Region\",service_name=\"RDS\", DBInstanceIdentifier!=\"\",quantile=\"1\"}" + }, + { + "disabled": false, + "legend": "{{DBInstanceIdentifier}} - Writes", + "name": "B", + "query": "WriteIOPS{cloud_provider=\"aws\",cloud_account_id=\"$Account\",cloud_region=\"$Region\",service_name=\"RDS\", DBInstanceIdentifier!=\"\",quantile=\"1\"}" + } + ], + "queryType": "promql" + }, + "selectedLogFields": [ + { + "dataType": "string", + "name": "body", + "type": "" + }, + { + "dataType": "string", + "name": "timestamp", + "type": "" + } + ], + "selectedTracesFields": [ + { + "dataType": "string", + "id": "serviceName--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "serviceName", + "type": "tag" + }, + { + "dataType": "string", + "id": "name--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "name", + "type": "tag" + }, + { + "dataType": "float64", + "id": "durationNano--float64--tag--true", + "isColumn": true, + "isJSON": false, + "key": "durationNano", + "type": "tag" + }, + { + "dataType": "string", + "id": "httpMethod--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "httpMethod", + "type": "tag" + }, + { + "dataType": "string", + "id": "responseStatusCode--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "responseStatusCode", + "type": "tag" + } + ], + "softMax": 0, + "softMin": 0, + "stackedBarChart": false, + "thresholds": [], + "timePreferance": "GLOBAL_TIME", + "title": "Disk Read / Write IOPS", + "yAxisUnit": "cps" + }, + { + "bucketCount": 30, + "bucketWidth": 0, + "columnUnits": {}, + "description": "", + "fillSpans": false, + "id": "935ce065-35bf-442b-be8a-df3231e53862", + "isStacked": false, + "mergeAllActiveQueries": false, + "nullZeroValues": "zero", + "opacity": "1", + "panelTypes": "graph", + "query": { + "builder": { + "queryData": [ + { + "aggregateAttribute": { + "dataType": "", + "id": "------false", + "isColumn": false, + "isJSON": false, + "key": "", + "type": "" + }, + "aggregateOperator": "count", + "dataSource": "metrics", + "disabled": false, + "expression": "A", + "filters": { + "items": [], + "op": "AND" + }, + "functions": [], + "groupBy": [], + "having": [], + "legend": "", + "limit": null, + "orderBy": [], + "queryName": "A", + "reduceTo": "avg", + "spaceAggregation": "sum", + "stepInterval": 60, + "timeAggregation": "rate" + } + ], + "queryFormulas": [] + }, + "clickhouse_sql": [ + { + "disabled": false, + "legend": "", + "name": "A", + "query": "" + } + ], + "id": "d584298b-ee0e-4cf1-8333-edc4f286878d", + "promql": [ + { + "disabled": false, + "legend": "{{DBInstanceIdentifier}} - Reads", + "name": "A", + "query": "ReadLatency{cloud_provider=\"aws\",cloud_account_id=\"$Account\",cloud_region=\"$Region\",service_name=\"RDS\", DBInstanceIdentifier!=\"\",quantile=\"1\"}" + }, + { + "disabled": false, + "legend": "{{DBInstanceIdentifier}} - Writes", + "name": "B", + "query": "WriteLatency{cloud_provider=\"aws\",cloud_account_id=\"$Account\",cloud_region=\"$Region\",service_name=\"RDS\", DBInstanceIdentifier!=\"\",quantile=\"1\"}" + } + ], + "queryType": "promql" + }, + "selectedLogFields": [ + { + "dataType": "string", + "name": "body", + "type": "" + }, + { + "dataType": "string", + "name": "timestamp", + "type": "" + } + ], + "selectedTracesFields": [ + { + "dataType": "string", + "id": "serviceName--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "serviceName", + "type": "tag" + }, + { + "dataType": "string", + "id": "name--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "name", + "type": "tag" + }, + { + "dataType": "float64", + "id": "durationNano--float64--tag--true", + "isColumn": true, + "isJSON": false, + "key": "durationNano", + "type": "tag" + }, + { + "dataType": "string", + "id": "httpMethod--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "httpMethod", + "type": "tag" + }, + { + "dataType": "string", + "id": "responseStatusCode--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "responseStatusCode", + "type": "tag" + } + ], + "softMax": 0, + "softMin": 0, + "stackedBarChart": false, + "thresholds": [], + "timePreferance": "GLOBAL_TIME", + "title": "Disk Read / Write Latency", + "yAxisUnit": "s" + }, + { + "bucketCount": 30, + "bucketWidth": 0, + "columnUnits": {}, + "description": "", + "fillSpans": false, + "id": "ca60d14e-c0d1-4764-b24d-06fe7104ab50", + "isStacked": false, + "mergeAllActiveQueries": false, + "nullZeroValues": "zero", + "opacity": "1", + "panelTypes": "graph", + "query": { + "builder": { + "queryData": [ + { + "aggregateAttribute": { + "dataType": "", + "id": "------false", + "isColumn": false, + "isJSON": false, + "key": "", + "type": "" + }, + "aggregateOperator": "count", + "dataSource": "metrics", + "disabled": false, + "expression": "A", + "filters": { + "items": [], + "op": "AND" + }, + "functions": [], + "groupBy": [], + "having": [], + "legend": "", + "limit": null, + "orderBy": [], + "queryName": "A", + "reduceTo": "avg", + "spaceAggregation": "sum", + "stepInterval": 60, + "timeAggregation": "rate" + } + ], + "queryFormulas": [] + }, + "clickhouse_sql": [ + { + "disabled": false, + "legend": "", + "name": "A", + "query": "" + } + ], + "id": "10f91076-5aa2-4c56-986c-397b208a7165", + "promql": [ + { + "disabled": false, + "legend": "{{DBInstanceIdentifier}} - Reads", + "name": "A", + "query": "ReadThroughput{cloud_provider=\"aws\",cloud_account_id=\"$Account\",cloud_region=\"$Region\",service_name=\"RDS\", DBInstanceIdentifier!=\"\",quantile=\"1\"}" + }, + { + "disabled": false, + "legend": "{{DBInstanceIdentifier}} - Writes", + "name": "B", + "query": "WriteThroughput{cloud_provider=\"aws\",cloud_account_id=\"$Account\",cloud_region=\"$Region\",service_name=\"RDS\", DBInstanceIdentifier!=\"\",quantile=\"1\"}" + } + ], + "queryType": "promql" + }, + "selectedLogFields": [ + { + "dataType": "string", + "name": "body", + "type": "" + }, + { + "dataType": "string", + "name": "timestamp", + "type": "" + } + ], + "selectedTracesFields": [ + { + "dataType": "string", + "id": "serviceName--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "serviceName", + "type": "tag" + }, + { + "dataType": "string", + "id": "name--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "name", + "type": "tag" + }, + { + "dataType": "float64", + "id": "durationNano--float64--tag--true", + "isColumn": true, + "isJSON": false, + "key": "durationNano", + "type": "tag" + }, + { + "dataType": "string", + "id": "httpMethod--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "httpMethod", + "type": "tag" + }, + { + "dataType": "string", + "id": "responseStatusCode--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "responseStatusCode", + "type": "tag" + } + ], + "softMax": 0, + "softMin": 0, + "stackedBarChart": false, + "thresholds": [], + "timePreferance": "GLOBAL_TIME", + "title": "Disk Read / Write Throughput", + "yAxisUnit": "decbytes" + }, + { + "bucketCount": 30, + "bucketWidth": 0, + "columnUnits": {}, + "description": "", + "fillSpans": false, + "id": "5145172f-69ce-4b9a-b96c-7e7c46c9435d", + "isStacked": false, + "mergeAllActiveQueries": false, + "nullZeroValues": "zero", + "opacity": "1", + "panelTypes": "graph", + "query": { + "builder": { + "queryData": [ + { + "aggregateAttribute": { + "dataType": "", + "id": "------false", + "isColumn": false, + "isJSON": false, + "key": "", + "type": "" + }, + "aggregateOperator": "count", + "dataSource": "metrics", + "disabled": false, + "expression": "A", + "filters": { + "items": [], + "op": "AND" + }, + "functions": [], + "groupBy": [], + "having": [], + "legend": "", + "limit": null, + "orderBy": [], + "queryName": "A", + "reduceTo": "avg", + "spaceAggregation": "sum", + "stepInterval": 60, + "timeAggregation": "rate" + } + ], + "queryFormulas": [] + }, + "clickhouse_sql": [ + { + "disabled": false, + "legend": "", + "name": "A", + "query": "" + } + ], + "id": "0444bb20-3b72-4907-96a6-d3e7c48cab9f", + "promql": [ + { + "disabled": false, + "legend": "{{DBInstanceIdentifier}}", + "name": "A", + "query": "DatabaseConnections{cloud_provider=\"aws\",cloud_account_id=\"$Account\",cloud_region=\"$Region\",service_name=\"RDS\", DBInstanceIdentifier!=\"\",quantile=\"1\"}" + } + ], + "queryType": "promql" + }, + "selectedLogFields": [ + { + "dataType": "string", + "name": "body", + "type": "" + }, + { + "dataType": "string", + "name": "timestamp", + "type": "" + } + ], + "selectedTracesFields": [ + { + "dataType": "string", + "id": "serviceName--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "serviceName", + "type": "tag" + }, + { + "dataType": "string", + "id": "name--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "name", + "type": "tag" + }, + { + "dataType": "float64", + "id": "durationNano--float64--tag--true", + "isColumn": true, + "isJSON": false, + "key": "durationNano", + "type": "tag" + }, + { + "dataType": "string", + "id": "httpMethod--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "httpMethod", + "type": "tag" + }, + { + "dataType": "string", + "id": "responseStatusCode--string--tag--true", + "isColumn": true, + "isJSON": false, + "key": "responseStatusCode", + "type": "tag" + } + ], + "softMax": 0, + "softMin": 0, + "stackedBarChart": false, + "thresholds": [], + "timePreferance": "GLOBAL_TIME", + "title": "Database Connections", + "yAxisUnit": "none" + } + ] +} \ No newline at end of file diff --git a/pkg/query-service/app/cloudintegrations/serviceDefinitions/aws/rds/assets/dashboards/overview.png b/pkg/query-service/app/cloudintegrations/serviceDefinitions/aws/rds/assets/dashboards/overview.png new file mode 100644 index 0000000000..d50277c533 Binary files /dev/null and b/pkg/query-service/app/cloudintegrations/serviceDefinitions/aws/rds/assets/dashboards/overview.png differ diff --git a/pkg/query-service/app/cloudintegrations/serviceDefinitions/aws/rds/integration.json b/pkg/query-service/app/cloudintegrations/serviceDefinitions/aws/rds/integration.json index 396b4dfb62..cd51dae7c8 100644 --- a/pkg/query-service/app/cloudintegrations/serviceDefinitions/aws/rds/integration.json +++ b/pkg/query-service/app/cloudintegrations/serviceDefinitions/aws/rds/integration.json @@ -3,9 +3,6 @@ "title": "Amazon RDS", "icon": "file://icon.svg", "overview": "file://overview.md", - "assets": { - "dashboards": [] - }, "supported_signals": { "metrics": true, "logs": true @@ -13,19 +10,923 @@ "data_collected": { "metrics": [ { - "name": "rds_postgres_cpuutilization_average", - "type": "Gauge", - "unit": "number", - "description": "CloudWatch metric CPUUtilization" + "name": "BurstBalance", + "unit": "Percent", + "type": "Summary", + "description": "" }, { - "name": "rds_postgres_cpuutilization_maximum", - "type": "Gauge", - "unit": "number", - "description": "CloudWatch metric CPUUtilization" + "name": "BurstBalance_count", + "unit": "Percent", + "type": "Sum", + "description": "" + }, + { + "name": "BurstBalance_sum", + "unit": "Percent", + "type": "Sum", + "description": "" + }, + { + "name": "CPUCreditBalance", + "unit": "Count", + "type": "Summary", + "description": "" + }, + { + "name": "CPUCreditBalance_count", + "unit": "Count", + "type": "Sum", + "description": "" + }, + { + "name": "CPUCreditBalance_sum", + "unit": "Count", + "type": "Sum", + "description": "" + }, + { + "name": "CPUCreditUsage", + "unit": "Count", + "type": "Summary", + "description": "" + }, + { + "name": "CPUCreditUsage_count", + "unit": "Count", + "type": "Sum", + "description": "" + }, + { + "name": "CPUCreditUsage_sum", + "unit": "Count", + "type": "Sum", + "description": "" + }, + { + "name": "CPUSurplusCreditBalance", + "unit": "Count", + "type": "Summary", + "description": "" + }, + { + "name": "CPUSurplusCreditBalance_count", + "unit": "Count", + "type": "Sum", + "description": "" + }, + { + "name": "CPUSurplusCreditBalance_sum", + "unit": "Count", + "type": "Sum", + "description": "" + }, + { + "name": "CPUSurplusCreditsCharged", + "unit": "Count", + "type": "Summary", + "description": "" + }, + { + "name": "CPUSurplusCreditsCharged_count", + "unit": "Count", + "type": "Sum", + "description": "" + }, + { + "name": "CPUSurplusCreditsCharged_sum", + "unit": "Count", + "type": "Sum", + "description": "" + }, + { + "name": "CPUUtilization", + "unit": "Percent", + "type": "Summary", + "description": "" + }, + { + "name": "CPUUtilization_count", + "unit": "Percent", + "type": "Sum", + "description": "" + }, + { + "name": "CPUUtilization_sum", + "unit": "Percent", + "type": "Sum", + "description": "" + }, + { + "name": "CheckpointLag", + "unit": "Seconds", + "type": "Summary", + "description": "" + }, + { + "name": "CheckpointLag_count", + "unit": "Seconds", + "type": "Sum", + "description": "" + }, + { + "name": "CheckpointLag_sum", + "unit": "Seconds", + "type": "Sum", + "description": "" + }, + { + "name": "DBLoad", + "unit": "None", + "type": "Summary", + "description": "" + }, + { + "name": "DBLoadCPU", + "unit": "None", + "type": "Summary", + "description": "" + }, + { + "name": "DBLoadCPU_count", + "unit": "None", + "type": "Sum", + "description": "" + }, + { + "name": "DBLoadCPU_sum", + "unit": "None", + "type": "Sum", + "description": "" + }, + { + "name": "DBLoadNonCPU", + "unit": "None", + "type": "Summary", + "description": "" + }, + { + "name": "DBLoadNonCPU_count", + "unit": "None", + "type": "Sum", + "description": "" + }, + { + "name": "DBLoadNonCPU_sum", + "unit": "None", + "type": "Sum", + "description": "" + }, + { + "name": "DBLoadRelativeToNumVCPUs", + "unit": "None", + "type": "Summary", + "description": "" + }, + { + "name": "DBLoadRelativeToNumVCPUs_count", + "unit": "None", + "type": "Sum", + "description": "" + }, + { + "name": "DBLoadRelativeToNumVCPUs_sum", + "unit": "None", + "type": "Sum", + "description": "" + }, + { + "name": "DBLoad_count", + "unit": "None", + "type": "Sum", + "description": "" + }, + { + "name": "DBLoad_sum", + "unit": "None", + "type": "Sum", + "description": "" + }, + { + "name": "DatabaseConnections", + "unit": "Count", + "type": "Summary", + "description": "" + }, + { + "name": "DatabaseConnections_count", + "unit": "Count", + "type": "Sum", + "description": "" + }, + { + "name": "DatabaseConnections_sum", + "unit": "Count", + "type": "Sum", + "description": "" + }, + { + "name": "DiskQueueDepth", + "unit": "Count", + "type": "Summary", + "description": "" + }, + { + "name": "DiskQueueDepth_count", + "unit": "Count", + "type": "Sum", + "description": "" + }, + { + "name": "DiskQueueDepth_sum", + "unit": "Count", + "type": "Sum", + "description": "" + }, + { + "name": "EBSByteBalance_", + "unit": "Percent", + "type": "Summary", + "description": "" + }, + { + "name": "EBSByteBalance__count", + "unit": "Percent", + "type": "Sum", + "description": "" + }, + { + "name": "EBSByteBalance__sum", + "unit": "Percent", + "type": "Sum", + "description": "" + }, + { + "name": "EBSIOBalance_", + "unit": "Percent", + "type": "Summary", + "description": "" + }, + { + "name": "EBSIOBalance__count", + "unit": "Percent", + "type": "Sum", + "description": "" + }, + { + "name": "EBSIOBalance__sum", + "unit": "Percent", + "type": "Sum", + "description": "" + }, + { + "name": "FreeStorageSpace", + "unit": "Bytes", + "type": "Summary", + "description": "" + }, + { + "name": "FreeStorageSpace_count", + "unit": "Bytes", + "type": "Sum", + "description": "" + }, + { + "name": "FreeStorageSpace_sum", + "unit": "Bytes", + "type": "Sum", + "description": "" + }, + { + "name": "FreeableMemory", + "unit": "Bytes", + "type": "Summary", + "description": "" + }, + { + "name": "FreeableMemory_count", + "unit": "Bytes", + "type": "Sum", + "description": "" + }, + { + "name": "FreeableMemory_sum", + "unit": "Bytes", + "type": "Sum", + "description": "" + }, + { + "name": "MaximumUsedTransactionIDs", + "unit": "Count", + "type": "Summary", + "description": "" + }, + { + "name": "MaximumUsedTransactionIDs_count", + "unit": "Count", + "type": "Sum", + "description": "" + }, + { + "name": "MaximumUsedTransactionIDs_sum", + "unit": "Count", + "type": "Sum", + "description": "" + }, + { + "name": "NetworkReceiveThroughput", + "unit": "Bytes/Second", + "type": "Summary", + "description": "" + }, + { + "name": "NetworkReceiveThroughput_count", + "unit": "Bytes/Second", + "type": "Sum", + "description": "" + }, + { + "name": "NetworkReceiveThroughput_sum", + "unit": "Bytes/Second", + "type": "Sum", + "description": "" + }, + { + "name": "NetworkTransmitThroughput", + "unit": "Bytes/Second", + "type": "Summary", + "description": "" + }, + { + "name": "NetworkTransmitThroughput_count", + "unit": "Bytes/Second", + "type": "Sum", + "description": "" + }, + { + "name": "NetworkTransmitThroughput_sum", + "unit": "Bytes/Second", + "type": "Sum", + "description": "" + }, + { + "name": "OldestReplicationSlotLag", + "unit": "Bytes", + "type": "Summary", + "description": "" + }, + { + "name": "OldestReplicationSlotLag_count", + "unit": "Bytes", + "type": "Sum", + "description": "" + }, + { + "name": "OldestReplicationSlotLag_sum", + "unit": "Bytes", + "type": "Sum", + "description": "" + }, + { + "name": "ReadIOPS", + "unit": "Count/Second", + "type": "Summary", + "description": "" + }, + { + "name": "ReadIOPS_count", + "unit": "Count/Second", + "type": "Sum", + "description": "" + }, + { + "name": "ReadIOPS_sum", + "unit": "Count/Second", + "type": "Sum", + "description": "" + }, + { + "name": "ReadLatency", + "unit": "Seconds", + "type": "Summary", + "description": "" + }, + { + "name": "ReadLatency_count", + "unit": "Seconds", + "type": "Sum", + "description": "" + }, + { + "name": "ReadLatency_sum", + "unit": "Seconds", + "type": "Sum", + "description": "" + }, + { + "name": "ReadThroughput", + "unit": "Bytes/Second", + "type": "Summary", + "description": "" + }, + { + "name": "ReadThroughput_count", + "unit": "Bytes/Second", + "type": "Sum", + "description": "" + }, + { + "name": "ReadThroughput_sum", + "unit": "Bytes/Second", + "type": "Sum", + "description": "" + }, + { + "name": "ReplicationSlotDiskUsage", + "unit": "Bytes", + "type": "Summary", + "description": "" + }, + { + "name": "ReplicationSlotDiskUsage_count", + "unit": "Bytes", + "type": "Sum", + "description": "" + }, + { + "name": "ReplicationSlotDiskUsage_sum", + "unit": "Bytes", + "type": "Sum", + "description": "" + }, + { + "name": "SwapUsage", + "unit": "Bytes", + "type": "Summary", + "description": "" + }, + { + "name": "SwapUsage_count", + "unit": "Bytes", + "type": "Sum", + "description": "" + }, + { + "name": "SwapUsage_sum", + "unit": "Bytes", + "type": "Sum", + "description": "" + }, + { + "name": "TransactionLogsDiskUsage", + "unit": "Bytes", + "type": "Summary", + "description": "" + }, + { + "name": "TransactionLogsDiskUsage_count", + "unit": "Bytes", + "type": "Sum", + "description": "" + }, + { + "name": "TransactionLogsDiskUsage_sum", + "unit": "Bytes", + "type": "Sum", + "description": "" + }, + { + "name": "TransactionLogsGeneration", + "unit": "Bytes/Second", + "type": "Summary", + "description": "" + }, + { + "name": "TransactionLogsGeneration_count", + "unit": "Bytes/Second", + "type": "Sum", + "description": "" + }, + { + "name": "TransactionLogsGeneration_sum", + "unit": "Bytes/Second", + "type": "Sum", + "description": "" + }, + { + "name": "WriteIOPS", + "unit": "Count/Second", + "type": "Summary", + "description": "" + }, + { + "name": "WriteIOPS_count", + "unit": "Count/Second", + "type": "Sum", + "description": "" + }, + { + "name": "WriteIOPS_sum", + "unit": "Count/Second", + "type": "Sum", + "description": "" + }, + { + "name": "WriteLatency", + "unit": "Seconds", + "type": "Summary", + "description": "" + }, + { + "name": "WriteLatency_count", + "unit": "Seconds", + "type": "Sum", + "description": "" + }, + { + "name": "WriteLatency_sum", + "unit": "Seconds", + "type": "Sum", + "description": "" + }, + { + "name": "WriteThroughput", + "unit": "Bytes/Second", + "type": "Summary", + "description": "" + }, + { + "name": "WriteThroughput_count", + "unit": "Bytes/Second", + "type": "Sum", + "description": "" + }, + { + "name": "WriteThroughput_sum", + "unit": "Bytes/Second", + "type": "Sum", + "description": "" + }, + { + "name": "ACUUtilization", + "unit": "Percent", + "type": "Summary", + "description": "" + }, + { + "name": "ACUUtilization_count", + "unit": "Percent", + "type": "Sum", + "description": "" + }, + { + "name": "ACUUtilization_sum", + "unit": "Percent", + "type": "Sum", + "description": "" + }, + { + "name": "BackupRetentionPeriodStorageUsed", + "unit": "Bytes", + "type": "Summary", + "description": "" + }, + { + "name": "BackupRetentionPeriodStorageUsed_count", + "unit": "Bytes", + "type": "Sum", + "description": "" + }, + { + "name": "BackupRetentionPeriodStorageUsed_sum", + "unit": "Bytes", + "type": "Sum", + "description": "" + }, + { + "name": "BufferCacheHitRatio", + "unit": "Percent", + "type": "Summary", + "description": "" + }, + { + "name": "BufferCacheHitRatio_count", + "unit": "Percent", + "type": "Sum", + "description": "" + }, + { + "name": "BufferCacheHitRatio_sum", + "unit": "Percent", + "type": "Sum", + "description": "" + }, + { + "name": "CommitLatency", + "unit": "Milliseconds", + "type": "Summary", + "description": "" + }, + { + "name": "CommitLatency_count", + "unit": "Milliseconds", + "type": "Sum", + "description": "" + }, + { + "name": "CommitLatency_sum", + "unit": "Milliseconds", + "type": "Sum", + "description": "" + }, + { + "name": "CommitThroughput", + "unit": "Count/Second", + "type": "Summary", + "description": "" + }, + { + "name": "CommitThroughput_count", + "unit": "Count/Second", + "type": "Sum", + "description": "" + }, + { + "name": "CommitThroughput_sum", + "unit": "Count/Second", + "type": "Sum", + "description": "" + }, + { + "name": "Deadlocks", + "unit": "Count/Second", + "type": "Summary", + "description": "" + }, + { + "name": "Deadlocks_count", + "unit": "Count/Second", + "type": "Sum", + "description": "" + }, + { + "name": "Deadlocks_sum", + "unit": "Count/Second", + "type": "Sum", + "description": "" + }, + { + "name": "EngineUptime", + "unit": "Seconds", + "type": "Summary", + "description": "" + }, + { + "name": "EngineUptime_count", + "unit": "Seconds", + "type": "Sum", + "description": "" + }, + { + "name": "EngineUptime_sum", + "unit": "Seconds", + "type": "Sum", + "description": "" + }, + { + "name": "NetworkThroughput", + "unit": "Bytes/Second", + "type": "Summary", + "description": "" + }, + { + "name": "NetworkThroughput_count", + "unit": "Bytes/Second", + "type": "Sum", + "description": "" + }, + { + "name": "NetworkThroughput_sum", + "unit": "Bytes/Second", + "type": "Sum", + "description": "" + }, + { + "name": "RDSToAuroraPostgreSQLReplicaLag", + "unit": "Seconds", + "type": "Summary", + "description": "" + }, + { + "name": "RDSToAuroraPostgreSQLReplicaLag_count", + "unit": "Seconds", + "type": "Sum", + "description": "" + }, + { + "name": "RDSToAuroraPostgreSQLReplicaLag_sum", + "unit": "Seconds", + "type": "Sum", + "description": "" + }, + { + "name": "ServerlessDatabaseCapacity", + "unit": "None", + "type": "Summary", + "description": "" + }, + { + "name": "ServerlessDatabaseCapacity_count", + "unit": "None", + "type": "Sum", + "description": "" + }, + { + "name": "ServerlessDatabaseCapacity_sum", + "unit": "None", + "type": "Sum", + "description": "" + }, + { + "name": "StorageNetworkReceiveThroughput", + "unit": "Bytes/Second", + "type": "Summary", + "description": "" + }, + { + "name": "StorageNetworkReceiveThroughput_count", + "unit": "Bytes/Second", + "type": "Sum", + "description": "" + }, + { + "name": "StorageNetworkReceiveThroughput_sum", + "unit": "Bytes/Second", + "type": "Sum", + "description": "" + }, + { + "name": "StorageNetworkThroughput", + "unit": "Bytes/Second", + "type": "Summary", + "description": "" + }, + { + "name": "StorageNetworkThroughput_count", + "unit": "Bytes/Second", + "type": "Sum", + "description": "" + }, + { + "name": "StorageNetworkThroughput_sum", + "unit": "Bytes/Second", + "type": "Sum", + "description": "" + }, + { + "name": "StorageNetworkTransmitThroughput", + "unit": "Bytes/Second", + "type": "Summary", + "description": "" + }, + { + "name": "StorageNetworkTransmitThroughput_count", + "unit": "Bytes/Second", + "type": "Sum", + "description": "" + }, + { + "name": "StorageNetworkTransmitThroughput_sum", + "unit": "Bytes/Second", + "type": "Sum", + "description": "" + }, + { + "name": "TempStorageIOPS", + "unit": "Count/Second", + "type": "Summary", + "description": "" + }, + { + "name": "TempStorageIOPS_count", + "unit": "Count/Second", + "type": "Sum", + "description": "" + }, + { + "name": "TempStorageIOPS_sum", + "unit": "Count/Second", + "type": "Sum", + "description": "" + }, + { + "name": "TempStorageThroughput", + "unit": "Bytes/Second", + "type": "Summary", + "description": "" + }, + { + "name": "TempStorageThroughput_count", + "unit": "Bytes/Second", + "type": "Sum", + "description": "" + }, + { + "name": "TempStorageThroughput_sum", + "unit": "Bytes/Second", + "type": "Sum", + "description": "" + }, + { + "name": "TotalBackupStorageBilled", + "unit": "Bytes", + "type": "Summary", + "description": "" + }, + { + "name": "TotalBackupStorageBilled_count", + "unit": "Bytes", + "type": "Sum", + "description": "" + }, + { + "name": "TotalBackupStorageBilled_sum", + "unit": "Bytes", + "type": "Sum", + "description": "" + }, + { + "name": "VolumeBytesUsed", + "unit": "Bytes", + "type": "Summary", + "description": "" + }, + { + "name": "VolumeBytesUsed_count", + "unit": "Bytes", + "type": "Sum", + "description": "" + }, + { + "name": "VolumeBytesUsed_sum", + "unit": "Bytes", + "type": "Sum", + "description": "" + }, + { + "name": "VolumeReadIOPs", + "unit": "Count", + "type": "Summary", + "description": "" + }, + { + "name": "VolumeReadIOPs_count", + "unit": "Count", + "type": "Sum", + "description": "" + }, + { + "name": "VolumeReadIOPs_sum", + "unit": "Count", + "type": "Sum", + "description": "" + }, + { + "name": "VolumeWriteIOPs", + "unit": "Count", + "type": "Summary", + "description": "" + }, + { + "name": "VolumeWriteIOPs_count", + "unit": "Count", + "type": "Sum", + "description": "" + }, + { + "name": "VolumeWriteIOPs_sum", + "unit": "Count", + "type": "Sum", + "description": "" } ], - "logs": [] + "logs": [ + { + "name": "Account Id", + "path": "resources.cloud.account.id", + "type": "string" + }, + { + "name": "Log Group Name", + "path": "resources.aws.cloudwatch.log_group_name", + "type": "string" + }, + { + "name": "Log Stream Name", + "path": "resources.aws.cloudwatch.log_stream_name", + "type": "string" + } + ] }, "telemetry_collection_strategy": { "aws_metrics": { @@ -43,5 +944,16 @@ } ] } + }, + "assets": { + "dashboards": [ + { + "id": "overview", + "title": "RDS Overview", + "description": "Overview of RDS", + "image": "file://assets/dashboards/overview.png", + "definition": "file://assets/dashboards/overview.json" + } + ] } } \ No newline at end of file diff --git a/pkg/query-service/app/http_handler.go b/pkg/query-service/app/http_handler.go index 1b20f06711..d406bb8c63 100644 --- a/pkg/query-service/app/http_handler.go +++ b/pkg/query-service/app/http_handler.go @@ -1026,8 +1026,16 @@ func (aH *APIHandler) getDashboards(w http.ResponseWriter, r *http.Request) { installedIntegrationDashboards, err := ic.GetDashboardsForInstalledIntegrations(r.Context()) if err != nil { zap.L().Error("failed to get dashboards for installed integrations", zap.Error(err)) + } else { + allDashboards = append(allDashboards, installedIntegrationDashboards...) + } + + cloudIntegrationDashboards, err := aH.CloudIntegrationsController.AvailableDashboards(r.Context()) + if err != nil { + zap.L().Error("failed to get cloud dashboards", zap.Error(err)) + } else { + allDashboards = append(allDashboards, cloudIntegrationDashboards...) } - allDashboards = append(allDashboards, installedIntegrationDashboards...) tagsFromReq, ok := r.URL.Query()["tags"] if !ok || len(tagsFromReq) == 0 || tagsFromReq[0] == "" { @@ -1183,12 +1191,24 @@ func (aH *APIHandler) getDashboard(w http.ResponseWriter, r *http.Request) { return } - dashboard, apiError = aH.IntegrationsController.GetInstalledIntegrationDashboardById( - r.Context(), uuid, - ) - if apiError != nil { - RespondError(w, apiError, nil) - return + if aH.CloudIntegrationsController.IsCloudIntegrationDashboardUuid(uuid) { + dashboard, apiError = aH.CloudIntegrationsController.GetDashboardById( + r.Context(), uuid, + ) + if apiError != nil { + RespondError(w, apiError, nil) + return + } + + } else { + dashboard, apiError = aH.IntegrationsController.GetInstalledIntegrationDashboardById( + r.Context(), uuid, + ) + if apiError != nil { + RespondError(w, apiError, nil) + return + } + } } diff --git a/pkg/query-service/app/integrations/builtin.go b/pkg/query-service/app/integrations/builtin.go index 77e31df001..5314412c9f 100644 --- a/pkg/query-service/app/integrations/builtin.go +++ b/pkg/query-service/app/integrations/builtin.go @@ -231,6 +231,16 @@ func readFileIfUri(fs embed.FS, maybeFileUri string, basedir string) (interface{ dataUri := fmt.Sprintf("data:image/svg+xml;base64,%s", base64Svg) return dataUri, nil + } else if strings.HasSuffix(maybeFileUri, ".jpeg") || strings.HasSuffix(maybeFileUri, ".jpg") { + base64Contents := base64.StdEncoding.EncodeToString(fileContents) + dataUri := fmt.Sprintf("data:image/jpeg;base64,%s", base64Contents) + return dataUri, nil + + } else if strings.HasSuffix(maybeFileUri, ".png") { + base64Contents := base64.StdEncoding.EncodeToString(fileContents) + dataUri := fmt.Sprintf("data:image/png;base64,%s", base64Contents) + return dataUri, nil + } return nil, fmt.Errorf("unsupported file type %s", maybeFileUri) diff --git a/pkg/query-service/tests/integration/signoz_integrations_test.go b/pkg/query-service/tests/integration/signoz_integrations_test.go index 778a87cd6b..9c124e9fc4 100644 --- a/pkg/query-service/tests/integration/signoz_integrations_test.go +++ b/pkg/query-service/tests/integration/signoz_integrations_test.go @@ -12,6 +12,7 @@ import ( mockhouse "github.com/srikanthccv/ClickHouse-go-mock" "github.com/stretchr/testify/require" "go.signoz.io/signoz/pkg/query-service/app" + "go.signoz.io/signoz/pkg/query-service/app/cloudintegrations" "go.signoz.io/signoz/pkg/query-service/app/dashboards" "go.signoz.io/signoz/pkg/query-service/app/integrations" "go.signoz.io/signoz/pkg/query-service/app/logparsingpipeline" @@ -557,11 +558,17 @@ func NewIntegrationsTestBed(t *testing.T, testDB *sqlx.DB) *IntegrationsTestBed reader, mockClickhouse := NewMockClickhouseReader(t, testDB, fm) mockClickhouse.MatchExpectationsInOrder(false) + cloudIntegrationsController, err := cloudintegrations.NewController(testDB) + if err != nil { + t.Fatalf("could not create cloud integrations controller: %v", err) + } + apiHandler, err := app.NewAPIHandler(app.APIHandlerOpts{ - Reader: reader, - AppDao: dao.DB(), - IntegrationsController: controller, - FeatureFlags: fm, + Reader: reader, + AppDao: dao.DB(), + IntegrationsController: controller, + FeatureFlags: fm, + CloudIntegrationsController: cloudIntegrationsController, }) if err != nil { t.Fatalf("could not create a new ApiHandler: %v", err)