From df0358f245c9ac593e9f68f902e416c2a8dae3aa Mon Sep 17 00:00:00 2001 From: Alejandro Acevedo Date: Tue, 18 Aug 2026 16:13:04 +0200 Subject: [PATCH] STAC-25600: Drop database support on opentelemetry stackpacks2 --- .../settings/component-mappings/databases.sty | 110 -------- .../database-span-duration/monitor.sty | 21 -- .../settings/presentations/databases.sty | 257 ------------------ .../settings/relation-mappings/database.sty | 82 ------ stackpacks/open-telemetry/stackpack.yaml | 2 +- 5 files changed, 1 insertion(+), 471 deletions(-) delete mode 100644 stackpacks/open-telemetry/settings/component-mappings/databases.sty delete mode 100644 stackpacks/open-telemetry/settings/monitors/database-span-duration/monitor.sty delete mode 100644 stackpacks/open-telemetry/settings/presentations/databases.sty delete mode 100644 stackpacks/open-telemetry/settings/relation-mappings/database.sty diff --git a/stackpacks/open-telemetry/settings/component-mappings/databases.sty b/stackpacks/open-telemetry/settings/component-mappings/databases.sty deleted file mode 100644 index 2db05dd..0000000 --- a/stackpacks/open-telemetry/settings/component-mappings/databases.sty +++ /dev/null @@ -1,110 +0,0 @@ -nodes: - - _type: "OtelComponentMapping" - name: "Database" - description: "Represents a database service" - identifier: "urn:stackpack:open-telemetry:otel-component-mapping:database" - input: - signal: - - "METRICS" - resource: - scope: - condition: "scope.name == 'traces_service_graph'" - metric: - condition: "metric.name == 'traces_service_graph_request_total'" - datapoint: - action: "'CREATE'" - condition: >- - 'client' in datapoint.attributes && - 'server' in datapoint.attributes && - 'client_service.namespace' in datapoint.attributes && - 'connection_type' in datapoint.attributes && - datapoint.attributes['connection_type'] == 'database' - vars: - - name: "clientServiceNamespace" - value: "datapoint.attributes['client_service.namespace']" - - name: "client" - value: "datapoint.attributes['client']" - - name: "server" - value: "datapoint.attributes['server']" - output: - identifier: >- - 'urn:opentelemetry:namespace/' + vars.clientServiceNamespace + ':service/' + vars.client + ':database/' + vars.server - name: "vars.server" - typeName: "'database'" - required: - tags: - - source: "'open-telemetry'" - target: "stackpack" - - source: "vars.clientServiceNamespace" - target: "service.namespace" - - source: "vars.client" - target: "service.name" - expireAfter: 900000 - rank: - specificity: 200 - - _type: "OtelComponentMapping" - name: "Database (span enrichment DB system)" - description: "Enriches database components with db.system.name and connection details from spans" - identifier: "urn:stackpack:open-telemetry:otel-component-mapping:database-span-enrichment-db-system" - input: - signal: - - "TRACES" - resource: - condition: "'service.namespace' in resource.attributes && 'service.name' in resource.attributes" - scope: - span: - action: "'CREATE'" - condition: >- - 'db.system.name' in span.attributes || 'db.system' in span.attributes - vars: - - name: "clientServiceNamespace" - value: "resource.attributes['service.namespace']" - - name: "client" - value: "resource.attributes['service.name']" - - name: "clusterName" - value: "resource.attributes['k8s.cluster.name']" - - name: "server" - value: >- - 'peer.service' in span.attributes ? span.attributes['peer.service'] : - 'db.namespace' in span.attributes ? span.attributes['db.namespace'] : - 'db.name' in span.attributes ? span.attributes['db.name'] : - 'db.system.name' in span.attributes ? span.attributes['db.system.name'] : - span.attributes['db.system'] - # Logical database name for display. Prefers the specific database name (db.namespace is the current - # attribute, db.name the deprecated legacy one), then the user-assigned peer service label, falling - # back to the generic DBMS product type only so the component is never nameless. Kept separate from - # `server` (identity), which leads with peer.service. - - name: "databaseName" - value: >- - 'db.namespace' in span.attributes ? span.attributes['db.namespace'] : - 'db.name' in span.attributes ? span.attributes['db.name'] : - 'peer.service' in span.attributes ? span.attributes['peer.service'] : - 'db.system.name' in span.attributes ? span.attributes['db.system.name'] : - span.attributes['db.system'] - output: - identifier: >- - 'urn:opentelemetry:namespace/' + vars.clientServiceNamespace + ':service/' + vars.client + ':database/span/' + vars.server - name: "vars.databaseName" - typeName: "'database'" - required: - additionalIdentifiers: - - >- - 'urn:opentelemetry:namespace/' + vars.clientServiceNamespace + ':service/' + vars.client + ':database/' + vars.server - tags: - - source: "'open-telemetry'" - target: "stackpack" - - source: "vars.clusterName" - target: "cluster-name" - - source: "resource.attributes" - pattern: "(.*)" - target: "${1}" - - source: "span.attributes" - pattern: "db.(.*)" - target: "db.${1}" - optional: - tags: - - source: "resource.attributes['k8s.namespace.name']" - target: "namespace" - expireAfter: 900000 - rank: - specificity: 190 diff --git a/stackpacks/open-telemetry/settings/monitors/database-span-duration/monitor.sty b/stackpacks/open-telemetry/settings/monitors/database-span-duration/monitor.sty deleted file mode 100644 index 3cc4f35..0000000 --- a/stackpacks/open-telemetry/settings/monitors/database-span-duration/monitor.sty +++ /dev/null @@ -1,21 +0,0 @@ -nodes: - - _type: Monitor - arguments: - comparator: GT - failureState: DEVIATING - metric: - query: 'histogram_quantile(0.95, sum by(client_service_namespace, client, server, le)(rate(traces_service_graph_request_client_seconds_bucket{connection_type="database"}[5m])))' - aliasTemplate: Span duration 95th percentile - unit: s - threshold: 5 - titleTemplate: Span duration - urnTemplate: "urn:opentelemetry:namespace/${client_service_namespace}:service/${client}:database/${server}" - description: | - Monitors the duration of database spans. When the 95th percentile of the duration is greater than the threshold (default 5s) the monitor has a Deviating state. - function: urn:stackpack:common:monitor-function:threshold - identifier: urn:stackpack:open-telemetry:monitor:database-span-duration - intervalSeconds: 30 - name: Span duration for Open Telemetry database - status: ENABLED - tags: ["database", "traces"] - remediationHint: !include remediation-hints/database-span-duration.md.hbs \ No newline at end of file diff --git a/stackpacks/open-telemetry/settings/presentations/databases.sty b/stackpacks/open-telemetry/settings/presentations/databases.sty deleted file mode 100644 index 006c355..0000000 --- a/stackpacks/open-telemetry/settings/presentations/databases.sty +++ /dev/null @@ -1,257 +0,0 @@ -nodes: - - _type: ComponentPresentation - name: "Otel Databases presentation" - description: "ComponentPresentation for Otel Services" - identifier: urn:stackpack:open-telemetry:component-presentation:database - binding: - _type: ComponentPresentationQueryBinding - query: (label IN ("stackpack:open-telemetry") AND type IN ("database")) - rank: - specificity: 10 - presentation: - icon: !icon databases.svg - filters: - - filterId: "otel_namespace" - - filterId: "k8s_cluster" - - filterId: "k8s_namespace" - topology: - groupingEnabled: true - showIndirectRelations: false - minimumGroupSize: 8 - groupedByLayers: false - groupedByDomains: true - autoGrouping: true - connectedComponents: true - overview: - name: - singular: "database" - plural: "databases" - title: "Databases" - mainMenu: - group: "Open Telemetry" - order: 98 - columns: - - columnId: health - - columnId: "otel_name" - title: "Database" - - columnId: otel_namespace - title: "OTel Namespace" - - columnId: otel_k8s_cluster - title: "Kubernetes Cluster" - projection: - _type: ComponentLinkProjection - name: "tags.singleValue('cluster-name')" - identifier: "'urn:cluster:/kubernetes:' + tags.singleValue('cluster-name')" - - columnId: otel_k8s_namespace - title: "Kubernetes Namespace" - projection: - _type: ComponentLinkProjection - name: "tags.singleValue('namespace')" - identifier: "'urn:kubernetes:/' + tags.singleValue('cluster-name') + ':namespace/' + tags.singleValue('namespace')" - - columnId: otel_database_span_error_rate - title: Span error % - projection: - _type: MetricProjection - sparkline: true - decimalPlaces: 2 - unit: percentunit - query: |- - sum by(client_service_namespace, client, server) (rate(traces_service_graph_request_failed_total{ - client_service_namespace="${tags.singleValue('service.namespace')}", client="${tags.singleValue('service.name')}", server="${name}" - }[5m]) or 0) / sum by (client_service_namespace, client, server)(rate(traces_service_graph_request_total{ - client_service_namespace="${tags.singleValue('service.namespace')}", client="${tags.singleValue('service.name')}", server="${name}" - }[5m])) - metricId: database-spans-error-rate - - columnId: otel_database_span_duration - title: Span duration - projection: - _type: MetricProjection - sparkline: true - decimalPlaces: 2 - unit: s - query: |- - histogram_quantile(0.95, sum(rate(traces_service_graph_request_client_seconds_bucket{ - client_service_namespace="${tags.singleValue('service.namespace')}", client="${tags.singleValue('service.name')}", server="${name}" - }[${__rate_interval}])) by (client_service_namespace, client, server, le)) - metricId: database-spans-duration - - columnId: otel_database_span_rate - title: Span rate - projection: - _type: MetricProjection - sparkline: true - decimalPlaces: 2 - unit: cps - query: |- - sum by (client_service_namespace, client, server)(rate(traces_service_graph_request_total{ - client_service_namespace="${tags.singleValue('service.namespace')}", client="${tags.singleValue('service.name')}", server="${name}" - }[5m])) - metricId: database-spans-rate - sort: - - columnId: health - - columnId: otel_name - highlight: - title: "Otel database" - fields: - - fieldId: otel_db_system - title: "Database type" - order: 85.0 - projection: - _type: TextProjection - value: "'db.system.name' in tags ? tags.singleValue('db.system.name') : tags.singleValue('db.system')" - - fieldId: otel_db_server_address - title: "Server address" - order: 84.0 - projection: - _type: TextProjection - value: "'net.peer.name' in tags ? tags.singleValue('net.peer.name') : tags.singleValue('server.address')" - - fieldId: otel_db_server_port - title: "Server port" - order: 83.0 - projection: - _type: TextProjection - value: "'net.peer.port' in tags ? tags.singleValue('net.peer.port') : tags.singleValue('server.port')" - - fieldId: "k8s_cluster" - title: "K8s Cluster" - order: 77.5 - projection: - _type: ComponentLinkProjection - name: "tags.singleValue('cluster-name')" - identifier: "'urn:cluster:/kubernetes:' + tags.singleValue('cluster-name')" - - fieldId: "k8s_namespace" - title: "K8s Namespace" - order: 75.0 - projection: - _type: ComponentLinkProjection - name: "tags.singleValue('namespace')" - identifier: "'urn:kubernetes:/' + tags.singleValue('cluster-name') + ':namespace/' + tags.singleValue('namespace')" - provisioning: - topologySourceSelector: "source.mapping.identifier == 'urn:stackpack:open-telemetry:otel-component-mapping:database'" - showConfiguration: false - showStatus: false - relatedResources: - - resourceId: "otel_database_service_instances" - title: "Related service instances" - order: 2.0 - topologyQuery: '(withNeighborsOf(direction = "both", components = (identifier = "${identifiers[0]}"), levels = "1")) and type = "otel service instance"' - presentationIdentifier: "urn:stackpack:open-telemetry:component-presentation:service-instance" - - resourceId: "otel_database_services" - title: "Related services" - order: 1.0 - topologyQuery: '(withNeighborsOf(direction = "up", components = (withNeighborsOf(direction = "both", components = (identifier = "${identifiers[0]}"), levels = "1") and type = "otel service instance") , levels = "1") and type = "otel service")' - presentationIdentifier: "urn:stackpack:open-telemetry:component-presentation:service" - - resourceId: "otel_database_pods" - title: "Related pods" - order: 3.0 - topologyQuery: >- - label = "source-name:${tags.singleValue('k8s.pod.name')}" - presentationIdentifier: "urn:stackpack:open-telemetry:view-type:pod-link" - - resourceId: "otel_database_hosts" - title: "Related hosts" - order: 4.0 - topologyQuery: >- - label = "source-type:host" AND label = "source-name:${tags.singleValue('k8s.node.name')}" - presentationIdentifier: "urn:stackpack:open-telemetry:view-type:host-link" - metrics: - - sectionId: traces - title: "Traces" - description: "Rate, Errors and Duration metrics for the trace spans" - order: 100 - metrics: - - metricId: database-spans-rate - order: 100 - - metricId: database-spans-error-rate - order: 90 - - metricId: database-spans-duration - order: 80 - summary: - metrics: - - - summaryMetricId: database-spans-rate - name: Span rate - order: 100 - decimalPlaces: 2 - unit: cps - query: |- - sum by (client_service_namespace, client, server)(rate(traces_service_graph_request_total{ - client_service_namespace="${tags.singleValue('service.namespace')}", client="${tags.singleValue('service.name')}", server="${name}" - }[5m])) - metricId: database-spans-rate - - - summaryMetricId: database-spans-error-rate - name: Span error % - order: 90 - decimalPlaces: 2 - unit: percentunit - query: |- - sum by(client_service_namespace, client, server) (rate(traces_service_graph_request_failed_total{ - client_service_namespace="${tags.singleValue('service.namespace')}", client="${tags.singleValue('service.name')}", server="${name}" - }[5m]) or 0) / sum by (client_service_namespace, client, server)(rate(traces_service_graph_request_total{ - client_service_namespace="${tags.singleValue('service.namespace')}", client="${tags.singleValue('service.name')}", server="${name}" - }[5m])) - metricId: database-spans-error-rate - - - summaryMetricId: database-spans-duration - name: Span duration - order: 80 - decimalPlaces: 2 - unit: s - query: |- - histogram_quantile(0.95, sum(rate(traces_service_graph_request_client_seconds_bucket{ - client_service_namespace="${tags.singleValue('service.namespace')}", client="${tags.singleValue('service.name')}", server="${name}" - }[${__rate_interval}])) by (client_service_namespace, client, server, le)) - metricId: database-spans-duration - tracesPerspective: - showTraces: true - spanFilter: - attributes: - service.namespace: ["${tags.singleValue('service.namespace')}"] - service.name: ["${tags.singleValue('service.name')}"] - db.system: ["${tags.singleValue('db.system')}"] - metricPerspective: - tabs: - - - tabId: traces-performance - title: Traces Performance - order: 10 - sections: - - - sectionId: spans - title: Spans - order: 10 - metrics: - - metricId: database-spans-error-rate - - metricId: database-spans-duration - - metricId: database-spans-rate - metrics: - - - metricId: database-spans-error-rate - description: The percentage of errors per second - name: Span error % - metricQueries: - - expression: |- - sum(rate(traces_service_graph_request_failed_total{client_service_namespace="${tags.singleValue('service.namespace')}", client="${tags.singleValue('service.name')}", server="${name}"}[5m]) or 0) - / sum(rate(traces_service_graph_request_total{client_service_namespace="${tags.singleValue('service.namespace')}", client="${tags.singleValue('service.name')}", server="${name}"}[5m])) - alias: Error rate - chart: - _type: TimeSeriesChart - unit: percentunit - - - metricId: database-spans-duration - description: - name: Span duration - metricQueries: - - expression: histogram_quantile(0.95, sum(rate(traces_service_graph_request_client_seconds_bucket{client_service_namespace="${tags.singleValue('service.namespace')}", client="${tags.singleValue('service.name')}", server="${name}"}[${__rate_interval}])) by (le)) - alias: '95th percentile' - chart: - _type: TimeSeriesChart - unit: s - - - metricId: database-spans-rate - description: The number of spans for the database per second - name: Span rate - metricQueries: - - expression: sum(rate(traces_service_graph_request_total{client_service_namespace="${tags.singleValue('service.namespace')}", client="${tags.singleValue('service.name')}", server="${name}"}[${__rate_interval}])) - alias: Query rate - chart: - _type: TimeSeriesChart - unit: cps diff --git a/stackpacks/open-telemetry/settings/relation-mappings/database.sty b/stackpacks/open-telemetry/settings/relation-mappings/database.sty deleted file mode 100644 index d52f8c8..0000000 --- a/stackpacks/open-telemetry/settings/relation-mappings/database.sty +++ /dev/null @@ -1,82 +0,0 @@ -nodes: - - _type: "OtelRelationMapping" - name: "Database Relation" - description: "Adds a database connection to a service" - identifier: "urn:stackpack:open-telemetry:otel-relation-mapping:database" - input: - signal: - - "METRICS" - resource: - scope: - condition: "scope.name == 'traces_service_graph'" - metric: - condition: "metric.name == 'traces_service_graph_request_total'" - datapoint: - action: "'CREATE'" - condition: >- - 'client' in datapoint.attributes && - 'server' in datapoint.attributes && - 'client_service.namespace' in datapoint.attributes && - 'connection_type' in datapoint.attributes && - datapoint.attributes['connection_type'] == 'database' - vars: - - name: "clientServiceNamespace" - value: "datapoint.attributes['client_service.namespace']" - - name: "client" - value: "datapoint.attributes['client']" - - name: "clientServiceInstanceId" - value: >- - 'client_service.instance.id' in datapoint.attributes ? - datapoint.attributes['client_service.instance.id'] : - datapoint.attributes['client'] - - name: "targetId" - value: >- - 'client_peer.service' in datapoint.attributes ? - "urn:opentelemetry:namespace/" + datapoint.attributes['client_service.namespace'] + ":service/" + datapoint.attributes['client_peer.service'] : - "urn:opentelemetry:namespace/" + datapoint.attributes['client_service.namespace'] + ":service/" + datapoint.attributes['client'] + ":database/" + datapoint.attributes['server'] - output: - sourceId: >- - 'urn:opentelemetry:namespace/' + vars.clientServiceNamespace + ':service/' + vars.client + ':serviceInstance/' + vars.clientServiceInstanceId - targetId: "vars.targetId" - typeName: "'database'" - dependencyType: "'CONNECTION'" - expireAfter: 900000 - - _type: "OtelRelationMapping" - name: "Database Relation (span enrichment)" - description: "Adds the service instance -> database connection from database spans, complementing the service-graph metrics relation" - identifier: "urn:stackpack:open-telemetry:otel-relation-mapping:database-span-enrichment" - input: - signal: - - "TRACES" - resource: - condition: >- - 'service.namespace' in resource.attributes && - 'service.name' in resource.attributes && - 'service.instance.id' in resource.attributes - scope: - span: - action: "'CREATE'" - condition: >- - 'db.system.name' in span.attributes || 'db.system' in span.attributes - vars: - - name: "clientServiceNamespace" - value: "resource.attributes['service.namespace']" - - name: "client" - value: "resource.attributes['service.name']" - - name: "clientServiceInstanceId" - value: "resource.attributes['service.instance.id']" - - name: "server" - value: >- - 'peer.service' in span.attributes ? span.attributes['peer.service'] : - 'db.namespace' in span.attributes ? span.attributes['db.namespace'] : - 'db.name' in span.attributes ? span.attributes['db.name'] : - 'db.system.name' in span.attributes ? span.attributes['db.system.name'] : - span.attributes['db.system'] - output: - sourceId: >- - 'urn:opentelemetry:namespace/' + vars.clientServiceNamespace + ':service/' + vars.client + ':serviceInstance/' + vars.clientServiceInstanceId - targetId: >- - 'urn:opentelemetry:namespace/' + vars.clientServiceNamespace + ':service/' + vars.client + ':database/' + vars.server - typeName: "'database'" - dependencyType: "'CONNECTION'" - expireAfter: 900000 diff --git a/stackpacks/open-telemetry/stackpack.yaml b/stackpacks/open-telemetry/stackpack.yaml index 1a0e778..5be5b50 100644 --- a/stackpacks/open-telemetry/stackpack.yaml +++ b/stackpacks/open-telemetry/stackpack.yaml @@ -1,5 +1,5 @@ name: "open-telemetry" -version: "0.1.3" +version: "0.1.4" schemaVersion: "2.0" displayName: "Open Telemetry" categories: [ "Open Telemetry" ]