Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(localenv): span metrics generation #2849

Merged
merged 3 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
5 changes: 4 additions & 1 deletion localenv/telemetry/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ services:

prometheus:
image: prom/prometheus:latest
command: "--config.file=/etc/prometheus/prometheus.yaml --log.level=debug"
command:
- --config.file=/etc/prometheus/prometheus.yaml
- --log.level=debug
- --web.enable-remote-write-receiver
networks:
- rafiki
volumes:
Expand Down
79 changes: 75 additions & 4 deletions localenv/telemetry/grafana/provisioning/dashboards/example.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 1,
"links": [],
"panels": [
{
Expand Down Expand Up @@ -175,7 +176,7 @@
}
]
},
"pluginVersion": "11.1.0",
"pluginVersion": "11.1.3",
"targets": [
{
"datasource": {
Expand Down Expand Up @@ -319,6 +320,76 @@
"title": "Transaction Count",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "continuous-GrYlRd"
},
"fieldMinMax": false,
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "s"
},
"overrides": []
},
"gridPos": {
"h": 12,
"w": 12,
"x": 12,
"y": 8
},
"id": 6,
"options": {
"displayMode": "gradient",
"maxVizHeight": 300,
"minVizHeight": 16,
"minVizWidth": 8,
"namePlacement": "auto",
"orientation": "horizontal",
"reduceOptions": {
"calcs": ["lastNotNull"],
"fields": "",
"values": false
},
"showUnfilled": true,
"sizing": "auto",
"valueMode": "color"
},
"pluginVersion": "11.1.3",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"editorMode": "code",
"expr": "histogram_quantile(0.95, sum(rate(traces_spanmetrics_latency_bucket{span_name=~\"^(mutation|query).*\"}[$__rate_interval])) by (le, span_name))",
Copy link
Contributor

@mkurapov mkurapov Aug 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be something other than$__rate_interval, but instead the selected interval of the dashboard? That way you can see the timings per last x minutes/seconds etc

Copy link
Contributor Author

@BlairCurrey BlairCurrey Aug 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be something other than$__rate_interval, but instead the selected interval of the dashboard?

From what I can tell it does factor in the current time range. I spun up the localenv, ran some queries and saw the data in this visualization with 5m time range. I waited 5m+ and saw no data until I bumped to 15m time range.

Im also seeing it generally recommended as starting point for the rate arg :

"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "A"
}
],
"title": "Panel Title",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets update this title

"type": "bargauge"
},
{
"datasource": {
"type": "prometheus",
Expand Down Expand Up @@ -370,7 +441,7 @@
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "11.1.0",
"pluginVersion": "11.1.3",
"targets": [
{
"datasource": {
Expand Down Expand Up @@ -465,7 +536,7 @@
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "11.1.0",
"pluginVersion": "11.1.3",
"targets": [
{
"datasource": {
Expand Down Expand Up @@ -536,6 +607,6 @@
"timezone": "browser",
"title": "Example Dashboard",
"uid": "fdr58stwkr6yof",
"version": 1,
"version": 3,
"weekStart": ""
}
10 changes: 10 additions & 0 deletions localenv/telemetry/tempo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,13 @@ storage:
path: /var/tempo/blocks
wal:
path: /var/tempo/wal

metrics_generator:
storage:
path: /tmp/tempo/wal
remote_write:
- url: http://prometheus:9090/api/v1/write
send_exemplars: true

overrides:
metrics_generator_processors: [span-metrics]
Loading