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

fix alloy-logs dashboard #661

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Update DNS dashboard to include memory requests.

### Fixed

- fix alloy mixins generation
- fix alloy mixins
- fix Alloy / Logs Overview dashboard.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- fix Alloy / Logs Overview dashboard.
### Fixed
- Fix Alloy / Logs Overview dashboard.


## [3.28.0] - 2025-01-13

### Added
Expand Down
8 changes: 8 additions & 0 deletions alloy/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,13 @@ for file in "$TMPDIR/dashboards"/*.json; do
)
done

# Fix alloy-logs specific issues
sed -i 's/{,/{/g' "$TMPDIR"/dashboards/alloy-logs.json
sed -i 's/job/scrape_job/g' "$TMPDIR"/dashboards/alloy-logs.json

# Fix cluster selector on all dashboards
sed -i 's/cluster=/cluster_id=/g' "$TMPDIR"/dashboards/*.json
sed -i 's/\(.*label_values(.*cluster\)\().*\)/\1_id\2/g' "$TMPDIR"/dashboards/*.json

set -x
mv "$TMPDIR/dashboards"/*.json "$helm_dir"
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"datasource": "$loki_datasource",
"enable": true,
"expr": "{cluster=\"$cluster\", container=\"kube-diff-logger\"} | json | namespace_extracted=\"alloy\" | name_extracted=~\"alloy.*\"",
"expr": "{cluster_id=\"$cluster\", container=\"kube-diff-logger\"} | json | namespace_extracted=\"alloy\" | name_extracted=~\"alloy.*\"",
"iconColor": "rgba(0, 211, 255, 1)",
"instant": false,
"name": "Deployments",
Expand Down Expand Up @@ -59,7 +59,7 @@
"targets": [
{
"datasource": "${datasource}",
"expr": "sum(cluster_node_lamport_time{cluster=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\", instance=~\"$instance\"}) \n",
"expr": "sum(cluster_node_lamport_time{cluster_id=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\", instance=~\"$instance\"}) \n",
"format": "table",
"instant": true,
"legendFormat": "__auto",
Expand All @@ -68,7 +68,7 @@
},
{
"datasource": "${datasource}",
"expr": "sum(cluster_node_update_observers{cluster=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\", instance=~\"$instance\"})\n",
"expr": "sum(cluster_node_update_observers{cluster_id=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\", instance=~\"$instance\"})\n",
"format": "table",
"instant": true,
"legendFormat": "__auto",
Expand All @@ -77,7 +77,7 @@
},
{
"datasource": "${datasource}",
"expr": "sum(cluster_node_gossip_health_score{cluster=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\", instance=~\"$instance\"})\n",
"expr": "sum(cluster_node_gossip_health_score{cluster_id=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\", instance=~\"$instance\"})\n",
"format": "table",
"instant": true,
"legendFormat": "__auto",
Expand All @@ -86,7 +86,7 @@
},
{
"datasource": "${datasource}",
"expr": "sum(cluster_node_gossip_proto_version{cluster=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\", instance=~\"$instance\"})\n",
"expr": "sum(cluster_node_gossip_proto_version{cluster_id=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\", instance=~\"$instance\"})\n",
"format": "table",
"instant": true,
"legendFormat": "__auto",
Expand Down Expand Up @@ -132,7 +132,7 @@
"targets": [
{
"datasource": "${datasource}",
"expr": "rate(cluster_node_gossip_received_events_total{cluster=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])\n",
"expr": "rate(cluster_node_gossip_received_events_total{cluster_id=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])\n",
"instant": false,
"legendFormat": "{{event}}",
"range": true
Expand All @@ -158,7 +158,7 @@
"targets": [
{
"datasource": "${datasource}",
"expr": "sum(cluster_node_peers{cluster=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\", instance=~\"$instance\"})\n",
"expr": "sum(cluster_node_peers{cluster_id=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\", instance=~\"$instance\"})\n",
"instant": false,
"legendFormat": "__auto",
"range": true
Expand All @@ -184,7 +184,7 @@
"targets": [
{
"datasource": "${datasource}",
"expr": "cluster_node_peers{cluster=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\", instance=~\"$instance\"}\n",
"expr": "cluster_node_peers{cluster_id=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\", instance=~\"$instance\"}\n",
"instant": false,
"legendFormat": "{{state}}",
"range": true
Expand Down Expand Up @@ -223,14 +223,14 @@
"targets": [
{
"datasource": "${datasource}",
"expr": "rate(cluster_transport_rx_bytes_total{cluster=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])\n",
"expr": "rate(cluster_transport_rx_bytes_total{cluster_id=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])\n",
"instant": false,
"legendFormat": "rx",
"range": true
},
{
"datasource": "${datasource}",
"expr": "-1 * rate(cluster_transport_tx_bytes_total{cluster=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])\n",
"expr": "-1 * rate(cluster_transport_tx_bytes_total{cluster_id=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])\n",
"instant": false,
"legendFormat": "tx",
"range": true
Expand All @@ -255,14 +255,14 @@
"targets": [
{
"datasource": "${datasource}",
"expr": "1 - (\n rate(cluster_transport_tx_packets_failed_total{cluster=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\", instance=~\"$instance\"}[$__rate_interval]) /\n rate(cluster_transport_tx_packets_total{cluster=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])\n)\n",
"expr": "1 - (\n rate(cluster_transport_tx_packets_failed_total{cluster_id=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\", instance=~\"$instance\"}[$__rate_interval]) /\n rate(cluster_transport_tx_packets_total{cluster_id=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])\n)\n",
"instant": false,
"legendFormat": "Tx success %",
"range": true
},
{
"datasource": "${datasource}",
"expr": "1 - (\n rate(cluster_transport_rx_packets_failed_total{cluster=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\", instance=~\"$instance\"}[$__rate_interval]) /\n rate(cluster_transport_rx_packets_total{cluster=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])\n)\n",
"expr": "1 - (\n rate(cluster_transport_rx_packets_failed_total{cluster_id=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\", instance=~\"$instance\"}[$__rate_interval]) /\n rate(cluster_transport_rx_packets_total{cluster_id=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])\n)\n",
"instant": false,
"legendFormat": "Rx success %",
"range": true
Expand All @@ -288,14 +288,14 @@
"targets": [
{
"datasource": "${datasource}",
"expr": "cluster_transport_tx_packet_queue_length{cluster=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\", instance=~\"$instance\"}\n",
"expr": "cluster_transport_tx_packet_queue_length{cluster_id=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\", instance=~\"$instance\"}\n",
"instant": false,
"legendFormat": "tx queue",
"range": true
},
{
"datasource": "${datasource}",
"expr": "cluster_transport_rx_packet_queue_length{cluster=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\", instance=~\"$instance\"}\n",
"expr": "cluster_transport_rx_packet_queue_length{cluster_id=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\", instance=~\"$instance\"}\n",
"instant": false,
"legendFormat": "rx queue",
"range": true
Expand Down Expand Up @@ -323,14 +323,14 @@
"targets": [
{
"datasource": "${datasource}",
"expr": "rate(cluster_transport_stream_rx_bytes_total{cluster=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])\n",
"expr": "rate(cluster_transport_stream_rx_bytes_total{cluster_id=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])\n",
"instant": false,
"legendFormat": "rx",
"range": true
},
{
"datasource": "${datasource}",
"expr": "-1 * rate(cluster_transport_stream_tx_bytes_total{cluster=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])\n",
"expr": "-1 * rate(cluster_transport_stream_tx_bytes_total{cluster_id=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])\n",
"instant": false,
"legendFormat": "tx",
"range": true
Expand All @@ -355,14 +355,14 @@
"targets": [
{
"datasource": "${datasource}",
"expr": "1 - (\n rate(cluster_transport_stream_tx_packets_failed_total{cluster=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\", instance=~\"$instance\"}[$__rate_interval]) /\n rate(cluster_transport_stream_tx_packets_total{cluster=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])\n)\n",
"expr": "1 - (\n rate(cluster_transport_stream_tx_packets_failed_total{cluster_id=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\", instance=~\"$instance\"}[$__rate_interval]) /\n rate(cluster_transport_stream_tx_packets_total{cluster_id=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])\n)\n",
"instant": false,
"legendFormat": "Tx success %",
"range": true
},
{
"datasource": "${datasource}",
"expr": "1 - (\n rate(cluster_transport_stream_rx_packets_failed_total{cluster=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\", instance=~\"$instance\"}[$__rate_interval]) /\n rate(cluster_transport_stream_rx_packets_total{cluster=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])\n)\n",
"expr": "1 - (\n rate(cluster_transport_stream_rx_packets_failed_total{cluster_id=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\", instance=~\"$instance\"}[$__rate_interval]) /\n rate(cluster_transport_stream_rx_packets_total{cluster_id=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])\n)\n",
"instant": false,
"legendFormat": "Rx success %",
"range": true
Expand All @@ -383,7 +383,7 @@
"targets": [
{
"datasource": "${datasource}",
"expr": "cluster_transport_streams{cluster=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\", instance=~\"$instance\"}\n",
"expr": "cluster_transport_streams{cluster_id=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\", instance=~\"$instance\"}\n",
"instant": false,
"legendFormat": "Open streams",
"range": true
Expand Down Expand Up @@ -424,7 +424,7 @@
"label": "cluster",
"name": "cluster",
"query": {
"query": "label_values(alloy_component_controller_running_components, cluster)\n",
"query": "label_values(alloy_component_controller_running_components, cluster_id)\n",
"refId": "cluster"
},
"refresh": 2,
Expand All @@ -436,7 +436,7 @@
"label": "namespace",
"name": "namespace",
"query": {
"query": "label_values(alloy_component_controller_running_components{cluster=~\"$cluster\"}, namespace)\n",
"query": "label_values(alloy_component_controller_running_components{cluster_id=~\"$cluster\"}, namespace)\n",
"refId": "namespace"
},
"refresh": 2,
Expand All @@ -448,7 +448,7 @@
"label": "job",
"name": "job",
"query": {
"query": "label_values(alloy_component_controller_running_components{cluster=~\"$cluster\", namespace=~\"$namespace\"}, job)\n",
"query": "label_values(alloy_component_controller_running_components{cluster_id=~\"$cluster\", namespace=~\"$namespace\"}, job)\n",
"refId": "job"
},
"refresh": 2,
Expand All @@ -463,7 +463,7 @@
"multi": true,
"name": "instance",
"query": {
"query": "label_values(alloy_component_controller_running_components{cluster=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\"}, instance)\n",
"query": "label_values(alloy_component_controller_running_components{cluster_id=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\"}, instance)\n",
"refId": "instance"
},
"refresh": 2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"datasource": "$loki_datasource",
"enable": true,
"expr": "{cluster=\"$cluster\", container=\"kube-diff-logger\"} | json | namespace_extracted=\"alloy\" | name_extracted=~\"alloy.*\"",
"expr": "{cluster_id=\"$cluster\", container=\"kube-diff-logger\"} | json | namespace_extracted=\"alloy\" | name_extracted=~\"alloy.*\"",
"iconColor": "rgba(0, 211, 255, 1)",
"instant": false,
"name": "Deployments",
Expand Down Expand Up @@ -47,7 +47,7 @@
"targets": [
{
"datasource": "${datasource}",
"expr": "count(cluster_node_info{cluster=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\"})\n",
"expr": "count(cluster_node_info{cluster_id=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\"})\n",
"instant": true,
"legendFormat": "__auto",
"range": false
Expand Down Expand Up @@ -87,7 +87,7 @@
{
"targetBlank": false,
"title": "Detail dashboard for node",
"url": "/d/4047e755d822da63c8158cde32ae4dce/alloy-cluster-node?var-instance=${__data.fields.instance}&var-datasource=${datasource}&var-loki_datasource=${loki_datasource}&var-job=${job}&var-cluster=${cluster}&var-namespace=${namespace}"
"url": "/d/4047e755d822da63c8158cde32ae4dce/alloy-cluster-node?var-instance=${__data.fields.instance}&var-datasource=${datasource}&var-loki_datasource=${loki_datasource}&var-job=${job}&var-cluster_id=${cluster}&var-namespace=${namespace}"
}
]
}
Expand All @@ -104,7 +104,7 @@
"targets": [
{
"datasource": "${datasource}",
"expr": "cluster_node_info{cluster=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\"}\n",
"expr": "cluster_node_info{cluster_id=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\"}\n",
"format": "table",
"instant": true,
"legendFormat": "__auto",
Expand Down Expand Up @@ -189,7 +189,7 @@
"targets": [
{
"datasource": "${datasource}",
"expr": "clamp((\n sum(stddev by (state) (cluster_node_peers{cluster=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\"}) != 0) or\n (sum(abs(sum without (state) (cluster_node_peers{cluster=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\"})) - scalar(count(cluster_node_info{cluster=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\"})) != 0))\n ),\n 1, 1\n)\n",
"expr": "clamp((\n sum(stddev by (state) (cluster_node_peers{cluster_id=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\"}) != 0) or\n (sum(abs(sum without (state) (cluster_node_peers{cluster_id=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\"})) - scalar(count(cluster_node_info{cluster_id=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\"})) != 0))\n ),\n 1, 1\n)\n",
"format": "time_series",
"instant": true,
"legendFormat": "__auto",
Expand Down Expand Up @@ -243,7 +243,7 @@
"targets": [
{
"datasource": "${datasource}",
"expr": "ceil(clamp((\n sum(stddev by (state) (cluster_node_peers{cluster=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\"})) or\n (sum(abs(sum without (state) (cluster_node_peers{cluster=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\"})) - scalar(count(cluster_node_info{cluster=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\"}))))\n ),\n 0, 1\n))\n",
"expr": "ceil(clamp((\n sum(stddev by (state) (cluster_node_peers{cluster_id=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\"})) or\n (sum(abs(sum without (state) (cluster_node_peers{cluster_id=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\"})) - scalar(count(cluster_node_info{cluster_id=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\"}))))\n ),\n 0, 1\n))\n",
"instant": false,
"legendFormat": "Converged",
"range": true
Expand All @@ -269,7 +269,7 @@
"targets": [
{
"datasource": "${datasource}",
"expr": "sum by(instance) (cluster_node_peers{cluster=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\"})\n",
"expr": "sum by(instance) (cluster_node_peers{cluster_id=~\"$cluster\", namespace=~\"$namespace\", job=~\"$job\"})\n",
"instant": false,
"legendFormat": "{{instance}}",
"range": true
Expand Down Expand Up @@ -310,7 +310,7 @@
"label": "cluster",
"name": "cluster",
"query": {
"query": "label_values(alloy_component_controller_running_components, cluster)\n",
"query": "label_values(alloy_component_controller_running_components, cluster_id)\n",
"refId": "cluster"
},
"refresh": 2,
Expand All @@ -322,7 +322,7 @@
"label": "namespace",
"name": "namespace",
"query": {
"query": "label_values(alloy_component_controller_running_components{cluster=~\"$cluster\"}, namespace)\n",
"query": "label_values(alloy_component_controller_running_components{cluster_id=~\"$cluster\"}, namespace)\n",
"refId": "namespace"
},
"refresh": 2,
Expand All @@ -334,7 +334,7 @@
"label": "job",
"name": "job",
"query": {
"query": "label_values(alloy_component_controller_running_components{cluster=~\"$cluster\", namespace=~\"$namespace\"}, job)\n",
"query": "label_values(alloy_component_controller_running_components{cluster_id=~\"$cluster\", namespace=~\"$namespace\"}, job)\n",
"refId": "job"
},
"refresh": 2,
Expand Down
Loading
Loading