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.
TypeScript apmapplication-monitoringdistributed-tracinggogood-first-issuejaegerloglogsmetricsmonitoringnextjsobservabilityopen-sourceopentelemetryprometheusreactreactjsself-hostedtracingtypescript
Feat: QS: structure for built in integrations (#4655)
Raj Kamal Singha295bf2fb6ed
diff --git a/pkg/query-service/app/integrations/builtin.go b/pkg/query-service/app/integrations/builtin.gonew file mode 100644index 0000000000..7b6c98c453--- /dev/null+++ b/pkg/query-service/app/integrations/builtin.go@@ -0,0 +1,197 @@+package integrations++import (+ "context"+ "embed"+ "strings"++ "encoding/base64"+ "encoding/json"+ "fmt"+ "io/fs"+ "path"++ koanfJson "github.com/knadh/koanf/parsers/json"+ "go.signoz.io/signoz/pkg/query-service/model"+ "golang.org/x/exp/maps"+ "golang.org/x/exp/slices"+)++type BuiltInIntegrations struct{}++var builtInIntegrations map[string]IntegrationDetails++func (bi *BuiltInIntegrations) list(ctx context.Context) (+ []IntegrationDetails, *model.ApiError,+) {+ integrations := maps.Values(builtInIntegrations)+ slices.SortFunc(integrations, func(i1, i2 IntegrationDetails) bool {+ return i1.Id < i2.Id+ })+ return integrations, nil+}++func (bi *BuiltInIntegrations) get(+ ctx context.Context, integrationIds []string,+) (+ map[string]IntegrationDetails, *model.ApiError,+) {+ result := map[string]IntegrationDetails{}+ for _, iid := range integrationIds {+ i, exists := builtInIntegrations[iid]+ if exists {+ result[iid] = i+ }+ }+ return result, nil+}++//go:embed builtin_integrations/*+var integrationFiles embed.FS++func init() {+ err := readBuiltIns()+ if err != nil {+ panic(fmt.Errorf("couldn't read builtin integrations: %w", err))+ }+}++func readBuiltIns() error {+ rootDirName := "builtin_integrations"+ builtinDirs, err := fs.ReadDir(integrationFiles, rootDirName)+ if err != nil {+ return fmt.Errorf("couldn't list integrations dirs: %w", err)+ }++ builtInIntegrations = map[string]IntegrationDetails{}+ for _, d := range builtinDirs {+ if !d.IsDir() {+ continue+ }++ integrationDir := path.Join(rootDirName, d.Name())+ i, err := readBuiltInIntegration(integrationDir)+ if err != nil {+ return fmt.Errorf("couldn't parse integration %s from files: %w", d.Name(), err)+ }++ _, exists := builtInIntegrations[i.Id]+ if exists {+ return fmt.Errorf(+ "duplicate integration for id %s at %s", i.Id, d.Name(),+ )+ }+ builtInIntegrations[i.Id] = *i+ }+ return nil+}++func readBuiltInIntegration(dirpath string) (+ *IntegrationDetails, error,+) {+ integrationJsonPath := path.Join(dirpath, "integration.json")++ serializedSpec, err := integrationFiles.ReadFile(integrationJsonPath)+ if err != nil {+ return nil, fmt.Errorf("couldn't find integration.json in %s: %w", dirpath, err)+ }++ integrationSpec, err := koanfJson.Parser().Unmarshal(serializedSpec)+ if err != nil {+ return nil, fmt.Errorf(+ "couldn't parse integration json from %s: %w", integrationJsonPath, err,+ )+ }++ hydrated, err := hydrateFileUris(integrationSpec, dirpath)+ if err != nil {+ return nil, fmt.Errorf(+ "couldn't hydrate files referenced in integration %s: %w", integrationJsonPath, err,+ )+ }++ hydratedSpec := hydrated.(map[string]interface{})+ hydratedSpecJson, err := koanfJson.Parser().Marshal(hydratedSpec)+ if err != nil {+ return nil, fmt.Errorf(+ "couldn't serialize hydrated integration spec back to JSON %s: %w", integrationJsonPath, err,+ )+ }++ var integration IntegrationDetails+ err = json.Unmarshal(hydratedSpecJson, &integration)+ if err != nil {+ return nil, fmt.Errorf(+ "couldn't parse hydrated JSON spec read from %s: %w",+ integrationJsonPath, err,+ )+ }++ integration.Id = "builtin::" + integration.Id++ return &integration, nil+}++func hydrateFileUris(spec interface{}, basedir string) (interface{}, error) {+ if specMap, ok := spec.(map[string]interface{}); ok {+ result := map[string]interface{}{}+ for k, v := range specMap {+ hydrated, err := hydrateFileUris(v, basedir)+ if err != nil {+ return nil, err+ }+ result[k] = hydrated+ }+ return result, nil++ } else if specSlice, ok := spec.([]interface{}); ok {+ result := []interface{}{}+ for _, v := range specSlice {+ hydrated, err := hydrateFileUris(v, basedir)+ if err != nil {+ return nil, err+ }+ result = append(result, hydrated)+ }+ return result, nil++ } else if maybeFileUri, ok := spec.(string); ok {+ return readFileIfUri(maybeFileUri, basedir)+ }++ return spec, nil++}++func readFileIfUri(maybeFileUri string, basedir string) (interface{}, error) {+ fileUriPrefix := "file://"+ if !strings.HasPrefix(maybeFileUri, fileUriPrefix) {+ return maybeFileUri, nil+ }++ relativePath := maybeFileUri[len(fileUriPrefix):]+ fullPath := path.Join(basedir, relativePath)++ fileContents, err := integrationFiles.ReadFile(fullPath)+ if err != nil {+ return nil, fmt.Errorf("couldn't read referenced file: %w", err)+ }+ if strings.HasSuffix(maybeFileUri, ".md") {+ return string(fileContents), nil++ } else if strings.HasSuffix(maybeFileUri, ".json") {+ parsed, err := koanfJson.Parser().Unmarshal(fileContents)+ if err != nil {+ return nil, fmt.Errorf("couldn't parse referenced JSON file: %w", err)+ }+ return parsed, nil++ } else if strings.HasSuffix(maybeFileUri, ".svg") {+ base64Svg := base64.StdEncoding.EncodeToString(fileContents)+ dataUri := fmt.Sprintf("data:image/svg+xml;base64,%s", base64Svg)+ return dataUri, nil++ }++ return nil, fmt.Errorf("unsupported file type %s", maybeFileUri)+}diff --git a/pkg/query-service/app/integrations/builtin_integrations/mongo/assets/dashboards/overview.json b/pkg/query-service/app/integrations/builtin_integrations/mongo/assets/dashboards/overview.jsonnew file mode 100644index 0000000000..5b5d93ad9e--- /dev/null+++ b/pkg/query-service/app/integrations/builtin_integrations/mongo/assets/dashboards/overview.json@@ -0,0 +1,796 @@+{+ "description": "This dashboard provides a high-level overview of your MongoDB. It includes read/write performance, most-used replicas, collection metrics etc...",+ "layout": [+ {+ "h": 3,+ "i": "0c3d2b15-89be-4d62-a821-b26d93332ed3",+ "moved": false,+ "static": false,+ "w": 6,+ "x": 6,+ "y": 3+ },+ {+ "h": 3,+ "i": "14504a3c-4a05-4d22-bab3-e22e94f51380",+ "moved": false,+ "static": false,+ "w": 6,+ "x": 0,+ "y": 6+ },+ {+ "h": 3,+ "i": "dcfb3829-c3f2-44bb-907d-8dc8a6dc4aab",+ "moved": false,+ "static": false,+ "w": 6,+ "x": 0,+ "y": 3+ },+ {+ "h": 3,+ "i": "bfc9e80b-02bf-4122-b3da-3dd943d35012",+ "moved": false,+ "static": false,+ "w": 6,+ "x": 6,+ "y": 0+ },+ {+ "h": 3,+ "i": "4c07a7d2-893a-46c2-bcdb-a19b6efeac3a",+ "moved": false,+ "static": false,+ "w": 6,+ "x": 0,+ "y": 0+ },+ {+ "h": 3,+ "i": "a5a64eec-1034-4aa6-8cb1-05673c4426c6",+ "moved": false,+ "static": false,+ "w": 6,+ "x": 6,+ "y": 6+ },+ {+ "h": 3,+ "i": "503af589-ef4d-4fe3-8934-c8f7eb480d9a",+ "moved": false,+ "static": false,+ "w": 6,+ "x": 0,+ "y": 9+ }+ ],+ "name": "",+ "tags": [+ "mongo",+ "database"+ ],+ "title": "Mongo overview",+ "variables": {+ "a2c21714-a814-4d31-9b56-7367c3208801": {+ "allSelected": true,+ "customValue": "",+ "description": "List of hosts sending mongo metrics",+ "id": "a2c21714-a814-4d31-9b56-7367c3208801",+ "modificationUUID": "448e675a-4531-45b1-b434-a9ee809470d6",+ "multiSelect": true,+ "name": "host_name",+ "order": 0,+ "queryValue": "SELECT JSONExtractString(labels, 'host_name') AS host_name\nFROM signoz_metrics.distributed_time_series_v4_1day\nWHERE metric_name = 'mongodb_memory_usage'\nGROUP BY host_name",+ "selectedValue": [+ "Srikanths-MacBook-Pro.local"+ ],+ "showALLOption": true,+ "sort": "ASC",+ "textboxValue": "",+ "type": "QUERY"+ }+ },+ "widgets": [+ {+ "description": "Total number of operations",+ "fillSpans": false,+ "id": "4c07a7d2-893a-46c2-bcdb-a19b6efeac3a",+ "isStacked": false,+ "nullZeroValues": "zero",+ "opacity": "1",+ "panelTypes": "graph",+ "query": {+ "builder": {+ "queryData": [+ {+ "aggregateAttribute": {+ "dataType": "float64",+ "id": "mongodb_operation_count--float64--Sum--true",+ "isColumn": true,+ "isJSON": false,+ "key": "mongodb_operation_count",+ "type": "Sum"+ },+ "aggregateOperator": "sum_rate",+ "dataSource": "metrics",+ "disabled": false,+ "expression": "A",+ "filters": {+ "items": [+ {+ "id": "a468a30b",+ "key": {+ "dataType": "string",+ "id": "host_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "host_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.host_name}}"+ ]+ }+ ],+ "op": "AND"+ },+ "groupBy": [+ {+ "dataType": "string",+ "id": "operation--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "operation",+ "type": "tag"+ }+ ],+ "having": [],+ "legend": "{{operation}}",+ "limit": null,+ "orderBy": [],+ "queryName": "A",+ "reduceTo": "sum",+ "stepInterval": 60+ }+ ],+ "queryFormulas": []+ },+ "clickhouse_sql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "id": "7da5d899-8b06-4139-9a89-47baf9551ff8",+ "promql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "queryType": "builder"+ },+ "softMax": null,+ "softMin": null,+ "thresholds": [],+ "timePreferance": "GLOBAL_TIME",+ "title": "Operations count",+ "yAxisUnit": "none"+ },+ {+ "description": "The total time spent performing operations.",+ "fillSpans": false,+ "id": "bfc9e80b-02bf-4122-b3da-3dd943d35012",+ "isStacked": false,+ "nullZeroValues": "zero",+ "opacity": "1",+ "panelTypes": "graph",+ "query": {+ "builder": {+ "queryData": [+ {+ "aggregateAttribute": {+ "dataType": "float64",+ "id": "mongodb_operation_time--float64--Sum--true",+ "isColumn": true,+ "isJSON": false,+ "key": "mongodb_operation_time",+ "type": "Sum"+ },+ "aggregateOperator": "sum_rate",+ "dataSource": "metrics",+ "disabled": false,+ "expression": "A",+ "filters": {+ "items": [+ {+ "id": "31be3166",+ "key": {+ "dataType": "string",+ "id": "host_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "host_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.host_name}}"+ ]+ }+ ],+ "op": "AND"+ },+ "groupBy": [+ {+ "dataType": "string",+ "id": "operation--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "operation",+ "type": "tag"+ }+ ],+ "having": [],+ "legend": "{{operation}}",+ "limit": null,+ "orderBy": [],+ "queryName": "A",+ "reduceTo": "sum",+ "stepInterval": 60+ }+ ],+ "queryFormulas": []+ },+ "clickhouse_sql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "id": "2ca35957-894a-46ae-a2a6-95d7e400d8e1",+ "promql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "queryType": "builder"+ },+ "softMax": null,+ "softMin": null,+ "thresholds": [],+ "timePreferance": "GLOBAL_TIME",+ "title": "Total operations time",+ "yAxisUnit": "ms"+ },+ {+ "description": "The number of cache operations",+ "fillSpans": false,+ "id": "dcfb3829-c3f2-44bb-907d-8dc8a6dc4aab",+ "isStacked": false,+ "nullZeroValues": "zero",+ "opacity": "1",+ "panelTypes": "graph",+ "query": {+ "builder": {+ "queryData": [+ {+ "aggregateAttribute": {+ "dataType": "float64",+ "id": "mongodb_cache_operations--float64--Sum--true",+ "isColumn": true,+ "isJSON": false,+ "key": "mongodb_cache_operations",+ "type": "Sum"+ },+ "aggregateOperator": "sum_rate",+ "dataSource": "metrics",+ "disabled": false,+ "expression": "A",+ "filters": {+ "items": [+ {+ "id": "01b45814",+ "key": {+ "dataType": "string",+ "id": "host_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "host_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.host_name}}"+ ]+ }+ ],+ "op": "AND"+ },+ "groupBy": [+ {+ "dataType": "string",+ "id": "type--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "type",+ "type": "tag"+ }+ ],+ "having": [],+ "legend": "{{type}}",+ "limit": null,+ "orderBy": [],+ "queryName": "A",+ "reduceTo": "sum",+ "stepInterval": 60+ }+ ],+ "queryFormulas": []+ },+ "clickhouse_sql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "id": "bb439198-dcf5-4767-b0d0-ab5785159b8d",+ "promql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "queryType": "builder"+ },+ "softMax": null,+ "softMin": null,+ "thresholds": [],+ "timePreferance": "GLOBAL_TIME",+ "title": "Cache operations",+ "yAxisUnit": "none"+ },+ {+ "description": "",+ "fillSpans": false,+ "id": "14504a3c-4a05-4d22-bab3-e22e94f51380",+ "isStacked": false,+ "nullZeroValues": "zero",+ "opacity": "1",+ "panelTypes": "graph",+ "query": {+ "builder": {+ "queryData": [+ {+ "aggregateAttribute": {+ "dataType": "float64",+ "id": "mongodb_operation_latency_time--float64--Gauge--true",+ "isColumn": true,+ "isJSON": false,+ "key": "mongodb_operation_latency_time",+ "type": "Gauge"+ },+ "aggregateOperator": "max",+ "dataSource": "metrics",+ "disabled": false,+ "expression": "A",+ "filters": {+ "items": [+ {+ "id": "2e165319",+ "key": {+ "dataType": "string",+ "id": "operation--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "operation",+ "type": "tag"+ },+ "op": "=",+ "value": "read"+ },+ {+ "id": "888e920b",+ "key": {+ "dataType": "string",+ "id": "host_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "host_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.host_name}}"+ ]+ }+ ],+ "op": "AND"+ },+ "groupBy": [],+ "having": [],+ "legend": "Latency",+ "limit": null,+ "orderBy": [],+ "queryName": "A",+ "reduceTo": "sum",+ "stepInterval": 60+ }+ ],+ "queryFormulas": []+ },+ "clickhouse_sql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "id": "4a9cafe8-778b-476c-b825-c04e165bf285",+ "promql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "queryType": "builder"+ },+ "softMax": null,+ "softMin": null,+ "thresholds": [],+ "timePreferance": "GLOBAL_TIME",+ "title": "Read latency",+ "yAxisUnit": "µs"+ },+ {+ "description": "",+ "fillSpans": false,+ "id": "a5a64eec-1034-4aa6-8cb1-05673c4426c6",+ "isStacked": false,+ "nullZeroValues": "zero",+ "opacity": "1",+ "panelTypes": "graph",+ "query": {+ "builder": {+ "queryData": [+ {+ "aggregateAttribute": {+ "dataType": "float64",+ "id": "mongodb_operation_latency_time--float64--Gauge--true",+ "isColumn": true,+ "isJSON": false,+ "key": "mongodb_operation_latency_time",+ "type": "Gauge"+ },+ "aggregateOperator": "max",+ "dataSource": "metrics",+ "disabled": false,+ "expression": "A",+ "filters": {+ "items": [+ {+ "id": "53b37ca7",+ "key": {+ "dataType": "string",+ "id": "host_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "host_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.host_name}}"+ ]+ },+ {+ "id": "9862c46c",+ "key": {+ "dataType": "string",+ "id": "operation--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "operation",+ "type": "tag"+ },+ "op": "=",+ "value": "write"+ }+ ],+ "op": "AND"+ },+ "groupBy": [],+ "having": [],+ "legend": "Latency",+ "limit": null,+ "orderBy": [],+ "queryName": "A",+ "reduceTo": "sum",+ "stepInterval": 60+ }+ ],+ "queryFormulas": []+ },+ "clickhouse_sql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "id": "446827eb-a4f2-4ff3-966b-fb65288c983b",+ "promql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "queryType": "builder"+ },+ "softMax": null,+ "softMin": null,+ "thresholds": [],+ "timePreferance": "GLOBAL_TIME",+ "title": "Write latency",+ "yAxisUnit": "µs"+ },+ {+ "description": "",+ "fillSpans": false,+ "id": "503af589-ef4d-4fe3-8934-c8f7eb480d9a",+ "isStacked": false,+ "nullZeroValues": "zero",+ "opacity": "1",+ "panelTypes": "graph",+ "query": {+ "builder": {+ "queryData": [+ {+ "aggregateAttribute": {+ "dataType": "float64",+ "id": "mongodb_operation_latency_time--float64--Gauge--true",+ "isColumn": true,+ "isJSON": false,+ "key": "mongodb_operation_latency_time",+ "type": "Gauge"+ },+ "aggregateOperator": "max",+ "dataSource": "metrics",+ "disabled": false,+ "expression": "A",+ "filters": {+ "items": [+ {+ "id": "c33ad4b6",+ "key": {+ "dataType": "string",+ "id": "host_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "host_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.host_name}}"+ ]+ },+ {+ "id": "c70ecfd0",+ "key": {+ "dataType": "string",+ "id": "operation--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "operation",+ "type": "tag"+ },+ "op": "=",+ "value": "command"+ }+ ],+ "op": "AND"+ },+ "groupBy": [],+ "having": [],+ "legend": "Latency",+ "limit": null,+ "orderBy": [],+ "queryName": "A",+ "reduceTo": "sum",+ "stepInterval": 60+ }+ ],+ "queryFormulas": []+ },+ "clickhouse_sql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "id": "7b7b977d-0921-4552-8cfe-d82dfde63ef4",+ "promql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "queryType": "builder"+ },+ "softMax": null,+ "softMin": null,+ "thresholds": [],+ "timePreferance": "GLOBAL_TIME",+ "title": "Command latency",+ "yAxisUnit": "µs"+ },+ {+ "description": "",+ "fillSpans": false,+ "id": "0c3d2b15-89be-4d62-a821-b26d93332ed3",+ "isStacked": false,+ "nullZeroValues": "zero",+ "opacity": "1",+ "panelTypes": "graph",+ "query": {+ "builder": {+ "queryData": [+ {+ "aggregateAttribute": {+ "dataType": "float64",+ "id": "mongodb_network_io_receive--float64--Sum--true",+ "isColumn": true,+ "isJSON": false,+ "key": "mongodb_network_io_receive",+ "type": "Sum"+ },+ "aggregateOperator": "avg",+ "dataSource": "metrics",+ "disabled": false,+ "expression": "A",+ "filters": {+ "items": [+ {+ "id": "5c9d7fe3",+ "key": {+ "dataType": "string",+ "id": "host_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "host_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.host_name}}"+ ]+ }+ ],+ "op": "AND"+ },+ "groupBy": [+ {+ "dataType": "string",+ "id": "host_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "host_name",+ "type": "tag"+ }+ ],+ "having": [],+ "legend": "Bytes received :: {{host_name}}",+ "limit": null,+ "orderBy": [],+ "queryName": "A",+ "reduceTo": "sum",+ "stepInterval": 60+ },+ {+ "aggregateAttribute": {+ "dataType": "float64",+ "id": "mongodb_network_io_transmit--float64--Sum--true",+ "isColumn": true,+ "isJSON": false,+ "key": "mongodb_network_io_transmit",+ "type": "Sum"+ },+ "aggregateOperator": "avg",+ "dataSource": "metrics",+ "disabled": false,+ "expression": "B",+ "filters": {+ "items": [+ {+ "id": "96520885",+ "key": {+ "dataType": "string",+ "id": "host_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "host_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.host_name}}"+ ]+ }+ ],+ "op": "AND"+ },+ "groupBy": [+ {+ "dataType": "string",+ "id": "host_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "host_name",+ "type": "tag"+ }+ ],+ "having": [],+ "legend": "Bytes transmitted :: {{host_name}}",+ "limit": null,+ "orderBy": [],+ "queryName": "B",+ "reduceTo": "sum",+ "stepInterval": 60+ }+ ],+ "queryFormulas": []+ },+ "clickhouse_sql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "id": "41eea5bc-f9cf-45c2-92fb-ef226d6b540b",+ "promql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "queryType": "builder"+ },+ "softMax": null,+ "softMin": null,+ "thresholds": [],+ "timePreferance": "GLOBAL_TIME",+ "title": "Network IO",+ "yAxisUnit": "bytes"+ }+ ]+}\ No newline at end of filediff --git a/pkg/query-service/app/integrations/builtin_integrations/mongo/assets/pipelines/log-parser.json b/pkg/query-service/app/integrations/builtin_integrations/mongo/assets/pipelines/log-parser.jsonnew file mode 100644index 0000000000..e75db3ec5d--- /dev/null+++ b/pkg/query-service/app/integrations/builtin_integrations/mongo/assets/pipelines/log-parser.json@@ -0,0 +1,33 @@+{+ "id": "parse-default-mongo-access-log",+ "name": "Parse default mongo access log",+ "alias": "parse-default-mongo-access-log",+ "description": "Parse standard mongo access log",+ "enabled": true,+ "filter": {+ "op": "AND",+ "items": [+ {+ "key": {+ "type": "tag",+ "key": "source",+ "dataType": "string"+ },+ "op": "=",+ "value": "mongo"+ }+ ]+ },+ "config": [+ {+ "type": "grok_parser",+ "id": "parse-body-grok",+ "enabled": true,+ "orderId": 1,+ "name": "Parse Body",+ "parse_to": "attributes",+ "pattern": "%{GREEDYDATA}",+ "parse_from": "body"+ }+ ]+}\ No newline at end of filediff --git a/pkg/query-service/app/integrations/builtin_integrations/mongo/config/configure-otel-collector.md b/pkg/query-service/app/integrations/builtin_integrations/mongo/config/configure-otel-collector.mdnew file mode 100644index 0000000000..abb9bd8f25--- /dev/null+++ b/pkg/query-service/app/integrations/builtin_integrations/mongo/config/configure-otel-collector.md@@ -0,0 +1,74 @@+### Configure otel collector++#### Save collector config file++Save the following collector config in a file named `mongo-collector-config.yaml`++```+receivers:+ mongodb:+ # - For standalone MongoDB deployments this is the hostname and port of the mongod instance+ # - For replica sets specify the hostnames and ports of the mongod instances that are in the replica set configuration. If the replica_set field is specified, nodes will be autodiscovered.+ # - For a sharded MongoDB deployment, please specify a list of the mongos hosts.+ hosts:+ - endpoint: 127.0.0.1:27017+ # If authentication is required, the user can with clusterMonitor permissions can be provided here+ username: monitoring+ # If authentication is required, the password can be provided here.+ password: ${env:MONGODB_PASSWORD}+ collection_interval: 60s+ # If TLS is enabled, the following fields can be used to configure the connection+ tls:+ insecure: true+ insecure_skip_verify: true+ # ca_file: /etc/ssl/certs/ca-certificates.crt+ # cert_file: /etc/ssl/certs/mongodb.crt+ # key_file: /etc/ssl/certs/mongodb.key+ metrics:+ mongodb.lock.acquire.count:+ enabled: true+ mongodb.lock.acquire.time:+ enabled: true+ mongodb.lock.acquire.wait_count:+ enabled: true+ mongodb.lock.deadlock.count:+ enabled: true+ mongodb.operation.latency.time:+ enabled: true++processors:+ # enriches the data with additional host information+ # see https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/resourcedetectionprocessor#resource-detection-processor+ resourcedetection/system:+ # add additional detectors if needed+ detectors: ["system"]+ system:+ hostname_sources: ["os"]++exporters:+ # export to local collector+ otlp/local:+ endpoint: "localhost:4317"+ tls:+ insecure: true+ # export to SigNoz cloud+ otlp/signoz:+ endpoint: "ingest.{region}.signoz.cloud:443"+ tls:+ insecure: false+ headers:+ "signoz-access-token": "<SIGNOZ_INGESTION_KEY>"++service:+ pipelines:+ metrics/mongodb:+ receivers: [mongodb]+ # note: remove this processor if the collector host is not running on the same host as the mongo instance+ processors: [resourcedetection/system]+ exporters: [otlp/local]++```++#### Use collector config file++Run your collector with the added flag `--config mongo-collector-config.yaml`diff --git a/pkg/query-service/app/integrations/builtin_integrations/mongo/config/prerequisites.md b/pkg/query-service/app/integrations/builtin_integrations/mongo/config/prerequisites.mdnew file mode 100644index 0000000000..2914a64b86--- /dev/null+++ b/pkg/query-service/app/integrations/builtin_integrations/mongo/config/prerequisites.md@@ -0,0 +1,22 @@+### Prepare mongo for monitoring++- Have a running mongodb instance+- Have the monitoring user created+- Have the monitoring user granted the necessary permissions++Mongodb recommends to set up a least privilege user (LPU) with a `clusterMonitor` role in order to collect.++Run the following command to create a user with the necessary permissions.++```+use admin+db.createUser(+ {+ user: "monitoring",+ pwd: "<PASSWORD>",+ roles: ["clusterMonitor"]+ }+);+```++Replace `<PASSWORD>` with a strong password and set is as env var `MONGODB_PASSWORD`.diff --git a/pkg/query-service/app/integrations/builtin_integrations/mongo/icon.svg b/pkg/query-service/app/integrations/builtin_integrations/mongo/icon.svgnew file mode 100644index 0000000000..4ffedc6339--- /dev/null+++ b/pkg/query-service/app/integrations/builtin_integrations/mongo/icon.svg@@ -0,0 +1,28 @@+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">+<path d="M12.465 22.5L11.9018 22.3132C11.9018 22.3132 11.9767 19.4633 10.9455 19.263C10.2705 18.477 11.0452 -14.2928 13.5127 19.1512C13.0446 19.3887 12.6864 19.798 12.513 20.2935C12.4201 21.0253 12.404 21.7648 12.465 22.5Z" fill="url(#paint0_linear_2128_450)"/>+<path d="M12.7695 19.7467C14.2692 18.6178 15.4177 17.0865 16.0815 15.3307C16.7453 13.5749 16.8972 11.6667 16.5195 9.828C15.417 4.96425 12.8063 3.36525 12.525 2.75475C12.2823 2.3746 12.0752 1.9729 11.9062 1.55475L12.114 15.1065C12.114 15.1065 11.6835 19.248 12.7695 19.7467Z" fill="url(#paint1_linear_2128_450)"/>+<path d="M11.6153 19.9268C11.6153 19.9268 7.0245 16.8 7.29 11.2687C7.31477 9.60123 7.6971 7.95845 8.41118 6.45136C9.12527 4.94428 10.1545 3.60799 11.4293 2.53275C11.5782 2.40618 11.6966 2.24751 11.7754 2.06864C11.8543 1.88976 11.8916 1.69535 11.8845 1.5C12.1702 2.115 12.1237 10.6823 12.1537 11.6842C12.27 15.582 11.937 19.191 11.6153 19.9268Z" fill="url(#paint2_linear_2128_450)"/>+<defs>+<linearGradient id="paint0_linear_2128_450" x1="8.67873" y1="12.1892" x2="15.1525" y2="14.3861" gradientUnits="userSpaceOnUse">+<stop offset="0.231" stop-color="#999875"/>+<stop offset="0.563" stop-color="#9B9977"/>+<stop offset="0.683" stop-color="#A09F7E"/>+<stop offset="0.768" stop-color="#A9A889"/>+<stop offset="0.837" stop-color="#B7B69A"/>+<stop offset="0.896" stop-color="#C9C7B0"/>+<stop offset="0.948" stop-color="#DEDDCB"/>+<stop offset="0.994" stop-color="#F8F6EB"/>+<stop offset="1" stop-color="#FBF9EF"/>+</linearGradient>+<linearGradient id="paint1_linear_2128_450" x1="11.0527" y1="1.45791" x2="13.9147" y2="19.3296" gradientUnits="userSpaceOnUse">+<stop stop-color="#48A547"/>+<stop offset="1" stop-color="#3F9143"/>+</linearGradient>+<linearGradient id="paint2_linear_2128_450" x1="6.8951" y1="11.8163" x2="14.5756" y2="9.24408" gradientUnits="userSpaceOnUse">+<stop stop-color="#41A247"/>+<stop offset="0.352" stop-color="#4BA74B"/>+<stop offset="0.956" stop-color="#67B554"/>+<stop offset="1" stop-color="#69B655"/>+</linearGradient>+</defs>+</svg>diff --git a/pkg/query-service/app/integrations/builtin_integrations/mongo/integration.json b/pkg/query-service/app/integrations/builtin_integrations/mongo/integration.jsonnew file mode 100644index 0000000000..c5d0fcefcd--- /dev/null+++ b/pkg/query-service/app/integrations/builtin_integrations/mongo/integration.json@@ -0,0 +1,88 @@+{+ "id": "mongo",+ "title": "Mongo",+ "description": "Monitor mongo using logs and metrics.",+ "author": {+ "name": "SigNoz",+ "email": "[email protected]",+ "homepage": "https://signoz.io"+ },+ "icon": "file://icon.svg",+ "categories": [+ "Database"+ ],+ "overview": "file://overview.md",+ "configuration": [+ {+ "title": "Prerequisites",+ "instructions": "file://config/prerequisites.md"+ },+ {+ "title": "Configure Otel Collector",+ "instructions": "file://config/configure-otel-collector.md"+ }+ ],+ "assets": {+ "logs": {+ "pipelines": [+ "file://assets/pipelines/log-parser.json"+ ]+ },+ "dashboards": [+ "file://assets/dashboards/overview.json"+ ],+ "alerts": []+ },+ "connection_tests": {+ "logs": {+ "op": "AND",+ "items": [+ {+ "key": {+ "type": "tag",+ "key": "source",+ "dataType": "string"+ },+ "op": "=",+ "value": "mongo"+ }+ ]+ }+ },+ "data_collected": {+ "logs": [+ {+ "name": "Request Method",+ "path": "attributes[\"http.request.method\"]",+ "type": "string",+ "description": "HTTP method"+ },+ {+ "name": "Request Path",+ "path": "attributes[\"url.path\"]",+ "type": "string",+ "description": "path requested"+ },+ {+ "name": "Response Status Code",+ "path": "attributes[\"http.response.status_code\"]",+ "type": "int",+ "description": "HTTP response code"+ }+ ],+ "metrics": [+ {+ "name": "http.server.request.duration",+ "type": "Histogram",+ "unit": "s",+ "description": "Duration of HTTP server requests"+ },+ {+ "name": "http.server.active_requests",+ "type": "UpDownCounter",+ "unit": "{ request }",+ "description": "Number of active HTTP server requests"+ }+ ]+ }+}diff --git a/pkg/query-service/app/integrations/builtin_integrations/mongo/overview.md b/pkg/query-service/app/integrations/builtin_integrations/mongo/overview.mdnew file mode 100644index 0000000000..c7a84541ad--- /dev/null+++ b/pkg/query-service/app/integrations/builtin_integrations/mongo/overview.md@@ -0,0 +1,3 @@+### Monitor MongoDB with SigNoz++Collect key MongoDB metrics and parse your MongoDB logsdiff --git a/pkg/query-service/app/integrations/builtin_integrations/nginx/assets/pipelines/log-parser.json b/pkg/query-service/app/integrations/builtin_integrations/nginx/assets/pipelines/log-parser.jsonnew file mode 100644index 0000000000..e9521e45ff--- /dev/null+++ b/pkg/query-service/app/integrations/builtin_integrations/nginx/assets/pipelines/log-parser.json@@ -0,0 +1,62 @@+{+ "id": "parse-default-nginx-access-log",+ "name": "Parse default nginx access log",+ "alias": "parse-default-nginx-access-log",+ "description": "Parse standard nginx access log",+ "enabled": true,+ "filter": {+ "op": "AND",+ "items": [+ {+ "key": {+ "type": "tag",+ "key": "source",+ "dataType": "string"+ },+ "op": "=",+ "value": "nginx"+ }+ ]+ },+ "config": [+ {+ "type": "grok_parser",+ "id": "parse-body-grok",+ "enabled": true,+ "orderId": 1,+ "name": "Parse Body",+ "parse_to": "attributes",+ "pattern": "%{IP:client.address} - %{USERNAME:enduser.id} \\[%{HTTPDATE:time.local}\\] \"((%{WORD:http.method} %{DATA:http.path}(\\?%{DATA:http.query})? %{WORD:network.protocol.name}/%{NOTSPACE:network.protocol.version})|%{DATA})\" %{INT:http.response.status_code:int} %{INT:http.request.body.bytes:int} \"%{NOTSPACE:http.referer}\" \"%{DATA:http.user.agent}\" %{INT:http.request.bytes:int} %{NUMBER:http.request.time:float} \\[%{DATA:proxy.upstream.name}?\\] \\[%{DATA:proxy.alternative.upstream.name}?\\] ((%{IP:network.peer.address}:%{INT:network.peer.port:int})|%{DATA})? (%{INT:http.response.bytes:int}|-)? (%{NUMBER:http.response.time:float}|-)? (%{NUMBER:network.peer.status.code:int}|-)? %{NOTSPACE:request.id}",+ "parse_from": "body"+ },+ {+ "type": "severity_parser",+ "id": "parse-sev",+ "enabled": true,+ "orderId": 2,+ "name": "Set Severity",+ "parse_from": "attributes[\"http.response.status_code\"]",+ "mapping": {+ "debug": [+ "1xx"+ ],+ "error": [+ "4xx"+ ],+ "fatal": [+ "5xx"+ ],+ "info": [+ "2xx"+ ],+ "trace": [+ "trace"+ ],+ "warn": [+ "3xx"+ ]+ },+ "overwrite_text": true+ }+ ]+}\ No newline at end of filediff --git a/pkg/query-service/app/integrations/builtin_integrations/nginx/config/configure-otel-collector.md b/pkg/query-service/app/integrations/builtin_integrations/nginx/config/configure-otel-collector.mdnew file mode 100644index 0000000000..f5c22e16cb--- /dev/null+++ b/pkg/query-service/app/integrations/builtin_integrations/nginx/config/configure-otel-collector.md@@ -0,0 +1 @@+### Configure otel collectordiff --git a/pkg/query-service/app/integrations/builtin_integrations/nginx/config/prepare-nginx.md b/pkg/query-service/app/integrations/builtin_integrations/nginx/config/prepare-nginx.mdnew file mode 100644index 0000000000..2677d09b6b--- /dev/null+++ b/pkg/query-service/app/integrations/builtin_integrations/nginx/config/prepare-nginx.md@@ -0,0 +1 @@+### Prepare nginx for observabilitydiff --git a/pkg/query-service/app/integrations/builtin_integrations/nginx/icon.svg b/pkg/query-service/app/integrations/builtin_integrations/nginx/icon.svgnew file mode 100644index 0000000000..5687615020--- /dev/null+++ b/pkg/query-service/app/integrations/builtin_integrations/nginx/icon.svg@@ -0,0 +1,8 @@+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">+ <path+ d="M11.961 1.5H12.0098C12.2596 1.619 12.5029 1.75118 12.7388 1.896C15.4532 3.457 18.1678 5.0185 20.8823 6.5805C20.9873 6.63656 21.073 6.72287 21.1284 6.82825C21.1837 6.93363 21.2062 7.05322 21.1927 7.1715C21.1867 10.4633 21.1927 13.7542 21.189 17.0445C21.1537 17.2015 21.0577 17.3382 20.922 17.4247C18.0355 19.0868 15.1488 20.7478 12.2618 22.4078C12.1918 22.4611 12.1075 22.4922 12.0196 22.4972C11.9318 22.5021 11.8445 22.4806 11.769 22.4355C8.879 20.7785 5.99175 19.1185 3.10725 17.4555C3.0135 17.4112 2.93499 17.3401 2.8816 17.2512C2.82821 17.1623 2.80234 17.0596 2.80725 16.956C2.80725 13.665 2.80725 10.3742 2.80725 7.08375C2.80018 6.98062 2.82401 6.87773 2.87572 6.78822C2.92742 6.69871 3.00464 6.62665 3.0975 6.58125C5.8085 5.02225 8.5195 3.46225 11.2305 1.90125C11.472 1.76325 11.709 1.617 11.961 1.5Z"+ fill="#019639" />+ <path+ d="M6.57525 7.9035C6.57525 10.618 6.57525 13.3327 6.57525 16.0477C6.57179 16.1981 6.59832 16.3476 6.65331 16.4876C6.7083 16.6276 6.79063 16.7552 6.8955 16.863C7.09652 17.0616 7.35953 17.1852 7.64069 17.2133C7.92185 17.2415 8.20414 17.1723 8.4405 17.0175C8.59871 16.91 8.72823 16.7654 8.81778 16.5964C8.90732 16.4274 8.95417 16.239 8.95425 16.0477C8.95425 14.0827 8.9505 12.1177 8.95425 10.1527C10.7457 12.2977 12.541 14.4397 14.34 16.5787C14.5899 16.832 14.8995 17.0183 15.2402 17.1208C15.5809 17.2233 15.9419 17.2386 16.29 17.1652C16.5358 17.1168 16.7596 16.9908 16.9285 16.8057C17.0974 16.6206 17.2025 16.3862 17.2283 16.137C17.2323 13.3665 17.2323 10.5962 17.2283 7.82625C17.2024 7.53057 17.0667 7.2553 16.8479 7.05477C16.6291 6.85423 16.3431 6.74299 16.0462 6.74299C15.7494 6.74299 15.4634 6.85423 15.2446 7.05477C15.0258 7.2553 14.8901 7.53057 14.8643 7.82625C14.8643 9.82275 14.8523 11.817 14.8643 13.8127C13.1048 11.7382 11.367 9.64575 9.61425 7.56375C9.38317 7.26744 9.07725 7.03813 8.72803 6.89944C8.3788 6.76075 7.9989 6.71771 7.6275 6.77475C7.34615 6.80607 7.08532 6.93714 6.89229 7.14421C6.69925 7.35128 6.58678 7.62064 6.57525 7.9035Z"+ fill="white" />+</svg>\ No newline at end of filediff --git a/pkg/query-service/app/integrations/builtin_integrations/nginx/integration.json b/pkg/query-service/app/integrations/builtin_integrations/nginx/integration.jsonnew file mode 100644index 0000000000..558f9780d0--- /dev/null+++ b/pkg/query-service/app/integrations/builtin_integrations/nginx/integration.json@@ -0,0 +1,87 @@+{+ "id": "nginx",+ "title": "Nginx",+ "description": "Monitor nginx using logs and metrics.",+ "author": {+ "name": "SigNoz",+ "email": "[email protected]",+ "homepage": "https://signoz.io"+ },+ "icon": "file://icon.svg",+ "categories": [+ "Ingress",+ "HTTP"+ ],+ "overview": "file://overview.md",+ "configuration": [+ {+ "title": "Prepare Nginx",+ "instructions": "file://config/prepare-nginx.md"+ },+ {+ "title": "Configure Otel Collector",+ "instructions": "file://config/configure-otel-collector.md"+ }+ ],+ "assets": {+ "logs": {+ "pipelines": [+ "file://assets/pipelines/log-parser.json"+ ]+ },+ "dashboards": null,+ "alerts": null+ },+ "connection_tests": {+ "logs": {+ "op": "AND",+ "items": [+ {+ "key": {+ "type": "tag",+ "key": "source",+ "dataType": "string"+ },+ "op": "=",+ "value": "nginx"+ }+ ]+ }+ },+ "data_collected": {+ "logs": [+ {+ "name": "Request Method",+ "path": "attributes[\"http.request.method\"]",+ "type": "string",+ "description": "HTTP method"+ },+ {+ "name": "Request Path",+ "path": "attributes[\"url.path\"]",+ "type": "string",+ "description": "path requested"+ },+ {+ "name": "Response Status Code",+ "path": "attributes[\"http.response.status_code\"]",+ "type": "int",+ "description": "HTTP response code"+ }+ ],+ "metrics": [+ {+ "name": "http.server.request.duration",+ "type": "Histogram",+ "unit": "s",+ "description": "Duration of HTTP server requests"+ },+ {+ "name": "http.server.active_requests",+ "type": "UpDownCounter",+ "unit": "{ request }",+ "description": "Number of active HTTP server requests"+ }+ ]+ }+}diff --git a/pkg/query-service/app/integrations/builtin_integrations/nginx/overview.md b/pkg/query-service/app/integrations/builtin_integrations/nginx/overview.mdnew file mode 100644index 0000000000..dac6354fc0--- /dev/null+++ b/pkg/query-service/app/integrations/builtin_integrations/nginx/overview.md@@ -0,0 +1,3 @@+### Monitor Nginx with SigNoz++Parse your Nginx logs and collect key metrics.diff --git a/pkg/query-service/app/integrations/builtin_integrations/postgres/assets/dashboards/overview.json b/pkg/query-service/app/integrations/builtin_integrations/postgres/assets/dashboards/overview.jsonnew file mode 100644index 0000000000..9799ad66e3--- /dev/null+++ b/pkg/query-service/app/integrations/builtin_integrations/postgres/assets/dashboards/overview.json@@ -0,0 +1,1868 @@+{+ "description": "This dashboard provides a high-level overview of your PostgreSQL databases. It includes replication, locks, and throughput etc...",+ "layout": [+ {+ "h": 3,+ "i": "9552123d-6265-48a7-8624-3f4a3fc3c9c0",+ "moved": false,+ "static": false,+ "w": 6,+ "x": 0,+ "y": 18+ },+ {+ "h": 3,+ "i": "d7838815-4f5b-4454-86fd-f658b201f3a9",+ "moved": false,+ "static": false,+ "w": 6,+ "x": 6,+ "y": 15+ },+ {+ "h": 3,+ "i": "f9a6f683-7455-4643-acc8-467cc5ea52cf",+ "moved": false,+ "static": false,+ "w": 6,+ "x": 0,+ "y": 15+ },+ {+ "h": 3,+ "i": "8638a199-20a0-4255-b0a2-3b1ba06c485b",+ "moved": false,+ "static": false,+ "w": 6,+ "x": 3,+ "y": 12+ },+ {+ "h": 3,+ "i": "e9341e70-ccb3-47fc-af95-56ba8942c4f2",+ "moved": false,+ "static": false,+ "w": 6,+ "x": 6,+ "y": 9+ },+ {+ "h": 3,+ "i": "6b700035-e3c2-4c48-99fa-ebfd6202eed3",+ "moved": false,+ "static": false,+ "w": 6,+ "x": 0,+ "y": 9+ },+ {+ "h": 3,+ "i": "bada7864-1d23-4d49-a868-c6b8a93c738f",+ "moved": false,+ "static": false,+ "w": 6,+ "x": 3,+ "y": 6+ },+ {+ "h": 3,+ "i": "191d09a6-40b0-4de8-a5b0-aa4254454b99",+ "moved": false,+ "static": false,+ "w": 6,+ "x": 0,+ "y": 0+ },+ {+ "h": 3,+ "i": "fa941c00-ce19-49cc-baf2-c38598767dee",+ "moved": false,+ "static": false,+ "w": 6,+ "x": 6,+ "y": 0+ },+ {+ "h": 3,+ "i": "114fcf80-e1de-4716-b1aa-0e0738dba10e",+ "moved": false,+ "static": false,+ "w": 6,+ "x": 0,+ "y": 3+ },+ {+ "h": 3,+ "i": "667428ef-9b9a-4e91-bd1e-938e0dc1ff32",+ "moved": false,+ "static": false,+ "w": 6,+ "x": 6,+ "y": 3+ }+ ],+ "name": "",+ "tags": [+ "postgres",+ "database"+ ],+ "title": "Postgres overview",+ "variables": {+ "4250ef7b-8f42-4a24-902a-a764d070b92d": {+ "allSelected": true,+ "customValue": "",+ "description": "List of hosts sending Postgres metrics",+ "id": "4250ef7b-8f42-4a24-902a-a764d070b92d",+ "key": "4250ef7b-8f42-4a24-902a-a764d070b92d",+ "modificationUUID": "4427b655-c8d2-40ce-84ed-7cb058bd3041",+ "multiSelect": true,+ "name": "host_name",+ "order": 0,+ "queryValue": "SELECT JSONExtractString(labels, 'host_name') AS host_name\nFROM signoz_metrics.distributed_time_series_v4_1day\nWHERE metric_name = 'postgresql_operations'\nGROUP BY host_name",+ "selectedValue": [+ "Srikanths-MacBook-Pro.local"+ ],+ "showALLOption": true,+ "sort": "ASC",+ "textboxValue": "",+ "type": "QUERY"+ },+ "8ecaee70-640f-46fd-83d9-a4fd18bc66e6": {+ "customValue": "",+ "description": "List of tables",+ "id": "8ecaee70-640f-46fd-83d9-a4fd18bc66e6",+ "modificationUUID": "a51321cd-47a2-470a-8df4-372e5bb36f2c",+ "multiSelect": true,+ "name": "table_name",+ "order": 0,+ "queryValue": "SELECT JSONExtractString(labels, 'postgresql_table_name') AS table_name\nFROM signoz_metrics.distributed_time_series_v4_1day\nWHERE metric_name = 'postgresql_operations' AND JSONExtractString(labels, 'postgresql_database_name') IN {{.db_name}}\nGROUP BY table_name",+ "showALLOption": true,+ "sort": "ASC",+ "textboxValue": "",+ "type": "QUERY",+ "selectedValue": [+ "public.activations",+ "public.licenses",+ "public.plans",+ "public.subscription_items",+ "public.subscriptions",+ "public.trials",+ "public.usage"+ ],+ "allSelected": true+ },+ "c66d1581-e5e1-440d-8ff6-ebcf078ab6dd": {+ "allSelected": true,+ "customValue": "",+ "description": "List of databases",+ "id": "c66d1581-e5e1-440d-8ff6-ebcf078ab6dd",+ "key": "c66d1581-e5e1-440d-8ff6-ebcf078ab6dd",+ "modificationUUID": "564a3f43-98f8-4189-b5e4-dcb518d73852",+ "multiSelect": true,+ "name": "db_name",+ "order": 0,+ "queryValue": "SELECT JSONExtractString(labels, 'postgresql_database_name') AS db_name\nFROM signoz_metrics.distributed_time_series_v4_1day\nWHERE metric_name = 'postgresql_operations'\nGROUP BY db_name",+ "selectedValue": [+ "postgres"+ ],+ "showALLOption": true,+ "sort": "DISABLED",+ "textboxValue": "",+ "type": "QUERY"+ }+ },+ "widgets": [+ {+ "description": "The average number of db insert operations.",+ "fillSpans": false,+ "id": "191d09a6-40b0-4de8-a5b0-aa4254454b99",+ "isStacked": false,+ "nullZeroValues": "zero",+ "opacity": "1",+ "panelTypes": "graph",+ "query": {+ "builder": {+ "queryData": [+ {+ "aggregateAttribute": {+ "dataType": "float64",+ "id": "postgresql_operations--float64--Sum--true",+ "isColumn": true,+ "isJSON": false,+ "key": "postgresql_operations",+ "type": "Sum"+ },+ "aggregateOperator": "avg",+ "dataSource": "metrics",+ "disabled": false,+ "expression": "A",+ "filters": {+ "items": [+ {+ "id": "c1dff946",+ "key": {+ "dataType": "string",+ "id": "operation--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "operation",+ "type": "tag"+ },+ "op": "=",+ "value": "ins"+ },+ {+ "id": "0cd6dc8f",+ "key": {+ "dataType": "string",+ "id": "host_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "host_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.host_name}}"+ ]+ },+ {+ "id": "2e60e171",+ "key": {+ "dataType": "string",+ "id": "postgresql_database_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "postgresql_database_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.db_name}}"+ ]+ }+ ],+ "op": "AND"+ },+ "groupBy": [+ {+ "dataType": "string",+ "id": "postgresql_database_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "postgresql_database_name",+ "type": "tag"+ }+ ],+ "having": [],+ "legend": "{{postgresql_database_name}}",+ "limit": null,+ "orderBy": [],+ "queryName": "A",+ "reduceTo": "sum",+ "stepInterval": 60+ }+ ],+ "queryFormulas": []+ },+ "clickhouse_sql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "id": "bf48ac4c-bc0c-41a0-87f4-6f8ae7888d1f",+ "promql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "queryType": "builder"+ },+ "softMax": null,+ "softMin": null,+ "thresholds": [],+ "timePreferance": "GLOBAL_TIME",+ "title": "Inserts",+ "yAxisUnit": "none"+ },+ {+ "description": "The average number of db update operations.",+ "fillSpans": false,+ "id": "fa941c00-ce19-49cc-baf2-c38598767dee",+ "isStacked": false,+ "nullZeroValues": "zero",+ "opacity": "1",+ "panelTypes": "graph",+ "query": {+ "builder": {+ "queryData": [+ {+ "aggregateAttribute": {+ "dataType": "float64",+ "id": "postgresql_operations--float64--Sum--true",+ "isColumn": true,+ "isJSON": false,+ "key": "postgresql_operations",+ "type": "Sum"+ },+ "aggregateOperator": "avg",+ "dataSource": "metrics",+ "disabled": false,+ "expression": "A",+ "filters": {+ "items": [+ {+ "id": "98463ec9",+ "key": {+ "dataType": "string",+ "id": "operation--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "operation",+ "type": "tag"+ },+ "op": "=",+ "value": "upd"+ },+ {+ "id": "47db4e8e",+ "key": {+ "dataType": "string",+ "id": "host_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "host_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.host_name}}"+ ]+ },+ {+ "id": "64020332",+ "key": {+ "dataType": "string",+ "id": "postgresql_database_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "postgresql_database_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.db_name}}"+ ]+ }+ ],+ "op": "AND"+ },+ "groupBy": [+ {+ "dataType": "string",+ "id": "postgresql_database_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "postgresql_database_name",+ "type": "tag"+ }+ ],+ "having": [],+ "legend": "{{postgresql_database_name}}",+ "limit": null,+ "orderBy": [],+ "queryName": "A",+ "reduceTo": "sum",+ "stepInterval": 60+ }+ ],+ "queryFormulas": []+ },+ "clickhouse_sql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "id": "34a6ac3a-b7f6-4b5f-a084-a44378033d82",+ "promql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "queryType": "builder"+ },+ "softMax": null,+ "softMin": null,+ "thresholds": [],+ "timePreferance": "GLOBAL_TIME",+ "title": "Updates",+ "yAxisUnit": "none"+ },+ {+ "description": "The average number of db delete operations.",+ "fillSpans": false,+ "id": "114fcf80-e1de-4716-b1aa-0e0738dba10e",+ "isStacked": false,+ "nullZeroValues": "zero",+ "opacity": "1",+ "panelTypes": "graph",+ "query": {+ "builder": {+ "queryData": [+ {+ "aggregateAttribute": {+ "dataType": "float64",+ "id": "postgresql_operations--float64--Sum--true",+ "isColumn": true,+ "isJSON": false,+ "key": "postgresql_operations",+ "type": "Sum"+ },+ "aggregateOperator": "avg",+ "dataSource": "metrics",+ "disabled": false,+ "expression": "A",+ "filters": {+ "items": [+ {+ "id": "62738de4",+ "key": {+ "dataType": "string",+ "id": "operation--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "operation",+ "type": "tag"+ },+ "op": "=",+ "value": "del"+ },+ {+ "id": "d18471e2",+ "key": {+ "dataType": "string",+ "id": "host_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "host_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.host_name}}"+ ]+ },+ {+ "id": "9d153899",+ "key": {+ "dataType": "string",+ "id": "postgresql_database_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "postgresql_database_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.db_name}}"+ ]+ }+ ],+ "op": "AND"+ },+ "groupBy": [+ {+ "dataType": "string",+ "id": "postgresql_database_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "postgresql_database_name",+ "type": "tag"+ }+ ],+ "having": [],+ "legend": "{{postgresql_database_name}}",+ "limit": null,+ "orderBy": [],+ "queryName": "A",+ "reduceTo": "sum",+ "stepInterval": 60+ }+ ],+ "queryFormulas": []+ },+ "clickhouse_sql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "id": "734393d1-76ed-4f4f-bef8-0a91d27ebec4",+ "promql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "queryType": "builder"+ },+ "softMax": null,+ "softMin": null,+ "thresholds": [],+ "timePreferance": "GLOBAL_TIME",+ "title": "Deleted",+ "yAxisUnit": "none"+ },+ {+ "description": "The average number of db heap-only update operations.",+ "fillSpans": false,+ "id": "667428ef-9b9a-4e91-bd1e-938e0dc1ff32",+ "isStacked": false,+ "nullZeroValues": "zero",+ "opacity": "1",+ "panelTypes": "graph",+ "query": {+ "builder": {+ "queryData": [+ {+ "aggregateAttribute": {+ "dataType": "float64",+ "id": "postgresql_operations--float64--Sum--true",+ "isColumn": true,+ "isJSON": false,+ "key": "postgresql_operations",+ "type": "Sum"+ },+ "aggregateOperator": "avg",+ "dataSource": "metrics",+ "disabled": false,+ "expression": "A",+ "filters": {+ "items": [+ {+ "id": "a91e35c4",+ "key": {+ "dataType": "string",+ "id": "operation--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "operation",+ "type": "tag"+ },+ "op": "=",+ "value": "hot_upd"+ },+ {+ "id": "2b419378",+ "key": {+ "dataType": "string",+ "id": "host_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "host_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.host_name}}"+ ]+ },+ {+ "id": "7b4a29a2",+ "key": {+ "dataType": "string",+ "id": "postgresql_database_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "postgresql_database_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.db_name}}"+ ]+ }+ ],+ "op": "AND"+ },+ "groupBy": [+ {+ "dataType": "string",+ "id": "postgresql_database_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "postgresql_database_name",+ "type": "tag"+ }+ ],+ "having": [],+ "legend": "{{postgresql_database_name}}",+ "limit": null,+ "orderBy": [],+ "queryName": "A",+ "reduceTo": "sum",+ "stepInterval": 60+ }+ ],+ "queryFormulas": []+ },+ "clickhouse_sql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "id": "f43c2d19-4abc-4f5e-881b-db7add4a870a",+ "promql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "queryType": "builder"+ },+ "softMax": null,+ "softMin": null,+ "thresholds": [],+ "timePreferance": "GLOBAL_TIME",+ "title": "Heap updates",+ "yAxisUnit": "none"+ },+ {+ "description": "",+ "fillSpans": false,+ "id": "bada7864-1d23-4d49-a868-c6b8a93c738f",+ "isStacked": false,+ "nullZeroValues": "zero",+ "opacity": "1",+ "panelTypes": "table",+ "query": {+ "builder": {+ "queryData": [+ {+ "aggregateAttribute": {+ "dataType": "float64",+ "id": "postgresql_operations--float64--Sum--true",+ "isColumn": true,+ "isJSON": false,+ "key": "postgresql_operations",+ "type": "Sum"+ },+ "aggregateOperator": "avg",+ "dataSource": "metrics",+ "disabled": false,+ "expression": "A",+ "filters": {+ "items": [+ {+ "id": "d6aeccf7",+ "key": {+ "dataType": "string",+ "id": "operation--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "operation",+ "type": "tag"+ },+ "op": "=",+ "value": "ins"+ },+ {+ "id": "4004a127",+ "key": {+ "dataType": "string",+ "id": "host_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "host_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.host_name}}"+ ]+ },+ {+ "id": "ee4e9344",+ "key": {+ "dataType": "string",+ "id": "postgresql_database_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "postgresql_database_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.db_name}}"+ ]+ }+ ],+ "op": "AND"+ },+ "groupBy": [+ {+ "dataType": "string",+ "id": "postgresql_database_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "postgresql_database_name",+ "type": "tag"+ }+ ],+ "having": [],+ "legend": "Inserted",+ "limit": null,+ "orderBy": [],+ "queryName": "A",+ "reduceTo": "sum",+ "stepInterval": 60+ },+ {+ "aggregateAttribute": {+ "dataType": "float64",+ "id": "postgresql_operations--float64--Sum--true",+ "isColumn": true,+ "isJSON": false,+ "key": "postgresql_operations",+ "type": "Sum"+ },+ "aggregateOperator": "avg",+ "dataSource": "metrics",+ "disabled": false,+ "expression": "B",+ "filters": {+ "items": [+ {+ "id": "a12cceed",+ "key": {+ "dataType": "string",+ "id": "operation--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "operation",+ "type": "tag"+ },+ "op": "=",+ "value": "upd"+ },+ {+ "id": "11735104",+ "key": {+ "dataType": "string",+ "id": "host_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "host_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.host_name}}"+ ]+ },+ {+ "id": "2d542482",+ "key": {+ "dataType": "string",+ "id": "postgresql_database_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "postgresql_database_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.db_name}}"+ ]+ }+ ],+ "op": "AND"+ },+ "groupBy": [+ {+ "dataType": "string",+ "id": "postgresql_database_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "postgresql_database_name",+ "type": "tag"+ }+ ],+ "having": [],+ "legend": "Updated",+ "limit": null,+ "orderBy": [],+ "queryName": "B",+ "reduceTo": "sum",+ "stepInterval": 60+ },+ {+ "aggregateAttribute": {+ "dataType": "float64",+ "id": "postgresql_operations--float64--Sum--true",+ "isColumn": true,+ "isJSON": false,+ "key": "postgresql_operations",+ "type": "Sum"+ },+ "aggregateOperator": "avg",+ "dataSource": "metrics",+ "disabled": false,+ "expression": "C",+ "filters": {+ "items": [+ {+ "id": "1bca3e46",+ "key": {+ "dataType": "string",+ "id": "operation--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "operation",+ "type": "tag"+ },+ "op": "=",+ "value": "del"+ },+ {+ "id": "3631755d",+ "key": {+ "dataType": "string",+ "id": "host_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "host_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.host_name}}"+ ]+ },+ {+ "id": "44ffc874",+ "key": {+ "dataType": "string",+ "id": "postgresql_database_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "postgresql_database_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.db_name}}"+ ]+ }+ ],+ "op": "AND"+ },+ "groupBy": [+ {+ "dataType": "string",+ "id": "postgresql_database_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "postgresql_database_name",+ "type": "tag"+ }+ ],+ "having": [],+ "legend": "Deleted",+ "limit": null,+ "orderBy": [],+ "queryName": "C",+ "reduceTo": "sum",+ "stepInterval": 60+ }+ ],+ "queryFormulas": []+ },+ "clickhouse_sql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "id": "5056105b-1c30-4d27-8187-64457f2a1ec6",+ "promql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "queryType": "builder"+ },+ "softMax": null,+ "softMin": null,+ "thresholds": [],+ "timePreferance": "GLOBAL_TIME",+ "title": "Operation by database",+ "yAxisUnit": "none"+ },+ {+ "description": "The number of database locks.",+ "fillSpans": false,+ "id": "6b700035-e3c2-4c48-99fa-ebfd6202eed3",+ "isStacked": false,+ "nullZeroValues": "zero",+ "opacity": "1",+ "panelTypes": "graph",+ "query": {+ "builder": {+ "queryData": [+ {+ "aggregateAttribute": {+ "dataType": "float64",+ "id": "postgresql_database_locks--float64--Gauge--true",+ "isColumn": true,+ "isJSON": false,+ "key": "postgresql_database_locks",+ "type": "Gauge"+ },+ "aggregateOperator": "sum",+ "dataSource": "metrics",+ "disabled": false,+ "expression": "A",+ "filters": {+ "items": [+ {+ "id": "527a3124",+ "key": {+ "dataType": "string",+ "id": "host_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "host_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.host_name}}"+ ]+ }+ ],+ "op": "AND"+ },+ "groupBy": [+ {+ "dataType": "string",+ "id": "mode--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "mode",+ "type": "tag"+ }+ ],+ "having": [],+ "legend": "{{mode}}",+ "limit": null,+ "orderBy": [],+ "queryName": "A",+ "reduceTo": "sum",+ "stepInterval": 60+ }+ ],+ "queryFormulas": []+ },+ "clickhouse_sql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "id": "877b0df3-9ae3-455e-ad27-bc3aa40b3f4c",+ "promql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "queryType": "builder"+ },+ "softMax": null,+ "softMin": null,+ "thresholds": [],+ "timePreferance": "GLOBAL_TIME",+ "title": "Locks by lock mode",+ "yAxisUnit": "none"+ },+ {+ "description": "",+ "fillSpans": false,+ "id": "e9341e70-ccb3-47fc-af95-56ba8942c4f2",+ "isStacked": false,+ "nullZeroValues": "zero",+ "opacity": "1",+ "panelTypes": "graph",+ "query": {+ "builder": {+ "queryData": [+ {+ "aggregateAttribute": {+ "dataType": "float64",+ "id": "postgresql_deadlocks--float64--Sum--true",+ "isColumn": true,+ "isJSON": false,+ "key": "postgresql_deadlocks",+ "type": "Sum"+ },+ "aggregateOperator": "sum_rate",+ "dataSource": "metrics",+ "disabled": false,+ "expression": "A",+ "filters": {+ "items": [+ {+ "id": "ff14f172",+ "key": {+ "dataType": "string",+ "id": "host_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "host_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.host_name}}"+ ]+ },+ {+ "id": "efb83717",+ "key": {+ "dataType": "string",+ "id": "postgresql_database_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "postgresql_database_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.db_name}}"+ ]+ }+ ],+ "op": "AND"+ },+ "groupBy": [+ {+ "dataType": "string",+ "id": "postgresql_database_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "postgresql_database_name",+ "type": "tag"+ }+ ],+ "having": [],+ "legend": "{{postgresql_database_name}}",+ "limit": null,+ "orderBy": [],+ "queryName": "A",+ "reduceTo": "sum",+ "stepInterval": 60+ }+ ],+ "queryFormulas": []+ },+ "clickhouse_sql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "id": "5056105b-1c30-4d27-8187-64457f2a1ec6",+ "promql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "queryType": "builder"+ },+ "softMax": null,+ "softMin": null,+ "thresholds": [],+ "timePreferance": "GLOBAL_TIME",+ "title": "Deadlocks count",+ "yAxisUnit": "none"+ },+ {+ "description": "",+ "fillSpans": false,+ "id": "8638a199-20a0-4255-b0a2-3b1ba06c485b",+ "isStacked": false,+ "nullZeroValues": "zero",+ "opacity": "1",+ "panelTypes": "graph",+ "query": {+ "builder": {+ "queryData": [+ {+ "aggregateAttribute": {+ "dataType": "float64",+ "id": "postgresql_backends--float64--Sum--true",+ "isColumn": true,+ "isJSON": false,+ "key": "postgresql_backends",+ "type": "Sum"+ },+ "aggregateOperator": "avg",+ "dataSource": "metrics",+ "disabled": false,+ "expression": "A",+ "filters": {+ "items": [+ {+ "id": "ed335b00",+ "key": {+ "dataType": "string",+ "id": "host_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "host_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.host_name}}"+ ]+ },+ {+ "id": "20d2a4c5",+ "key": {+ "dataType": "string",+ "id": "postgresql_database_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "postgresql_database_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.db_name}}"+ ]+ }+ ],+ "op": "AND"+ },+ "groupBy": [+ {+ "dataType": "string",+ "id": "postgresql_database_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "postgresql_database_name",+ "type": "tag"+ }+ ],+ "having": [],+ "legend": "{{postgresql_database_name}}",+ "limit": null,+ "orderBy": [],+ "queryName": "A",+ "reduceTo": "sum",+ "stepInterval": 60+ }+ ],+ "queryFormulas": []+ },+ "clickhouse_sql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "id": "205b99a0-2f1c-4bd2-9ba0-cc2da6ef247a",+ "promql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "queryType": "builder"+ },+ "softMax": null,+ "softMin": null,+ "thresholds": [],+ "timePreferance": "GLOBAL_TIME",+ "title": "Connections per db",+ "yAxisUnit": "none"+ },+ {+ "description": "",+ "fillSpans": false,+ "id": "f9a6f683-7455-4643-acc8-467cc5ea52cf",+ "isStacked": false,+ "nullZeroValues": "zero",+ "opacity": "1",+ "panelTypes": "graph",+ "query": {+ "builder": {+ "queryData": [+ {+ "aggregateAttribute": {+ "dataType": "float64",+ "id": "postgresql_rows--float64--Sum--true",+ "isColumn": true,+ "isJSON": false,+ "key": "postgresql_rows",+ "type": "Sum"+ },+ "aggregateOperator": "sum",+ "dataSource": "metrics",+ "disabled": false,+ "expression": "A",+ "filters": {+ "items": [+ {+ "id": "70786905",+ "key": {+ "dataType": "string",+ "id": "state--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "state",+ "type": "tag"+ },+ "op": "=",+ "value": "dead"+ },+ {+ "id": "810e39a9",+ "key": {+ "dataType": "string",+ "id": "host_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "host_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.host_name}}"+ ]+ },+ {+ "id": "3e5ef839",+ "key": {+ "dataType": "string",+ "id": "postgresql_database_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "postgresql_database_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.db_name}}"+ ]+ },+ {+ "id": "9e913563",+ "key": {+ "dataType": "string",+ "id": "postgresql_table_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "postgresql_table_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.table_name}}"+ ]+ }+ ],+ "op": "AND"+ },+ "groupBy": [],+ "having": [],+ "legend": "Dead rows",+ "limit": null,+ "orderBy": [],+ "queryName": "A",+ "reduceTo": "sum",+ "stepInterval": 60+ }+ ],+ "queryFormulas": []+ },+ "clickhouse_sql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "id": "cc7452c8-118b-4676-959e-7062bafc41ee",+ "promql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "queryType": "builder"+ },+ "softMax": null,+ "softMin": null,+ "thresholds": [],+ "timePreferance": "GLOBAL_TIME",+ "title": "Dead rows",+ "yAxisUnit": "none"+ },+ {+ "description": "",+ "fillSpans": false,+ "id": "d7838815-4f5b-4454-86fd-f658b201f3a9",+ "isStacked": false,+ "nullZeroValues": "zero",+ "opacity": "1",+ "panelTypes": "graph",+ "query": {+ "builder": {+ "queryData": [+ {+ "aggregateAttribute": {+ "dataType": "float64",+ "id": "postgresql_index_scans--float64--Sum--true",+ "isColumn": true,+ "isJSON": false,+ "key": "postgresql_index_scans",+ "type": "Sum"+ },+ "aggregateOperator": "sum_rate",+ "dataSource": "metrics",+ "disabled": false,+ "expression": "A",+ "filters": {+ "items": [+ {+ "id": "da04d826",+ "key": {+ "dataType": "string",+ "id": "host_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "host_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.host_name}}"+ ]+ },+ {+ "id": "590332a7",+ "key": {+ "dataType": "string",+ "id": "postgresql_database_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "postgresql_database_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.db_name}}"+ ]+ },+ {+ "id": "171b9516",+ "key": {+ "dataType": "string",+ "id": "postgresql_table_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "postgresql_table_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.table_name}}"+ ]+ }+ ],+ "op": "AND"+ },+ "groupBy": [+ {+ "dataType": "string",+ "id": "postgresql_index_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "postgresql_index_name",+ "type": "tag"+ }+ ],+ "having": [],+ "legend": "{{postgresql_index_name}}",+ "limit": null,+ "orderBy": [],+ "queryName": "A",+ "reduceTo": "sum",+ "stepInterval": 60+ }+ ],+ "queryFormulas": []+ },+ "clickhouse_sql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "id": "2c6b630b-8bd9-4001-815b-f2b1f439a9dd",+ "promql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "queryType": "builder"+ },+ "softMax": null,+ "softMin": null,+ "thresholds": [],+ "timePreferance": "GLOBAL_TIME",+ "title": "Index scans by index",+ "yAxisUnit": "none"+ },+ {+ "description": "",+ "fillSpans": false,+ "id": "9552123d-6265-48a7-8624-3f4a3fc3c9c0",+ "isStacked": false,+ "nullZeroValues": "zero",+ "opacity": "1",+ "panelTypes": "table",+ "query": {+ "builder": {+ "queryData": [+ {+ "aggregateAttribute": {+ "dataType": "float64",+ "id": "postgresql_rows--float64--Sum--true",+ "isColumn": true,+ "isJSON": false,+ "key": "postgresql_rows",+ "type": "Sum"+ },+ "aggregateOperator": "avg",+ "dataSource": "metrics",+ "disabled": false,+ "expression": "A",+ "filters": {+ "items": [+ {+ "id": "83f9cab9",+ "key": {+ "dataType": "string",+ "id": "state--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "state",+ "type": "tag"+ },+ "op": "=",+ "value": "dead"+ },+ {+ "id": "2a0284c2",+ "key": {+ "dataType": "string",+ "id": "host_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "host_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.host_name}}"+ ]+ },+ {+ "id": "c2aaf758",+ "key": {+ "dataType": "string",+ "id": "postgresql_database_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "postgresql_database_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.db_name}}"+ ]+ },+ {+ "id": "a603fda9",+ "key": {+ "dataType": "string",+ "id": "postgresql_table_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "postgresql_table_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.table_name}}"+ ]+ }+ ],+ "op": "AND"+ },+ "groupBy": [+ {+ "dataType": "string",+ "id": "postgresql_table_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "postgresql_table_name",+ "type": "tag"+ }+ ],+ "having": [],+ "legend": "Dead rows",+ "limit": null,+ "orderBy": [],+ "queryName": "A",+ "reduceTo": "sum",+ "stepInterval": 60+ },+ {+ "aggregateAttribute": {+ "dataType": "float64",+ "id": "postgresql_rows--float64--Sum--true",+ "isColumn": true,+ "isJSON": false,+ "key": "postgresql_rows",+ "type": "Sum"+ },+ "aggregateOperator": "avg",+ "dataSource": "metrics",+ "disabled": false,+ "expression": "B",+ "filters": {+ "items": [+ {+ "id": "82f1f0f5",+ "key": {+ "dataType": "string",+ "id": "state--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "state",+ "type": "tag"+ },+ "op": "=",+ "value": "live"+ },+ {+ "id": "14de7a06",+ "key": {+ "dataType": "string",+ "id": "host_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "host_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.host_name}}"+ ]+ },+ {+ "id": "0a88a27a",+ "key": {+ "dataType": "string",+ "id": "postgresql_database_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "postgresql_database_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.db_name}}"+ ]+ },+ {+ "id": "4417218d",+ "key": {+ "dataType": "string",+ "id": "postgresql_table_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "postgresql_table_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.table_name}}"+ ]+ }+ ],+ "op": "AND"+ },+ "groupBy": [+ {+ "dataType": "string",+ "id": "postgresql_table_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "postgresql_table_name",+ "type": "tag"+ }+ ],+ "having": [],+ "legend": "Live rows",+ "limit": null,+ "orderBy": [],+ "queryName": "B",+ "reduceTo": "sum",+ "stepInterval": 60+ },+ {+ "aggregateAttribute": {+ "dataType": "float64",+ "id": "postgresql_index_scans--float64--Sum--true",+ "isColumn": true,+ "isJSON": false,+ "key": "postgresql_index_scans",+ "type": "Sum"+ },+ "aggregateOperator": "sum_rate",+ "dataSource": "metrics",+ "disabled": false,+ "expression": "C",+ "filters": {+ "items": [+ {+ "id": "22795c15",+ "key": {+ "dataType": "string",+ "id": "host_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "host_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.host_name}}"+ ]+ },+ {+ "id": "d7e7c193",+ "key": {+ "dataType": "string",+ "id": "postgresql_database_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "postgresql_database_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.db_name}}"+ ]+ },+ {+ "id": "d3ae1dbe",+ "key": {+ "dataType": "string",+ "id": "postgresql_table_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "postgresql_table_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.table_name}}"+ ]+ }+ ],+ "op": "AND"+ },+ "groupBy": [+ {+ "dataType": "string",+ "id": "postgresql_table_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "postgresql_table_name",+ "type": "tag"+ }+ ],+ "having": [],+ "legend": "Index scans",+ "limit": null,+ "orderBy": [],+ "queryName": "C",+ "reduceTo": "sum",+ "stepInterval": 60+ },+ {+ "aggregateAttribute": {+ "dataType": "float64",+ "id": "postgresql_table_size--float64--Sum--true",+ "isColumn": true,+ "isJSON": false,+ "key": "postgresql_table_size",+ "type": "Sum"+ },+ "aggregateOperator": "avg",+ "dataSource": "metrics",+ "disabled": false,+ "expression": "D",+ "filters": {+ "items": [+ {+ "id": "48c436ab",+ "key": {+ "dataType": "string",+ "id": "host_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "host_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.host_name}}"+ ]+ },+ {+ "id": "cc617789",+ "key": {+ "dataType": "string",+ "id": "postgresql_database_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "postgresql_database_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.db_name}}"+ ]+ },+ {+ "id": "b4029d50",+ "key": {+ "dataType": "string",+ "id": "postgresql_table_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "postgresql_table_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.table_name}}"+ ]+ }+ ],+ "op": "AND"+ },+ "groupBy": [+ {+ "dataType": "string",+ "id": "postgresql_table_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "postgresql_table_name",+ "type": "tag"+ }+ ],+ "having": [],+ "legend": "Table size",+ "limit": null,+ "orderBy": [],+ "queryName": "D",+ "reduceTo": "sum",+ "stepInterval": 60+ }+ ],+ "queryFormulas": []+ },+ "clickhouse_sql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "id": "26a9dcbf-4fc7-4ddd-b786-2078def1f462",+ "promql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "queryType": "builder"+ },+ "softMax": null,+ "softMin": null,+ "thresholds": [],+ "timePreferance": "GLOBAL_TIME",+ "title": "Table stats",+ "yAxisUnit": "none"+ }+ ]+}\ No newline at end of filediff --git a/pkg/query-service/app/integrations/builtin_integrations/postgres/assets/pipelines/log-parser.json b/pkg/query-service/app/integrations/builtin_integrations/postgres/assets/pipelines/log-parser.jsonnew file mode 100644index 0000000000..776565861c--- /dev/null+++ b/pkg/query-service/app/integrations/builtin_integrations/postgres/assets/pipelines/log-parser.json@@ -0,0 +1,33 @@+{+ "id": "parse-default-postgres-access-log",+ "name": "Parse default postgres access log",+ "alias": "parse-default-postgres-access-log",+ "description": "Parse standard postgres access log",+ "enabled": true,+ "filter": {+ "op": "AND",+ "items": [+ {+ "key": {+ "type": "tag",+ "key": "source",+ "dataType": "string"+ },+ "op": "=",+ "value": "postgres"+ }+ ]+ },+ "config": [+ {+ "type": "grok_parser",+ "id": "parse-body-grok",+ "enabled": true,+ "orderId": 1,+ "name": "Parse Body",+ "parse_to": "attributes",+ "pattern": "%{GREEDYDATA}",+ "parse_from": "body"+ }+ ]+}\ No newline at end of filediff --git a/pkg/query-service/app/integrations/builtin_integrations/postgres/config/configure-otel-collector.md b/pkg/query-service/app/integrations/builtin_integrations/postgres/config/configure-otel-collector.mdnew file mode 100644index 0000000000..3eb3a39b03--- /dev/null+++ b/pkg/query-service/app/integrations/builtin_integrations/postgres/config/configure-otel-collector.md@@ -0,0 +1,72 @@+### Configure otel collector++#### Save collector config file++Save the following collector config in a file named `postgres-collector-config.yaml`++```+receivers:+ postgresql:+ # The endpoint of the postgresql server. Whether using TCP or Unix sockets, this value should be host:port. If transport is set to unix, the endpoint will internally be translated from host:port to /host.s.PGSQL.port+ endpoint: "localhost:5432"+ # The frequency at which to collect metrics from the Postgres instance.+ collection_interval: 60s+ # The username used to access the postgres instance+ username: monitoring+ # The password used to access the postgres instance+ password: ${env:POSTGRESQL_PASSWORD}+ # The list of databases for which the receiver will attempt to collect statistics. If an empty list is provided, the receiver will attempt to collect statistics for all non-template databases+ databases: []+ # List of databases which will be excluded when collecting statistics.+ exclude_databases: []+ # # Defines the network to use for connecting to the server. Valid Values are `tcp` or `unix`+ # transport: tcp+ tls:+ # set to false if SSL is enabled on the server+ insecure: true+ # ca_file: /etc/ssl/certs/ca-certificates.crt+ # cert_file: /etc/ssl/certs/postgres.crt+ # key_file: /etc/ssl/certs/postgres.key+ metrics:+ postgresql.database.locks:+ enabled: true+ postgresql.deadlocks:+ enabled: true+ postgresql.sequential_scans:+ enabled: true++processors:+ # enriches the data with additional host information+ # see https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/resourcedetectionprocessor#resource-detection-processor+ resourcedetection/system:+ # add additional detectors if needed+ detectors: ["system"]+ system:+ hostname_sources: ["os"]++exporters:+ # export to local collector+ otlp/local:+ endpoint: "localhost:4317"+ tls:+ insecure: true+ # export to SigNoz cloud+ otlp/signoz:+ endpoint: "ingest.{region}.signoz.cloud:443"+ tls:+ insecure: false+ headers:+ "signoz-access-token": "<SIGNOZ_INGESTION_KEY>"++service:+ pipelines:+ metrics/postgresql:+ receivers: [postgresql]+ # note: remove this processor if the collector host is not running on the same host as the postgres instance+ processors: [resourcedetection/system]+ exporters: [otlp/local]+```++#### Use collector config file++Run your collector with the added flag `--config postgres-collector-config.yaml`diff --git a/pkg/query-service/app/integrations/builtin_integrations/postgres/config/prerequisites.md b/pkg/query-service/app/integrations/builtin_integrations/postgres/config/prerequisites.mdnew file mode 100644index 0000000000..004692ba53--- /dev/null+++ b/pkg/query-service/app/integrations/builtin_integrations/postgres/config/prerequisites.md@@ -0,0 +1,26 @@+### Prepare postgres for monitoring++- Have a running postgresql instance+- Have the monitoring user created+- Have the monitoring user granted the necessary permissions++This receiver supports PostgreSQL versions 9.6+++For PostgreSQL versions 10+, run:++```+create user monitoring with password '<PASSWORD>';+grant pg_monitor to monitoring;+grant SELECT ON pg_stat_database to monitoring;+```++For PostgreSQL versions >= 9.6 and <10, run:++```+create user monitoring with password '<PASSWORD>';+grant SELECT ON pg_stat_database to monitoring;+```++Set the following environment variables:++- POSTGRESQL_PASSWORDdiff --git a/pkg/query-service/app/integrations/builtin_integrations/postgres/icon.svg b/pkg/query-service/app/integrations/builtin_integrations/postgres/icon.svgnew file mode 100644index 0000000000..32bcf493ef--- /dev/null+++ b/pkg/query-service/app/integrations/builtin_integrations/postgres/icon.svg@@ -0,0 +1,13 @@+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">+<g clip-path="url(#clip0_2128_409)">+<path d="M23.5462 14.3715C23.4066 13.9488 23.0411 13.6545 22.5684 13.5838C22.3455 13.5505 22.0902 13.5647 21.7881 13.627C21.2615 13.7356 20.8709 13.777 20.5858 13.785C21.6619 11.9682 22.5369 9.89636 23.0406 7.94609C23.8552 4.79255 23.4199 3.35591 22.9113 2.70609C21.5652 0.986091 19.6013 0.0620908 17.232 0.033818C15.9681 0.0183635 14.8585 0.267909 14.2797 0.447363C13.7408 0.352273 13.1614 0.299182 12.5534 0.289364C11.4136 0.271182 10.4066 0.519636 9.54618 1.03027C9.06982 0.869182 8.30527 0.642091 7.42236 0.497182C5.34582 0.156273 3.67218 0.421909 2.448 1.28673C0.965637 2.33382 0.278455 4.15309 0.405546 6.694C0.445909 7.50073 0.897182 9.95527 1.60773 12.2831C2.01609 13.6211 2.45155 14.7322 2.902 15.5858C3.54082 16.7963 4.22436 17.5091 4.99173 17.7651C5.42182 17.9084 6.20327 18.0087 7.02518 17.3242C7.12936 17.4504 7.26836 17.5757 7.45282 17.6922C7.68709 17.8399 7.97355 17.9606 8.25964 18.0322C9.29064 18.2899 10.2564 18.2255 11.0803 17.8642C11.0854 18.0107 11.0893 18.1507 11.0925 18.2716C11.098 18.4677 11.1035 18.66 11.1106 18.8398C11.1595 20.0556 11.2422 21.001 11.4873 21.6625C11.5007 21.6988 11.5188 21.7543 11.5379 21.8131C11.6602 22.1875 11.8646 22.8142 12.3848 23.305C12.9235 23.8135 13.575 23.9694 14.1717 23.9694C14.471 23.9694 14.7565 23.9301 15.007 23.8765C15.8997 23.6851 16.9136 23.3936 17.6471 22.3493C18.3405 21.362 18.6776 19.875 18.7386 17.532C18.7465 17.4657 18.7538 17.4025 18.7608 17.3422L18.7754 17.2184L18.9387 17.2327L18.9808 17.2355C19.8901 17.277 21.0019 17.0842 21.6847 16.767C22.2243 16.5166 23.9533 15.6038 23.5462 14.3715Z" fill="black"/>+<path d="M21.9915 14.6111C19.2878 15.1688 19.1019 14.2535 19.1019 14.2535C21.9565 10.0177 23.1498 4.64109 22.1201 3.32518C19.3106 -0.264364 14.4475 1.43327 14.3663 1.47727L14.3402 1.482C13.806 1.37109 13.2083 1.30509 12.5364 1.29409C11.3131 1.27409 10.3851 1.61482 9.68091 2.14882C9.68091 2.14882 1.00545 -1.42518 1.409 6.64373C1.49482 8.36027 3.86936 19.6322 6.70155 16.2275C7.73673 14.9825 8.737 13.9299 8.737 13.9299C9.23373 14.2599 9.82845 14.4283 10.4519 14.3678L10.5004 14.3267C10.4853 14.4813 10.4922 14.6325 10.5197 14.8115C9.79009 15.6266 10.0045 15.7697 8.546 16.07C7.07009 16.3742 7.93709 16.9156 8.50318 17.0573C9.18945 17.2288 10.7771 17.4719 11.8498 15.9702L11.8071 16.1415C12.0929 16.3705 12.2936 17.6309 12.26 18.7735C12.2264 19.9161 12.2039 20.7005 12.4291 21.3133C12.6545 21.926 12.8789 23.3046 14.7964 22.8938C16.3985 22.5505 17.2287 21.6607 17.3443 20.1765C17.4262 19.1215 17.6117 19.2775 17.6234 18.3341L17.7722 17.8875C17.9437 16.4573 17.7995 15.9958 18.7865 16.2105L19.0265 16.2315C19.7528 16.2645 20.7037 16.1146 21.2618 15.8553C22.4635 15.2976 23.1762 14.3665 21.9913 14.6111H21.9915Z" fill="#336791"/>+<path d="M10.1887 7.41136C9.94509 7.37745 9.72445 7.40882 9.61282 7.49336C9.55009 7.54091 9.53064 7.596 9.52536 7.63391C9.51136 7.73436 9.58173 7.84545 9.625 7.90273C9.74736 8.06491 9.92609 8.17636 10.103 8.20091C10.1286 8.20454 10.1542 8.20618 10.1795 8.20618C10.4745 8.20618 10.7428 7.97645 10.7665 7.80691C10.796 7.59454 10.4877 7.45291 10.1887 7.41136ZM18.26 7.41809C18.2367 7.25164 17.9405 7.20418 17.6595 7.24327C17.3787 7.28236 17.1065 7.40909 17.1293 7.57591C17.1475 7.70564 17.3817 7.92709 17.659 7.92709C17.6825 7.92709 17.7061 7.92554 17.7299 7.92218C17.915 7.89654 18.0508 7.779 18.1154 7.71127C18.2135 7.608 18.2705 7.49291 18.26 7.41809Z" fill="white"/>+<path d="M22.8911 14.5477C22.788 14.236 22.4562 14.1357 21.9049 14.2495C20.2681 14.5874 19.6819 14.3534 19.4895 14.2116C20.7617 12.2735 21.8084 9.93055 22.373 7.74464C22.6405 6.70918 22.7882 5.74755 22.8003 4.96373C22.8136 4.10346 22.6671 3.47127 22.3649 3.08509C21.1465 1.52827 19.3584 0.693182 17.1938 0.670273C15.7057 0.653546 14.4485 1.03436 14.2047 1.14145C13.6915 1.01382 13.1319 0.935455 12.5227 0.925455C11.4056 0.907364 10.44 1.17482 9.64055 1.72C9.29327 1.59073 8.39582 1.28264 7.29827 1.10582C5.40082 0.800364 3.893 1.03182 2.817 1.79409C1.53309 2.70373 0.940364 4.32973 1.05518 6.62682C1.09382 7.39964 1.53418 9.77709 2.22909 12.0539C3.14382 15.0506 4.13818 16.7471 5.18436 17.0961C5.30682 17.1369 5.448 17.1655 5.60373 17.1655C5.98536 17.1655 6.45327 16.9935 6.94009 16.4082C7.53387 15.6959 8.1481 15.0009 8.782 14.324C9.19327 14.5447 9.64509 14.668 10.1072 14.6804C10.1081 14.6925 10.1093 14.7045 10.1104 14.7165C10.0308 14.8114 9.95293 14.9076 9.87673 15.0052C9.55655 15.4116 9.48991 15.4963 8.45927 15.7085C8.16609 15.769 7.38745 15.9295 7.376 16.4753C7.36364 17.0716 8.29645 17.3221 8.40273 17.3486C8.77309 17.4414 9.12991 17.4871 9.47018 17.4871C10.2977 17.4871 11.026 17.2151 11.608 16.6888C11.5901 18.8148 11.6787 20.9097 11.934 21.548C12.1431 22.0705 12.6538 23.3475 14.2671 23.3475C14.5038 23.3475 14.7644 23.3199 15.051 23.2585C16.7347 22.8975 17.4659 22.1534 17.7487 20.5127C17.9001 19.6359 18.1598 17.5422 18.282 16.4191C18.5398 16.4995 18.8717 16.5364 19.2305 16.5363C19.9789 16.5363 20.8425 16.3773 21.384 16.1259C21.9924 15.8434 23.0902 15.1501 22.8911 14.5477ZM18.8815 6.95864C18.8759 7.29018 18.8303 7.59118 18.7819 7.90536C18.7298 8.24327 18.676 8.59264 18.6625 9.01673C18.6491 9.42945 18.7006 9.85855 18.7505 10.2735C18.8512 11.1117 18.9545 11.9746 18.5545 12.8261C18.488 12.7083 18.4288 12.5866 18.3772 12.4616C18.3275 12.3411 18.2195 12.1475 18.0699 11.8795C17.4882 10.8362 16.1259 8.39309 16.8233 7.39618C17.031 7.09945 17.5582 6.79436 18.8815 6.95864ZM17.2775 1.34164C19.2169 1.38445 20.7511 2.11 21.8373 3.498C22.6704 4.56264 21.753 9.40691 19.0973 13.5861C19.0706 13.5521 19.0437 13.5183 19.0167 13.4845L18.9831 13.4425C19.6694 12.3092 19.5352 11.1878 19.4157 10.1936C19.3666 9.78564 19.3203 9.40027 19.3321 9.03827C19.3443 8.65464 19.395 8.32555 19.4441 8.00736C19.5044 7.61527 19.5657 7.20955 19.5488 6.73127C19.5615 6.68109 19.5665 6.62182 19.5599 6.55146C19.5167 6.09282 18.9931 4.72018 17.9258 3.47782C17.342 2.79827 16.4906 2.03782 15.3282 1.52491C15.8282 1.42127 16.5119 1.32464 17.2775 1.34164ZM6.42491 15.9798C5.88855 16.6247 5.51818 16.5011 5.39636 16.4605C4.60273 16.1958 3.68182 14.5184 2.86991 11.8584C2.16736 9.55673 1.75682 7.24227 1.72427 6.59327C1.62173 4.54073 2.11927 3.11027 3.20318 2.34155C4.96718 1.09064 7.86736 1.83936 9.03273 2.21909C9.016 2.23564 8.99855 2.25109 8.982 2.26791C7.06964 4.19918 7.115 7.49882 7.11973 7.70055C7.11955 7.77836 7.12609 7.88855 7.135 8.04009C7.16791 8.59509 7.22918 9.628 7.06555 10.7977C6.91355 11.8847 7.24864 12.9486 7.98473 13.7167C8.06027 13.7954 8.13967 13.8703 8.22264 13.9411C7.895 14.292 7.18291 15.068 6.42491 15.9798ZM8.46845 13.2532C7.87518 12.6341 7.60573 11.773 7.72909 10.8905C7.90182 9.65482 7.83809 8.57864 7.80382 8.00045C7.799 7.91955 7.79473 7.84864 7.79227 7.79273C8.07164 7.545 9.36627 6.85136 10.2895 7.06291C10.7108 7.15936 10.9675 7.44627 11.0743 7.93973C11.6266 10.4945 11.1474 11.5594 10.7623 12.4151C10.6829 12.5914 10.6079 12.758 10.5439 12.9304L10.4943 13.0636C10.3686 13.4005 10.2517 13.7138 10.1793 14.0113C9.54855 14.0095 8.935 13.74 8.46845 13.2531V13.2532ZM8.56527 16.6986C8.38109 16.6526 8.21546 16.5727 8.11827 16.5065C8.19945 16.4683 8.34391 16.4163 8.59445 16.3646C9.80691 16.1151 9.99418 15.9389 10.4031 15.4197C10.4968 15.3006 10.6031 15.1657 10.7503 15.0014L10.7505 15.0012C10.9696 14.7557 11.0699 14.7974 11.2517 14.8728C11.3991 14.9337 11.5426 15.1185 11.6008 15.3217C11.6284 15.4177 11.6593 15.5999 11.5581 15.7417C10.7039 16.9377 9.45918 16.9224 8.56527 16.6986ZM14.9106 22.6034C13.4274 22.9212 12.9022 22.1644 12.5561 21.2992C12.3327 20.7406 12.2229 18.2219 12.3008 15.4404C12.3018 15.4034 12.2965 15.3676 12.2864 15.334C12.2773 15.2676 12.2634 15.2019 12.2449 15.1375C12.1291 14.7327 11.8468 14.3942 11.5082 14.2538C11.3736 14.1981 11.1267 14.0958 10.83 14.1717C10.8933 13.911 11.003 13.6165 11.122 13.2977L11.1719 13.1636C11.2281 13.0125 11.2986 12.8558 11.3732 12.69C11.7762 11.7947 12.3281 10.5685 11.7291 7.79818C11.5047 6.76055 10.7555 6.25382 9.61964 6.37155C8.93873 6.442 8.31573 6.71673 8.005 6.87427C7.93818 6.90809 7.87709 6.94082 7.82 6.97264C7.90673 5.92718 8.23436 3.97336 9.46 2.73718C10.2317 1.959 11.2595 1.57464 12.5116 1.59536C14.9789 1.63573 16.5611 2.90191 17.454 3.95709C18.2235 4.86627 18.6401 5.78218 18.8064 6.27618C17.5559 6.149 16.7055 6.39582 16.2744 7.01218C15.3365 8.35291 16.7875 10.9551 17.4848 12.2057C17.6127 12.4349 17.7231 12.633 17.7578 12.7172C17.9849 13.2675 18.2789 13.635 18.4935 13.9032C18.5594 13.9854 18.6232 14.0651 18.6717 14.1347C18.293 14.2439 17.6127 14.4962 17.6747 15.7572C17.6247 16.3899 17.2692 19.3523 17.0885 20.3989C16.8501 21.7816 16.3413 22.2966 14.9106 22.6035V22.6034ZM21.1019 15.5183C20.7146 15.698 20.0665 15.8328 19.4509 15.8618C18.7709 15.8936 18.4247 15.7856 18.3433 15.7192C18.3051 14.9334 18.5975 14.8513 18.9071 14.7644C18.9557 14.7507 19.0032 14.7374 19.049 14.7214C19.0775 14.7445 19.1086 14.7675 19.1428 14.7901C19.6894 15.1508 20.6642 15.1897 22.0405 14.9056L22.0555 14.9026C21.8699 15.0762 21.5523 15.3091 21.1019 15.5183Z" fill="white"/>+</g>+<defs>+<clipPath id="clip0_2128_409">+<rect width="24" height="24" fill="white"/>+</clipPath>+</defs>+</svg>\ No newline at end of filediff --git a/pkg/query-service/app/integrations/builtin_integrations/postgres/integration.json b/pkg/query-service/app/integrations/builtin_integrations/postgres/integration.jsonnew file mode 100644index 0000000000..9b3da798bc--- /dev/null+++ b/pkg/query-service/app/integrations/builtin_integrations/postgres/integration.json@@ -0,0 +1,88 @@+{+ "id": "postgres",+ "title": "PostgreSQL",+ "description": "Monitor postgres using logs and metrics.",+ "author": {+ "name": "SigNoz",+ "email": "[email protected]",+ "homepage": "https://signoz.io"+ },+ "icon": "file://icon.svg",+ "categories": [+ "Database"+ ],+ "overview": "file://overview.md",+ "configuration": [+ {+ "title": "Prerequisites",+ "instructions": "file://config/prerequisites.md"+ },+ {+ "title": "Configure Otel Collector",+ "instructions": "file://config/configure-otel-collector.md"+ }+ ],+ "assets": {+ "logs": {+ "pipelines": [+ "file://assets/pipelines/log-parser.json"+ ]+ },+ "dashboards": [+ "file://assets/dashboards/overview.json"+ ],+ "alerts": []+ },+ "connection_tests": {+ "logs": {+ "op": "AND",+ "items": [+ {+ "key": {+ "type": "tag",+ "key": "source",+ "dataType": "string"+ },+ "op": "=",+ "value": "postgres"+ }+ ]+ }+ },+ "data_collected": {+ "logs": [+ {+ "name": "Request Method",+ "path": "attributes[\"http.request.method\"]",+ "type": "string",+ "description": "HTTP method"+ },+ {+ "name": "Request Path",+ "path": "attributes[\"url.path\"]",+ "type": "string",+ "description": "path requested"+ },+ {+ "name": "Response Status Code",+ "path": "attributes[\"http.response.status_code\"]",+ "type": "int",+ "description": "HTTP response code"+ }+ ],+ "metrics": [+ {+ "name": "http.server.request.duration",+ "type": "Histogram",+ "unit": "s",+ "description": "Duration of HTTP server requests"+ },+ {+ "name": "http.server.active_requests",+ "type": "UpDownCounter",+ "unit": "{ request }",+ "description": "Number of active HTTP server requests"+ }+ ]+ }+}diff --git a/pkg/query-service/app/integrations/builtin_integrations/postgres/overview.md b/pkg/query-service/app/integrations/builtin_integrations/postgres/overview.mdnew file mode 100644index 0000000000..4af57e6b20--- /dev/null+++ b/pkg/query-service/app/integrations/builtin_integrations/postgres/overview.md@@ -0,0 +1,3 @@+### Monitor Postgres with SigNoz++Parse your Postgres logs and collect key metrics.diff --git a/pkg/query-service/app/integrations/builtin_integrations/redis/assets/dashboards/overview.json b/pkg/query-service/app/integrations/builtin_integrations/redis/assets/dashboards/overview.jsonnew file mode 100644index 0000000000..58e964af73--- /dev/null+++ b/pkg/query-service/app/integrations/builtin_integrations/redis/assets/dashboards/overview.json@@ -0,0 +1,923 @@+{+ "description": "This dashboard shows the Redis instance overview. It includes latency, hit/miss rate, connections, and memory information.\n",+ "layout": [+ {+ "h": 3,+ "i": "d4c164bc-8fc2-4dbc-aadd-8d17479ca649",+ "moved": false,+ "static": false,+ "w": 6,+ "x": 0,+ "y": 9+ },+ {+ "h": 3,+ "i": "2fbaef0d-3cdb-4ce3-aa3c-9bbbb41786d9",+ "moved": false,+ "static": false,+ "w": 6,+ "x": 3,+ "y": 6+ },+ {+ "h": 3,+ "i": "f5ee1511-0d2b-4404-9ce0-e991837decc2",+ "moved": false,+ "static": false,+ "w": 6,+ "x": 6,+ "y": 3+ },+ {+ "h": 3,+ "i": "b19c7058-b806-4ea2-974a-ca555b168991",+ "moved": false,+ "static": false,+ "w": 6,+ "x": 0,+ "y": 3+ },+ {+ "h": 3,+ "i": "bf0deeeb-e926-4234-944c-82bacd96af47",+ "moved": false,+ "static": false,+ "w": 6,+ "x": 6,+ "y": 0+ },+ {+ "h": 3,+ "i": "a77227c7-16f5-4353-952e-b183c715a61c",+ "moved": false,+ "static": false,+ "w": 6,+ "x": 0,+ "y": 0+ },+ {+ "h": 3,+ "i": "9698cee2-b1f3-4c0b-8c9f-3da4f0e05f17",+ "moved": false,+ "static": false,+ "w": 6,+ "x": 6,+ "y": 9+ },+ {+ "h": 3,+ "i": "64a5f303-d7db-44ff-9a0e-948e5c653320",+ "moved": false,+ "static": false,+ "w": 6,+ "x": 0,+ "y": 12+ },+ {+ "h": 3,+ "i": "3e80a918-69af-4c9a-bc57-a94e1d41b05c",+ "moved": false,+ "static": false,+ "w": 6,+ "x": 6,+ "y": 12+ }+ ],+ "name": "",+ "tags": [+ "redis",+ "database"+ ],+ "title": "Redis overview",+ "variables": {+ "94f19b3c-ad9f-4b47-a9b2-f312c09fa965": {+ "allSelected": true,+ "customValue": "",+ "description": "List of hosts sending Redis metrics",+ "id": "94f19b3c-ad9f-4b47-a9b2-f312c09fa965",+ "key": "94f19b3c-ad9f-4b47-a9b2-f312c09fa965",+ "modificationUUID": "4c5b0c03-9cbc-425b-8d8e-7152e5c39ba8",+ "multiSelect": true,+ "name": "host_name",+ "order": 0,+ "queryValue": "SELECT JSONExtractString(labels, 'host_name') AS host_name\nFROM signoz_metrics.distributed_time_series_v4_1day\nWHERE metric_name = 'redis_cpu_time'\nGROUP BY host_name",+ "selectedValue": [+ "Srikanths-MacBook-Pro.local"+ ],+ "showALLOption": true,+ "sort": "ASC",+ "textboxValue": "",+ "type": "QUERY"+ }+ },+ "widgets": [+ {+ "description": "Rate successful lookup of keys in the main dictionary",+ "fillSpans": false,+ "id": "a77227c7-16f5-4353-952e-b183c715a61c",+ "isStacked": false,+ "nullZeroValues": "zero",+ "opacity": "1",+ "panelTypes": "graph",+ "query": {+ "builder": {+ "queryData": [+ {+ "aggregateAttribute": {+ "dataType": "float64",+ "id": "redis_keyspace_hits--float64--Sum--true",+ "isColumn": true,+ "isJSON": false,+ "key": "redis_keyspace_hits",+ "type": "Sum"+ },+ "aggregateOperator": "sum_rate",+ "dataSource": "metrics",+ "disabled": false,+ "expression": "A",+ "filters": {+ "items": [+ {+ "id": "e99669ea",+ "key": {+ "dataType": "string",+ "id": "host_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "host_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.host_name}}"+ ]+ }+ ],+ "op": "AND"+ },+ "groupBy": [],+ "having": [],+ "legend": "Hit/s across all hosts",+ "limit": null,+ "orderBy": [],+ "queryName": "A",+ "reduceTo": "sum",+ "stepInterval": 60+ }+ ],+ "queryFormulas": []+ },+ "clickhouse_sql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "id": "42c9c117-bfaf-49f7-b528-aad099392295",+ "promql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "queryType": "builder"+ },+ "softMax": null,+ "softMin": null,+ "thresholds": [],+ "timePreferance": "GLOBAL_TIME",+ "title": "Hits/s",+ "yAxisUnit": "none"+ },+ {+ "description": "Number of clients pending on a blocking call",+ "fillSpans": false,+ "id": "bf0deeeb-e926-4234-944c-82bacd96af47",+ "isStacked": false,+ "nullZeroValues": "zero",+ "opacity": "1",+ "panelTypes": "graph",+ "query": {+ "builder": {+ "queryData": [+ {+ "aggregateAttribute": {+ "dataType": "float64",+ "id": "redis_clients_blocked--float64--Sum--true",+ "isColumn": true,+ "isJSON": false,+ "key": "redis_clients_blocked",+ "type": "Sum"+ },+ "aggregateOperator": "sum",+ "dataSource": "metrics",+ "disabled": false,+ "expression": "A",+ "filters": {+ "items": [+ {+ "id": "97247f25",+ "key": {+ "dataType": "string",+ "id": "host_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "host_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.host_name}}"+ ]+ }+ ],+ "op": "AND"+ },+ "groupBy": [],+ "having": [],+ "legend": "Blocked clients across all hosts",+ "limit": null,+ "orderBy": [],+ "queryName": "A",+ "reduceTo": "sum",+ "stepInterval": 60+ }+ ],+ "queryFormulas": []+ },+ "clickhouse_sql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "id": "b77a9e11-fb98-4a95-88a8-c3ad25c14369",+ "promql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "queryType": "builder"+ },+ "softMax": null,+ "softMin": null,+ "thresholds": [],+ "timePreferance": "GLOBAL_TIME",+ "title": "Clients blocked",+ "yAxisUnit": "none"+ },+ {+ "description": "",+ "fillSpans": false,+ "id": "b19c7058-b806-4ea2-974a-ca555b168991",+ "isStacked": false,+ "nullZeroValues": "zero",+ "opacity": "1",+ "panelTypes": "graph",+ "query": {+ "builder": {+ "queryData": [+ {+ "aggregateAttribute": {+ "dataType": "",+ "id": "redis_db_keys------false",+ "isColumn": false,+ "key": "redis_db_keys",+ "type": ""+ },+ "aggregateOperator": "sum",+ "dataSource": "metrics",+ "disabled": false,+ "expression": "A",+ "filters": {+ "items": [],+ "op": "AND"+ },+ "groupBy": [],+ "having": [],+ "legend": "",+ "limit": null,+ "orderBy": [],+ "queryName": "A",+ "reduceTo": "sum",+ "stepInterval": 60+ }+ ],+ "queryFormulas": []+ },+ "clickhouse_sql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "id": "b77a9e11-fb98-4a95-88a8-c3ad25c14369",+ "promql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "queryType": "builder"+ },+ "softMax": null,+ "softMin": null,+ "thresholds": [],+ "timePreferance": "GLOBAL_TIME",+ "title": "Keyspace Keys",+ "yAxisUnit": "none"+ },+ {+ "description": "Number of changes since the last dump",+ "fillSpans": false,+ "id": "f5ee1511-0d2b-4404-9ce0-e991837decc2",+ "isStacked": false,+ "nullZeroValues": "zero",+ "opacity": "1",+ "panelTypes": "graph",+ "query": {+ "builder": {+ "queryData": [+ {+ "aggregateAttribute": {+ "dataType": "float64",+ "id": "redis_rdb_changes_since_last_save--float64--Sum--true",+ "isColumn": true,+ "isJSON": false,+ "key": "redis_rdb_changes_since_last_save",+ "type": "Sum"+ },+ "aggregateOperator": "sum",+ "dataSource": "metrics",+ "disabled": false,+ "expression": "A",+ "filters": {+ "items": [+ {+ "id": "d4aef346",+ "key": {+ "dataType": "string",+ "id": "host_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "host_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.host_name}}"+ ]+ }+ ],+ "op": "AND"+ },+ "groupBy": [],+ "having": [],+ "legend": "Number of unsaved changes",+ "limit": null,+ "orderBy": [],+ "queryName": "A",+ "reduceTo": "sum",+ "stepInterval": 60+ }+ ],+ "queryFormulas": []+ },+ "clickhouse_sql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "id": "32cedddf-606d-4de1-8c1d-4b7049e6430c",+ "promql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "queryType": "builder"+ },+ "softMax": null,+ "softMin": null,+ "thresholds": [],+ "timePreferance": "GLOBAL_TIME",+ "title": "Unsaved changes",+ "yAxisUnit": "none"+ },+ {+ "description": "",+ "fillSpans": false,+ "id": "2fbaef0d-3cdb-4ce3-aa3c-9bbbb41786d9",+ "isStacked": false,+ "nullZeroValues": "zero",+ "opacity": "1",+ "panelTypes": "graph",+ "query": {+ "builder": {+ "queryData": [+ {+ "aggregateAttribute": {+ "dataType": "float64",+ "id": "redis_commands--float64--Gauge--true",+ "isColumn": true,+ "isJSON": false,+ "key": "redis_commands",+ "type": "Gauge"+ },+ "aggregateOperator": "sum",+ "dataSource": "metrics",+ "disabled": false,+ "expression": "A",+ "filters": {+ "items": [+ {+ "id": "458dc402",+ "key": {+ "dataType": "string",+ "id": "host_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "host_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.host_name}}"+ ]+ }+ ],+ "op": "AND"+ },+ "groupBy": [],+ "having": [],+ "legend": "ops/s",+ "limit": null,+ "orderBy": [],+ "queryName": "A",+ "reduceTo": "sum",+ "stepInterval": 60+ }+ ],+ "queryFormulas": []+ },+ "clickhouse_sql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "id": "c70de4dd-a68a-42df-a249-6610c296709c",+ "promql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "queryType": "builder"+ },+ "softMax": null,+ "softMin": null,+ "thresholds": [],+ "timePreferance": "GLOBAL_TIME",+ "title": "Command/s",+ "yAxisUnit": "ops"+ },+ {+ "description": "",+ "fillSpans": false,+ "id": "d4c164bc-8fc2-4dbc-aadd-8d17479ca649",+ "isStacked": false,+ "nullZeroValues": "zero",+ "opacity": "1",+ "panelTypes": "graph",+ "query": {+ "builder": {+ "queryData": [+ {+ "aggregateAttribute": {+ "dataType": "float64",+ "id": "redis_memory_used--float64--Gauge--true",+ "isColumn": true,+ "isJSON": false,+ "key": "redis_memory_used",+ "type": "Gauge"+ },+ "aggregateOperator": "sum",+ "dataSource": "metrics",+ "disabled": false,+ "expression": "A",+ "filters": {+ "items": [+ {+ "id": "394a537e",+ "key": {+ "dataType": "string",+ "id": "host_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "host_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.host_name}}"+ ]+ }+ ],+ "op": "AND"+ },+ "groupBy": [+ {+ "dataType": "string",+ "id": "host_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "host_name",+ "type": "tag"+ }+ ],+ "having": [],+ "legend": "Used::{{host_name}}",+ "limit": null,+ "orderBy": [],+ "queryName": "A",+ "reduceTo": "sum",+ "stepInterval": 60+ },+ {+ "aggregateAttribute": {+ "dataType": "float64",+ "id": "redis_maxmemory--float64--Gauge--true",+ "isColumn": true,+ "isJSON": false,+ "key": "redis_maxmemory",+ "type": "Gauge"+ },+ "aggregateOperator": "max",+ "dataSource": "metrics",+ "disabled": false,+ "expression": "B",+ "filters": {+ "items": [+ {+ "id": "0c0754da",+ "key": {+ "dataType": "string",+ "id": "host_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "host_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.host_name}}"+ ]+ }+ ],+ "op": "AND"+ },+ "groupBy": [+ {+ "dataType": "string",+ "id": "host_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "host_name",+ "type": "tag"+ }+ ],+ "having": [],+ "legend": "Max::{{host_name}}",+ "limit": null,+ "orderBy": [],+ "queryName": "B",+ "reduceTo": "sum",+ "stepInterval": 60+ }+ ],+ "queryFormulas": []+ },+ "clickhouse_sql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "id": "2f47df76-f09e-4152-8623-971f0fe66bfe",+ "promql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "queryType": "builder"+ },+ "softMax": null,+ "softMin": null,+ "thresholds": [],+ "timePreferance": "GLOBAL_TIME",+ "title": "Memory usage",+ "yAxisUnit": "bytes"+ },+ {+ "description": "",+ "fillSpans": false,+ "id": "9698cee2-b1f3-4c0b-8c9f-3da4f0e05f17",+ "isStacked": false,+ "nullZeroValues": "zero",+ "opacity": "1",+ "panelTypes": "graph",+ "query": {+ "builder": {+ "queryData": [+ {+ "aggregateAttribute": {+ "dataType": "float64",+ "id": "redis_memory_rss--float64--Gauge--true",+ "isColumn": true,+ "isJSON": false,+ "key": "redis_memory_rss",+ "type": "Gauge"+ },+ "aggregateOperator": "sum",+ "dataSource": "metrics",+ "disabled": false,+ "expression": "A",+ "filters": {+ "items": [+ {+ "id": "4dc9ae49",+ "key": {+ "dataType": "string",+ "id": "host_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "host_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.host_name}}"+ ]+ }+ ],+ "op": "AND"+ },+ "groupBy": [+ {+ "dataType": "string",+ "id": "host_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "host_name",+ "type": "tag"+ }+ ],+ "having": [],+ "legend": "Rss::{{host_name}}",+ "limit": null,+ "orderBy": [],+ "queryName": "A",+ "reduceTo": "sum",+ "stepInterval": 60+ }+ ],+ "queryFormulas": []+ },+ "clickhouse_sql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "id": "fddd043c-1385-481c-9f4c-381f261e1dd9",+ "promql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "queryType": "builder"+ },+ "softMax": null,+ "softMin": null,+ "thresholds": [],+ "timePreferance": "GLOBAL_TIME",+ "title": "RSS Memory",+ "yAxisUnit": "bytes"+ },+ {+ "description": "",+ "fillSpans": false,+ "id": "64a5f303-d7db-44ff-9a0e-948e5c653320",+ "isStacked": false,+ "nullZeroValues": "zero",+ "opacity": "1",+ "panelTypes": "graph",+ "query": {+ "builder": {+ "queryData": [+ {+ "aggregateAttribute": {+ "dataType": "float64",+ "id": "redis_memory_fragmentation_ratio--float64--Gauge--true",+ "isColumn": true,+ "isJSON": false,+ "key": "redis_memory_fragmentation_ratio",+ "type": "Gauge"+ },+ "aggregateOperator": "avg",+ "dataSource": "metrics",+ "disabled": false,+ "expression": "A",+ "filters": {+ "items": [+ {+ "id": "79dc25f3",+ "key": {+ "dataType": "string",+ "id": "host_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "host_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.host_name}}"+ ]+ }+ ],+ "op": "AND"+ },+ "groupBy": [+ {+ "dataType": "string",+ "id": "host_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "host_name",+ "type": "tag"+ }+ ],+ "having": [],+ "legend": "Rss::{{host_name}}",+ "limit": null,+ "orderBy": [],+ "queryName": "A",+ "reduceTo": "sum",+ "stepInterval": 60+ }+ ],+ "queryFormulas": []+ },+ "clickhouse_sql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "id": "3e802b07-0249-4d79-a5c7-6580ab535ad0",+ "promql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "queryType": "builder"+ },+ "softMax": null,+ "softMin": null,+ "thresholds": [],+ "timePreferance": "GLOBAL_TIME",+ "title": "Fragmentation ratio",+ "yAxisUnit": "short"+ },+ {+ "description": "Number of evicted keys due to maxmemory limit",+ "fillSpans": false,+ "id": "3e80a918-69af-4c9a-bc57-a94e1d41b05c",+ "isStacked": false,+ "nullZeroValues": "zero",+ "opacity": "1",+ "panelTypes": "graph",+ "query": {+ "builder": {+ "queryData": [+ {+ "aggregateAttribute": {+ "dataType": "float64",+ "id": "redis_keys_evicted--float64--Sum--true",+ "isColumn": true,+ "isJSON": false,+ "key": "redis_keys_evicted",+ "type": "Sum"+ },+ "aggregateOperator": "sum_rate",+ "dataSource": "metrics",+ "disabled": false,+ "expression": "A",+ "filters": {+ "items": [+ {+ "id": "53d189ac",+ "key": {+ "dataType": "string",+ "id": "host_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "host_name",+ "type": "tag"+ },+ "op": "in",+ "value": [+ "{{.host_name}}"+ ]+ }+ ],+ "op": "AND"+ },+ "groupBy": [+ {+ "dataType": "string",+ "id": "host_name--string--tag--false",+ "isColumn": false,+ "isJSON": false,+ "key": "host_name",+ "type": "tag"+ }+ ],+ "having": [],+ "legend": "Rss::{{host_name}}",+ "limit": null,+ "orderBy": [],+ "queryName": "A",+ "reduceTo": "sum",+ "stepInterval": 60+ }+ ],+ "queryFormulas": []+ },+ "clickhouse_sql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "id": "15d1d9d7-eb10-464b-aa7b-33ff211996f7",+ "promql": [+ {+ "disabled": false,+ "legend": "",+ "name": "A",+ "query": ""+ }+ ],+ "queryType": "builder"+ },+ "softMax": null,+ "softMin": null,+ "thresholds": [],+ "timePreferance": "GLOBAL_TIME",+ "title": "Eviction rate",+ "yAxisUnit": "short"+ }+ ]+}\ No newline at end of filediff --git a/pkg/query-service/app/integrations/builtin_integrations/redis/assets/pipelines/log-parser.json b/pkg/query-service/app/integrations/builtin_integrations/redis/assets/pipelines/log-parser.jsonnew file mode 100644index 0000000000..d06760e0b8--- /dev/null+++ b/pkg/query-service/app/integrations/builtin_integrations/redis/assets/pipelines/log-parser.json@@ -0,0 +1,33 @@+{+ "id": "parse-default-redis-access-log",+ "name": "Parse default redis access log",+ "alias": "parse-default-redis-access-log",+ "description": "Parse standard redis access log",+ "enabled": true,+ "filter": {+ "op": "AND",+ "items": [+ {+ "key": {+ "type": "tag",+ "key": "source",+ "dataType": "string"+ },+ "op": "=",+ "value": "redis"+ }+ ]+ },+ "config": [+ {+ "type": "grok_parser",+ "id": "parse-body-grok",+ "enabled": true,+ "orderId": 1,+ "name": "Parse Body",+ "parse_to": "attributes",+ "pattern": "%{GREEDYDATA}",+ "parse_from": "body"+ }+ ]+}\ No newline at end of filediff --git a/pkg/query-service/app/integrations/builtin_integrations/redis/config/configure-otel-collector.md b/pkg/query-service/app/integrations/builtin_integrations/redis/config/configure-otel-collector.mdnew file mode 100644index 0000000000..21d586a771--- /dev/null+++ b/pkg/query-service/app/integrations/builtin_integrations/redis/config/configure-otel-collector.md@@ -0,0 +1,63 @@+### Configure otel collector++#### Save collector config file++Save the following collector config in a file named `redis-collector-config.yaml`++```+receivers:+ redis:+ # The hostname and port of the Redis instance, separated by a colon.+ endpoint: "localhost:6379"+ # The frequency at which to collect metrics from the Redis instance.+ collection_interval: 60s+ # # The password used to access the Redis instance; must match the password specified in the requirepass server configuration option.+ # password: ${env:REDIS_PASSWORD}+ # # Defines the network to use for connecting to the server. Valid Values are `tcp` or `Unix`+ # transport: tcp+ # tls:+ # insecure: false+ # ca_file: /etc/ssl/certs/ca-certificates.crt+ # cert_file: /etc/ssl/certs/redis.crt+ # key_file: /etc/ssl/certs/redis.key+ metrics:+ redis.maxmemory:+ enabled: true+ redis.cmd.latency:+ enabled: true++processors:+ # enriches the data with additional host information+ # see https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/resourcedetectionprocessor#resource-detection-processor+ resourcedetection/system:+ # add additional detectors if needed+ detectors: ["system"]+ system:+ hostname_sources: ["os"]++exporters:+ # export to local collector+ otlp/local:+ endpoint: "localhost:4317"+ tls:+ insecure: true+ # export to SigNoz cloud+ otlp/signoz:+ endpoint: "ingest.{region}.signoz.cloud:443"+ tls:+ insecure: false+ headers:+ "signoz-access-token": "<SIGNOZ_INGESTION_KEY>"++service:+ pipelines:+ metrics/redis:+ receivers: [redis]+ # note: remove this processor if the collector host is not running on the same host as the redis instance+ processors: [resourcedetection/system]+ exporters: [otlp/local]+```++#### Use collector config file++Run your collector with the added flag `--config redis-collector-config.yaml`diff --git a/pkg/query-service/app/integrations/builtin_integrations/redis/config/prerequisites.md b/pkg/query-service/app/integrations/builtin_integrations/redis/config/prerequisites.mdnew file mode 100644index 0000000000..4e98933b69--- /dev/null+++ b/pkg/query-service/app/integrations/builtin_integrations/redis/config/prerequisites.md@@ -0,0 +1,5 @@+### Prepare redis for monitoring++- Have a running redis instance+- Have the monitoring user created+- Have the monitoring user granted the necessary permissionsdiff --git a/pkg/query-service/app/integrations/builtin_integrations/redis/icon.svg b/pkg/query-service/app/integrations/builtin_integrations/redis/icon.svgnew file mode 100644index 0000000000..63e5dfd2e4--- /dev/null+++ b/pkg/query-service/app/integrations/builtin_integrations/redis/icon.svg@@ -0,0 +1,11 @@+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">+<path d="M23.0597 17.5259C21.7789 18.1935 15.144 20.9215 13.7315 21.6579C12.3189 22.3944 11.5343 22.3873 10.4183 21.8539C9.30253 21.3204 2.24184 18.4684 0.969937 17.8604C0.334312 17.5567 0 17.3002 0 17.0579V14.632C0 14.632 9.19219 12.6309 10.6762 12.0985C12.16 11.5661 12.6749 11.5469 13.9377 12.0095C15.2007 12.4722 22.7519 13.8346 24 14.2917L23.9994 16.6833C23.9996 16.9231 23.7116 17.1862 23.0597 17.5259Z" fill="#912626"/>+<path d="M23.0592 15.1144C21.7785 15.7817 15.1438 18.5098 13.7313 19.2461C12.3188 19.9827 11.5342 19.9755 10.4183 19.4421C9.30244 18.909 2.24203 16.0565 0.970219 15.4489C-0.301594 14.8409 -0.328219 14.4225 0.921094 13.9333C2.17041 13.4439 9.19209 10.6891 10.6763 10.1567C12.1601 9.62447 12.6749 9.60506 13.9377 10.0678C15.2006 10.5304 21.7958 13.1555 23.0437 13.6125C24.292 14.0701 24.3399 14.4469 23.0592 15.1144Z" fill="#C6302B"/>+<path d="M23.0597 13.6007C21.7789 14.2684 15.144 16.9963 13.7315 17.733C12.3189 18.4692 11.5343 18.4621 10.4183 17.9287C9.30244 17.3955 2.24184 14.5432 0.969937 13.9352C0.334312 13.6314 0 13.3753 0 13.133V10.7068C0 10.7068 9.19219 8.70581 10.6762 8.1734C12.16 7.641 12.6749 7.62168 13.9377 8.08434C15.2008 8.547 22.752 9.90909 24 10.3663L23.9994 12.7582C23.9996 12.9979 23.7116 13.2609 23.0597 13.6007Z" fill="#912626"/>+<path d="M23.0592 11.1892C21.7785 11.8567 15.1438 14.5846 13.7313 15.3212C12.3188 16.0575 11.5342 16.0503 10.4183 15.5168C9.30244 14.9838 2.24203 12.1313 0.970219 11.5237C-0.301594 10.9159 -0.328219 10.4974 0.921094 10.008C2.17041 9.51891 9.19219 6.76387 10.6763 6.23156C12.1601 5.69925 12.6749 5.67994 13.9377 6.14259C15.2006 6.60516 21.7958 9.23006 23.0437 9.68728C24.292 10.1448 24.3399 10.5217 23.0592 11.1892Z" fill="#C6302B"/>+<path d="M23.0597 9.52997C21.7789 10.1975 15.144 12.9256 13.7315 13.6623C12.3189 14.3986 11.5343 14.3914 10.4183 13.8579C9.30244 13.3248 2.24184 10.4723 0.969937 9.86465C0.334312 9.56062 0 9.3044 0 9.06234V6.63609C0 6.63609 9.19219 4.63519 10.6762 4.10287C12.16 3.57037 12.6749 3.55125 13.9377 4.01381C15.2008 4.47647 22.752 5.83856 24 6.29578L23.9994 8.68753C23.9996 8.92706 23.7116 9.19012 23.0597 9.52997Z" fill="#912626"/>+<path d="M23.0592 7.11843C21.7785 7.78593 15.1438 10.5141 13.7313 11.2504C12.3188 11.9867 11.5342 11.9795 10.4183 11.4463C9.30253 10.9129 2.24203 8.06062 0.970312 7.45284C-0.301594 6.84515 -0.328125 6.42656 0.921094 5.93728C2.17041 5.44809 9.19219 2.69343 10.6763 2.16093C12.1601 1.62853 12.6749 1.6094 13.9377 2.07206C15.2006 2.53472 21.7958 5.15962 23.0437 5.61684C24.292 6.07396 24.3399 6.45093 23.0592 7.11843Z" fill="#C6302B"/>+<path d="M14.9328 4.75847L12.8693 4.97269L12.4074 6.08419L11.6614 4.84388L9.27872 4.62975L11.0566 3.9886L10.5232 3.00441L12.1877 3.65541L13.7569 3.14166L13.3328 4.15932L14.9328 4.75847ZM12.2843 10.1508L8.43328 8.55357L13.9514 7.70653L12.2843 10.1508ZM6.94519 5.37628C8.57409 5.37628 9.89456 5.88816 9.89456 6.51947C9.89456 7.15097 8.57409 7.66275 6.94519 7.66275C5.31628 7.66275 3.99581 7.15088 3.99581 6.51947C3.99581 5.88816 5.31628 5.37628 6.94519 5.37628Z" fill="white"/>+<path d="M17.3714 5.06231L20.6373 6.35287L17.3742 7.64222L17.3714 5.06231Z" fill="#621B1C"/>+<path d="M13.7583 6.49153L17.3714 5.06231L17.3742 7.64222L17.0199 7.78078L13.7583 6.49153Z" fill="#9A2928"/>+</svg>diff --git a/pkg/query-service/app/integrations/builtin_integrations/redis/integration.json b/pkg/query-service/app/integrations/builtin_integrations/redis/integration.jsonnew file mode 100644index 0000000000..862a98b306--- /dev/null+++ b/pkg/query-service/app/integrations/builtin_integrations/redis/integration.json@@ -0,0 +1,88 @@+{+ "id": "redis",+ "title": "Redis",+ "description": "Monitor redis using logs and metrics.",+ "author": {+ "name": "SigNoz",+ "email": "[email protected]",+ "homepage": "https://signoz.io"+ },+ "icon": "file://icon.svg",+ "categories": [+ "Database"+ ],+ "overview": "file://overview.md",+ "configuration": [+ {+ "title": "Prerequisites",+ "instructions": "file://config/prerequisites.md"+ },+ {+ "title": "Configure Otel Collector",+ "instructions": "file://config/configure-otel-collector.md"+ }+ ],+ "assets": {+ "logs": {+ "pipelines": [+ "file://assets/pipelines/log-parser.json"+ ]+ },+ "dashboards": [+ "file://assets/dashboards/overview.json"+ ],+ "alerts": []+ },+ "connection_tests": {+ "logs": {+ "op": "AND",+ "items": [+ {+ "key": {+ "type": "tag",+ "key": "source",+ "dataType": "string"+ },+ "op": "=",+ "value": "redis"+ }+ ]+ }+ },+ "data_collected": {+ "logs": [+ {+ "name": "Request Method",+ "path": "attributes[\"http.request.method\"]",+ "type": "string",+ "description": "HTTP method"+ },+ {+ "name": "Request Path",+ "path": "attributes[\"url.path\"]",+ "type": "string",+ "description": "path requested"+ },+ {+ "name": "Response Status Code",+ "path": "attributes[\"http.response.status_code\"]",+ "type": "int",+ "description": "HTTP response code"+ }+ ],+ "metrics": [+ {+ "name": "http.server.request.duration",+ "type": "Histogram",+ "unit": "s",+ "description": "Duration of HTTP server requests"+ },+ {+ "name": "http.server.active_requests",+ "type": "UpDownCounter",+ "unit": "{ request }",+ "description": "Number of active HTTP server requests"+ }+ ]+ }+}diff --git a/pkg/query-service/app/integrations/builtin_integrations/redis/overview.md b/pkg/query-service/app/integrations/builtin_integrations/redis/overview.mdnew file mode 100644index 0000000000..60ce2337b6--- /dev/null+++ b/pkg/query-service/app/integrations/builtin_integrations/redis/overview.md@@ -0,0 +1,3 @@+### Monitor Redis with SigNoz++Parse your Redis logs and collect key metrics.diff --git a/pkg/query-service/app/integrations/builtin_test.go b/pkg/query-service/app/integrations/builtin_test.gonew file mode 100644index 0000000000..66d7cea0fa--- /dev/null+++ b/pkg/query-service/app/integrations/builtin_test.go@@ -0,0 +1,32 @@+package integrations++import (+ "context"+ "strings"+ "testing"++ "github.com/stretchr/testify/require"+)++func TestBuiltinIntegrations(t *testing.T) {+ require := require.New(t)++ repo := BuiltInIntegrations{}++ builtins, apiErr := repo.list(context.Background())+ require.Nil(apiErr)+ require.Greater(+ len(builtins), 0,+ "some built in integrations are expected to be bundled.",+ )++ nginxIntegrationId := "builtin::nginx"+ res, apiErr := repo.get(context.Background(), []string{+ nginxIntegrationId,+ })+ require.Nil(apiErr)++ nginxIntegration, exists := res[nginxIntegrationId]+ require.True(exists)+ require.False(strings.HasPrefix(nginxIntegration.Overview, "file://"))+}diff --git a/pkg/query-service/app/integrations/controller.go b/pkg/query-service/app/integrations/controller.goindex 72badb0c86..e047333bc5 100644--- a/pkg/query-service/app/integrations/controller.go+++ b/pkg/query-service/app/integrations/controller.go@@ -86,6 +86,12 @@ type UninstallIntegrationRequest struct {func (c *Controller) Uninstall(ctx context.Context, req *UninstallIntegrationRequest,) *model.ApiError {+ if len(req.IntegrationId) < 1 {+ return model.BadRequest(fmt.Errorf(+ "integration_id is required.",+ ))+ }+return c.mgr.UninstallIntegration(ctx, req.IntegrationId,)diff --git a/pkg/query-service/app/integrations/manager.go b/pkg/query-service/app/integrations/manager.goindex fa1c4b3ce6..1685afff65 100644--- a/pkg/query-service/app/integrations/manager.go+++ b/pkg/query-service/app/integrations/manager.go@@ -122,8 +122,7 @@ func NewManager(db *sqlx.DB) (*Manager, error) {}return &Manager{- // TODO(Raj): Hook up a real available integrations provider.- availableIntegrationsRepo: &TestAvailableIntegrationsRepo{},+ availableIntegrationsRepo: &BuiltInIntegrations{},installedIntegrationsRepo: iiRepo,}, nil}