Skip to content

Commit

Permalink
[opentelemetry-collector] Add db spanmetrics preset (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
povilasv authored Oct 22, 2024
1 parent 673f629 commit 4d77f22
Show file tree
Hide file tree
Showing 107 changed files with 290 additions and 125 deletions.
3 changes: 3 additions & 0 deletions charts/opentelemetry-collector/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## OpenTelemetry Collector

### v0.95.2 / 2024-10-22
- [Feat] add dbMetrics option to spanmetrics preset

### v0.93.3 / 2024-09-23
- [Fix] agent_description.non_identifying_attributes expected a map, got 'slice'

Expand Down
2 changes: 1 addition & 1 deletion charts/opentelemetry-collector/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: opentelemetry-collector
version: 0.95.1
version: 0.95.2
description: OpenTelemetry Collector Helm chart for Kubernetes
type: application
home: https://opentelemetry.io/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ kind: ClusterRole
metadata:
name: example-opentelemetry-collector
labels:
helm.sh/chart: opentelemetry-collector-0.95.1
helm.sh/chart: opentelemetry-collector-0.95.2
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.111.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ kind: ClusterRoleBinding
metadata:
name: example-opentelemetry-collector
labels:
helm.sh/chart: opentelemetry-collector-0.95.1
helm.sh/chart: opentelemetry-collector-0.95.2
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.111.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: example-opentelemetry-collector-agent
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.95.1
helm.sh/chart: opentelemetry-collector-0.95.2
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.111.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: example-opentelemetry-collector
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.95.1
helm.sh/chart: opentelemetry-collector-0.95.2
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.111.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: example-opentelemetry-collector-agent
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.95.1
helm.sh/chart: opentelemetry-collector-0.95.2
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.111.0"
Expand All @@ -23,7 +23,7 @@ spec:
template:
metadata:
annotations:
checksum/config: 66e35f1468b647dbb1cda1f3452335752afa7184092d1dae6c371a38105eb2c4
checksum/config: 82bc9cbaf0c1525e9c88f104a8352d5afb7bec2fcdcfe16ad5aa95f29e27721a

labels:
app.kubernetes.io/name: opentelemetry-collector
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: example-opentelemetry-collector
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.95.1
helm.sh/chart: opentelemetry-collector-0.95.2
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.111.0"
Expand All @@ -25,7 +25,7 @@ spec:
template:
metadata:
annotations:
checksum/config: d2c0f46899de0718048b4ed3f8b78cc2724f4b570da4aec57ce8b76c682e6013
checksum/config: 692abac6b6b8a35823fe2f810aef4f5d5a50096377a2f3adbb90ceb438f7845b

labels:
app.kubernetes.io/name: opentelemetry-collector
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: example-opentelemetry-collector
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.95.1
helm.sh/chart: opentelemetry-collector-0.95.2
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.111.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: example-opentelemetry-collector
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.95.1
helm.sh/chart: opentelemetry-collector-0.95.2
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.111.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: example-opentelemetry-collector-agent
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.95.1
helm.sh/chart: opentelemetry-collector-0.95.2
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.111.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: example-opentelemetry-collector-agent
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.95.1
helm.sh/chart: opentelemetry-collector-0.95.2
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.111.0"
Expand All @@ -23,7 +23,7 @@ spec:
template:
metadata:
annotations:
checksum/config: 04ffb41f4fd2c392fe5b20f17697466a5059d9acbaa3aaedf273b148df903eba
checksum/config: 8232be3e61cb9b742959d1643ad44160314a45a56dea3c36b84102d269de1b0c

labels:
app.kubernetes.io/name: opentelemetry-collector
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: example-opentelemetry-collector
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.95.1
helm.sh/chart: opentelemetry-collector-0.95.2
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.111.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: example-opentelemetry-collector-agent
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.95.1
helm.sh/chart: opentelemetry-collector-0.95.2
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.111.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: example-opentelemetry-collector-agent
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.95.1
helm.sh/chart: opentelemetry-collector-0.95.2
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.111.0"
Expand All @@ -23,7 +23,7 @@ spec:
template:
metadata:
annotations:
checksum/config: 6c2514bb682daaa5be6b7f2d256d54bb22a7a50a48a76629e05bf26c7b68810a
checksum/config: fbefc6e3eddb03c12213ada083819fdd6d5994c669c246fe122b2336b5a0d618

labels:
app.kubernetes.io/name: opentelemetry-collector
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: example-opentelemetry-collector
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.95.1
helm.sh/chart: opentelemetry-collector-0.95.2
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.111.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: example-opentelemetry-collector-agent
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.95.1
helm.sh/chart: opentelemetry-collector-0.95.2
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.111.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: example-opentelemetry-collector-agent
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.95.1
helm.sh/chart: opentelemetry-collector-0.95.2
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.111.0"
Expand All @@ -23,7 +23,7 @@ spec:
template:
metadata:
annotations:
checksum/config: 6c2514bb682daaa5be6b7f2d256d54bb22a7a50a48a76629e05bf26c7b68810a
checksum/config: fbefc6e3eddb03c12213ada083819fdd6d5994c669c246fe122b2336b5a0d618

labels:
app.kubernetes.io/name: opentelemetry-collector
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: example-opentelemetry-collector
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.95.1
helm.sh/chart: opentelemetry-collector-0.95.2
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.111.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ kind: ClusterRole
metadata:
name: example-opentelemetry-collector
labels:
helm.sh/chart: opentelemetry-collector-0.95.1
helm.sh/chart: opentelemetry-collector-0.95.2
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.111.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ kind: ClusterRoleBinding
metadata:
name: example-opentelemetry-collector
labels:
helm.sh/chart: opentelemetry-collector-0.95.1
helm.sh/chart: opentelemetry-collector-0.95.2
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.111.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: example-opentelemetry-collector-agent
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.95.1
helm.sh/chart: opentelemetry-collector-0.95.2
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.111.0"
Expand All @@ -15,6 +15,7 @@ metadata:
data:
relay: |
connectors:
forward/db: {}
spanmetrics:
histogram:
explicit:
Expand All @@ -25,6 +26,27 @@ data:
metrics_expiration: 5m
metrics_flush_interval: 30s
namespace: ""
spanmetrics/db:
dimensions:
- name: db.namespace
- name: db.operation.name
- name: db.collection_name
- name: db.system
histogram:
explicit:
buckets:
- 100us
- 1ms
- 2ms
- 2.5ms
- 4ms
- 6ms
- 10ms
- 100ms
- 250ms
metrics_expiration: 5m
metrics_flush_interval: 30s
namespace: db
exporters:
debug: {}
extensions:
Expand All @@ -36,6 +58,10 @@ data:
observe_pods: true
processors:
batch: {}
filter/db_spanmetrics:
traces:
span:
- attributes["db.system"] == nil
k8sattributes:
extract:
metadata:
Expand Down Expand Up @@ -65,6 +91,36 @@ data:
check_interval: 5s
limit_percentage: 80
spike_limit_percentage: 25
transform/db:
trace_statements:
- context: span
statements:
- set(attributes["db.namespace"], attributes["db.name"]) where attributes["db.namespace"]
== nil
- set(attributes["db.namespace"], attributes["server.address"]) where attributes["db.namespace"]
== nil
- set(attributes["db.namespace"], attributes["network.peer.name"]) where attributes["db.namespace"]
== nil
- set(attributes["db.namespace"], attributes["net.peer.name"]) where attributes["db.namespace"]
== nil
- set(attributes["db.namespace"], attributes["db.system"]) where attributes["db.namespace"]
== nil
- set(attributes["db.operation.name"], attributes["db.operation"]) where attributes["db.operation.name"]
== nil
- set(attributes["db.collection_name"], attributes["db.sql.table"]) where attributes["db.collection_name"]
== nil
- set(attributes["db.collection_name"], attributes["db.cassandra.table"]) where
attributes["db.collection.name"] == nil
- set(attributes["db.collection_name"], attributes["db.mongodb.collection"])
where attributes["db.collection.name"] == nil
- set(attributes["db.collection_name"], attributes["db.redis.database_index"])
where attributes["db.collection.name"] == nil
- set(attributes["db.collection_name"], attributes["db.elasticsearch.path_parts.index"])
where attributes["db.collection.name"] == nil
- set(attributes["db.collection_name"], attributes["db.cosmosdb.container"])
where attributes["db.collection.name"] == nil
- set(attributes["db.collection_name"], attributes["aws_dynamodb.table_names"])
where attributes["db.collection.name"] == nil
transform/k8s_attributes:
log_statements:
- context: resource
Expand Down Expand Up @@ -333,10 +389,12 @@ data:
- prometheus
- receiver_creator/mysql
- spanmetrics
- spanmetrics/db
traces:
exporters:
- debug
- spanmetrics
- forward/db
processors:
- transform/span_name
- k8sattributes
Expand All @@ -347,6 +405,15 @@ data:
- otlp
- jaeger
- zipkin
traces/db:
exporters:
- spanmetrics/db
processors:
- filter/db_spanmetrics
- transform/db
- batch
receivers:
- forward/db
telemetry:
metrics:
address: ${env:MY_POD_IP}:8888
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: example-opentelemetry-collector-agent
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.95.1
helm.sh/chart: opentelemetry-collector-0.95.2
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.111.0"
Expand All @@ -23,7 +23,7 @@ spec:
template:
metadata:
annotations:
checksum/config: 652accdc61d41933a5cbd7e2aa29d070973aed6dac01c68b8e968a52340dfa6e
checksum/config: b7eb3b8d056922dcd4e9b04d117d9ff41da84fb061833cb72a818c58c1dfa3ce

labels:
app.kubernetes.io/name: opentelemetry-collector
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: example-opentelemetry-collector
namespace: default
labels:
helm.sh/chart: opentelemetry-collector-0.95.1
helm.sh/chart: opentelemetry-collector-0.95.2
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.111.0"
Expand Down
Loading

0 comments on commit 4d77f22

Please sign in to comment.