Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,69 @@ nodes:
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'] :
Comment thread
rb3ckers marked this conversation as resolved.
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"
Comment thread
rb3ckers marked this conversation as resolved.
- 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
71 changes: 68 additions & 3 deletions stackpacks/open-telemetry/settings/presentations/databases.sty
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ nodes:
icon: !icon databases.svg
filters:
- filterId: "otel_namespace"
- filterId: "otel_service"
- filterId: "k8s_cluster"
- filterId: "k8s_namespace"
topology:
groupingEnabled: true
showIndirectRelations: false
Expand All @@ -34,6 +35,19 @@ nodes:
- 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:
Expand Down Expand Up @@ -77,7 +91,39 @@ nodes:
- columnId: otel_name
highlight:
title: "Otel database"
fields: []
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:
externalComponentSelector: "external.mapping.identifier == 'urn:stackpack:open-telemetry:otel-component-mapping:database'"
showConfiguration: false
Expand All @@ -88,11 +134,23 @@ nodes:
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_datbase_services"
- resourceId: "otel_database_services"
title: "Related services"
order: 1.0
Comment thread
rb3ckers marked this conversation as resolved.
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"
Expand Down Expand Up @@ -142,6 +200,13 @@ nodes:
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:
-
Expand Down
19 changes: 19 additions & 0 deletions stackpacks/open-telemetry/settings/presentations/k8s-hosts.sty
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
nodes:
- _type: ComponentPresentation
name: "Otel Host Extension"
description: "Extends the Host presentation for OTel hosts with related service instances"
identifier: urn:stackpack:open-telemetry:component-presentation:host
binding:
_type: ComponentPresentationQueryBinding
query: (label = "source-type:host")
rank:
specificity: 10
presentation:
highlight:
relatedResources:
- resourceId: "otel_host_service_instances"
title: "Related service instances"
order: 1.0
topologyQuery: >-
type = "otel service instance" AND label = "k8s.node.name:${name}"
presentationIdentifier: "urn:stackpack:open-telemetry:component-presentation:service-instance"
19 changes: 19 additions & 0 deletions stackpacks/open-telemetry/settings/presentations/k8s-pods.sty
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
nodes:
- _type: ComponentPresentation
name: "Otel Pod Extension"
description: "Extends the Pod presentation for OTel pods with related service instances"
identifier: urn:stackpack:open-telemetry:component-presentation:pod
binding:
_type: ComponentPresentationQueryBinding
query: (label = "stackpack:open-telemetry" and type = "pod")
rank:
specificity: 10
presentation:
highlight:
relatedResources:
- resourceId: "otel_pod_service_instances"
title: "Related service instances"
order: 1.0
topologyQuery: >-
type = "otel service instance" AND label = "k8s.pod.name:${name}"
presentationIdentifier: "urn:stackpack:open-telemetry:component-presentation:service-instance"
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,25 @@ nodes:
- columnId: otel_name
title: Service Instance
- columnId: otel_namespace
title: OTel Namespace
- columnId: otel_service
title: "Service"
projection:
_type: "ComponentLinkProjection"
name: "tags.singleValue('service.name')"
identifier: "'urn:opentelemetry:namespace/' + tags.singleValue('service.namespace') + ':service/' + tags.singleValue('service.name')"
- 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_service_instance_span_error_percent_summary
title: Span error %
projection:
Expand Down Expand Up @@ -91,10 +104,10 @@ nodes:
- columnId: health
- columnId: otel_name
highlight:
title: "Otel service"
title: "OTel service"
fields:
- fieldId: "namespace"
title: "Namespace"
title: "OTel Namespace"
order: 85.0
projection:
_type: ComponentLinkProjection
Expand All @@ -107,6 +120,26 @@ nodes:
_type: ComponentLinkProjection
name: "tags.singleValue('service.name')"
identifier: "'urn:opentelemetry:namespace/' + tags.singleValue('service.namespace') + ':service/' + tags.singleValue('service.name')"
- fieldId: "language"
title: "Language"
order: 81.0
projection:
_type: TextProjection
value: "tags.singleValue('telemetry.sdk.language')"
- 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:
externalComponentSelector: "external.mapping.identifier == 'urn:stackpack:open-telemetry:otel-component-mapping:service-instance'"
showConfiguration: false
Expand All @@ -122,6 +155,18 @@ nodes:
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_service_instance_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_service_instance_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"
events:
showEvents: true
relatedResourcesQuery: |
Expand Down Expand Up @@ -179,6 +224,13 @@ nodes:
}[${__rate_interval}])) by (le)) / 1000)
metricId: service-instance-spans-duration

tracesPerspective:
showTraces: true
spanFilter:
attributes:
service.namespace: ["${tags.singleValue('service.namespace')}"]
service.name: ["${tags.singleValue('service.name')}"]
service.instance.id: ["${tags.singleValue('service.instance.id')}"]
metricPerspective:
tabs:
-
Expand Down
Loading
Loading