Skip to content

Conversation

@daniel-falk
Copy link
Contributor

@daniel-falk daniel-falk commented Oct 3, 2025

This commit adds dropdown to filter by architecture and system on chip. It also adds the information to the device details.

Summary by CodeRabbit

  • New Features

    • Added “Device Architecture & SoC” stat panel to device details.
    • Introduced global Architecture and System on Chip (SoC) templated filters with selectors across dashboards.
    • Updated panels to respect Architecture/SoC filters for consistent slicing.
  • Refactor

    • Simplified system overview queries by removing redundant multi-query blocks and streamlining filtered data paths.
  • Chores

    • Reflowed dashboard layouts to accommodate the new panel.
    • Bumped dashboard versions to reflect changes.

This commit adds dropdown to filter by architecture and system on chip.
It also adds the information to the device details.
@coderabbitai
Copy link

coderabbitai bot commented Oct 3, 2025

Walkthrough

Added Architecture and SOC as dashboard template filters and integrated them into Flux queries across three Grafana dashboards. Inserted a new "Device Architecture & SoC" stat panel in device_details, adjusted panel grid positions, and bumped dashboard versions.

Changes

Cohort / File(s) Summary
Device Details Dashboard
dashboard-deployments/system-monitoring-influxdb2-flux-grafana/provisioning/dashboards/device_details.json
Added new stat panel "Device Architecture & SoC" (id 14) with a Flux query to fetch latest architecture and SoC per device; shifted many panels' gridPos.y values to accommodate the new panel; bumped version 36 → 37.
Overview of Devices Dashboard
dashboard-deployments/system-monitoring-influxdb2-flux-grafana/provisioning/dashboards/overview_of_devices.json
Added templating variables for Architecture and SOC (Flux schema.tagValues); propagated architecture/soc filters into primary device queries and related panels (external/local IP, latency, CPU, memory); bumped version 32 → 33.
System Overview Dashboard
dashboard-deployments/system-monitoring-influxdb2-flux-grafana/provisioning/dashboards/system_overview.json
Introduced Architecture and SOC template variables and integrated their filters across CPU/memory/disk and other panels; simplified/streamlined several Flux queries by removing duplicate branches; bumped version 28 → 29.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant User as Dashboard UI
  participant Tmpl as Template Engine (Architecture/SOC)
  participant Graf as Grafana Panels
  participant DB as InfluxDB (Flux)

  User->>Tmpl: select Architecture/SOC (templating)
  Tmpl-->>Graf: inject filter values into panel queries
  Graf->>DB: execute Flux queries (with architecture/soc filters)
  DB-->>Graf: return filtered metrics and latest fields (arch, soc)
  Graf-->>User: render panels (including new "Device Architecture & SoC" stat)
  note right of Graf: Panels' grid positions adjusted to fit new panel
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • fixedit-olatz

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly captures the primary changes by specifying that the pull request adds informational elements and dropdown filters for SoC and architecture, reflecting both device details enhancements and templating updates across dashboards.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch more-filters

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ed01e79 and 167b486.

📒 Files selected for processing (3)
  • dashboard-deployments/system-monitoring-influxdb2-flux-grafana/provisioning/dashboards/device_details.json (11 hunks)
  • dashboard-deployments/system-monitoring-influxdb2-flux-grafana/provisioning/dashboards/overview_of_devices.json (10 hunks)
  • dashboard-deployments/system-monitoring-influxdb2-flux-grafana/provisioning/dashboards/system_overview.json (9 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
dashboard-deployments/**

⚙️ CodeRabbit configuration file

This directory contains server-side dashboard examples for visualizing data from FixedIT Data Agent running on Axis devices. These are primarily for DevOps/IT professionals comfortable with deploying Grafana dashboards and InfluxDB servers. Some dashboards work directly with bundled agent configurations, others can be customized. Licensed under Elastic License 2.0. Review for deployment complexity, dashboard usability, and proper licensing compliance. We should make sure that dashboards are portable and does not check in specific host names, or refer to other specific data from a single deployment.

Files:

  • dashboard-deployments/system-monitoring-influxdb2-flux-grafana/provisioning/dashboards/overview_of_devices.json
  • dashboard-deployments/system-monitoring-influxdb2-flux-grafana/provisioning/dashboards/device_details.json
  • dashboard-deployments/system-monitoring-influxdb2-flux-grafana/provisioning/dashboards/system_overview.json
**/*

⚙️ CodeRabbit configuration file

This repository serves FixedIT Data Agent users across a spectrum from plug-and-play dashboard deployment to advanced edge device customization. Consider whether changes maintain accessibility for both DevOps professionals (server-side focus) and developers (edge customization focus). If new features are added or existing ones changed significantly, ensure documentation clearly explains the intended audience and usage level. We use prettier for formatting of common file formats like markdown, yaml, json, etc. Example projects should be placed in the repo-root in a directory named project-*/. Whenever referencing Axis device model names like "D4100-VE mk II" or "M3045", prefix it with "AXIS" in capital letters (e.g. "AXIS D4100-VE mk II"). When using Axis as a company name, use "Axis Communications", note that all-caps is only used when "AXIS" is used in their product names, not their company name. When using the name of an Axis product, google on the name to verify that it is correctly identified. Avoid using 'cameras' or 'Axis cameras' unless the solution in related to visual analytics, otherwise prefer using 'Axis devices' to show that the FixedIT Data Agent also works with strobes, speakers, door stations, etc. Images used for the README should be placed in a directory called .images/ in the affected project folder. These images might also be referred to from other sources like the top-level README.md file.

Files:

  • dashboard-deployments/system-monitoring-influxdb2-flux-grafana/provisioning/dashboards/overview_of_devices.json
  • dashboard-deployments/system-monitoring-influxdb2-flux-grafana/provisioning/dashboards/device_details.json
  • dashboard-deployments/system-monitoring-influxdb2-flux-grafana/provisioning/dashboards/system_overview.json

@daniel-falk
Copy link
Contributor Author

daniel-falk commented Oct 4, 2025

Todo:

  • Validate that the new filters are applied to all visualizations. It's probably not applied to "Average CPU / RAM / Disk Usage per Type" in the System Overview...

Base automatically changed from fix-filters to main October 8, 2025 13:28
@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 8, 2025

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
dashboard-deployments/system-monitoring-influxdb2-flux-grafana/provisioning/dashboards/device_details.json (1)

253-314: Stat panel may not render two string fields well

The query outputs two text columns (“Architecture”, “System on Chip”). Stat excels at a single value; with multiple string fields it can show only one or “No value”. Prefer a table panel, or split into two stat panels side‑by‑side.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 167b486 and 4335d56.

📒 Files selected for processing (3)
  • dashboard-deployments/system-monitoring-influxdb2-flux-grafana/provisioning/dashboards/device_details.json (12 hunks)
  • dashboard-deployments/system-monitoring-influxdb2-flux-grafana/provisioning/dashboards/overview_of_devices.json (11 hunks)
  • dashboard-deployments/system-monitoring-influxdb2-flux-grafana/provisioning/dashboards/system_overview.json (16 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
dashboard-deployments/**

⚙️ CodeRabbit configuration file

This directory contains server-side dashboard examples for visualizing data from FixedIT Data Agent running on Axis devices. These are primarily for DevOps/IT professionals comfortable with deploying Grafana dashboards and InfluxDB servers. Some dashboards work directly with bundled agent configurations, others can be customized. Licensed under Elastic License 2.0. Review for deployment complexity, dashboard usability, and proper licensing compliance. We should make sure that dashboards are portable and does not check in specific host names, or refer to other specific data from a single deployment.

Files:

  • dashboard-deployments/system-monitoring-influxdb2-flux-grafana/provisioning/dashboards/system_overview.json
  • dashboard-deployments/system-monitoring-influxdb2-flux-grafana/provisioning/dashboards/overview_of_devices.json
  • dashboard-deployments/system-monitoring-influxdb2-flux-grafana/provisioning/dashboards/device_details.json
**/*

⚙️ CodeRabbit configuration file

This repository serves FixedIT Data Agent users across a spectrum from plug-and-play dashboard deployment to advanced edge device customization. Consider whether changes maintain accessibility for both DevOps professionals (server-side focus) and developers (edge customization focus). If new features are added or existing ones changed significantly, ensure documentation clearly explains the intended audience and usage level. We use prettier for formatting of common file formats like markdown, yaml, json, etc. Example projects should be placed in the repo-root in a directory named project-*/. Whenever referencing Axis device model names like "D4100-VE mk II" or "M3045", prefix it with "AXIS" in capital letters (e.g. "AXIS D4100-VE mk II"). When using Axis as a company name, use "Axis Communications", note that all-caps is only used when "AXIS" is used in their product names, not their company name. When using the name of an Axis product, google on the name to verify that it is correctly identified. Avoid using 'cameras' or 'Axis cameras' unless the solution in related to visual analytics, otherwise prefer using 'Axis devices' to show that the FixedIT Data Agent also works with strobes, speakers, door stations, etc. Images used for the README should be placed in a directory called .images/ in the affected project folder. These images might also be referred to from other sources like the top-level README.md file.

Files:

  • dashboard-deployments/system-monitoring-influxdb2-flux-grafana/provisioning/dashboards/system_overview.json
  • dashboard-deployments/system-monitoring-influxdb2-flux-grafana/provisioning/dashboards/overview_of_devices.json
  • dashboard-deployments/system-monitoring-influxdb2-flux-grafana/provisioning/dashboards/device_details.json
🔇 Additional comments (5)
dashboard-deployments/system-monitoring-influxdb2-flux-grafana/provisioning/dashboards/overview_of_devices.json (3)

183-183: Good propagation of architecture/SoC filters in Last Report panel

All six targets now honor the new selectors with the regex pattern; consistent with the rest of the dashboard.

Also applies to: 192-192, 201-201, 210-210, 219-219, 228-228


328-329: AXIS OS Changes now respects architecture/SoC

The filter block includes both tags; resolves the prior inconsistency for this panel.


1186-1238: Templating for Architecture and SoC looks correct

Multi-select, includeAll with ".*", and influx schema.tagValues usage are all aligned with existing variables.

dashboard-deployments/system-monitoring-influxdb2-flux-grafana/provisioning/dashboards/system_overview.json (2)

74-76: Architecture/SoC filters wired through key panels

Queries now consistently apply architecture and SoC across Device Count (selected), Missing Devices, New Devices, and Outliers. This addresses the noted filter consistency concern.

Also applies to: 228-239, 246-248, 483-485, 492-494, 685-687, 694-696, 703-705, 712-714, 721-723, 730-732


1141-1189: Templating: Architecture and SoC added correctly

Variables are multi-select with includeAll and populated via schema.tagValues; consistent with existing templates.

Manually verify no panels omit the new architecture/soc filters, for example:

rg -n '"query":' dashboard-deployments/system-monitoring-influxdb2-flux-grafana/provisioning/dashboards/*.json \
  | rg 'product_full_name' -C3 \
  | grep -L 'architecture' \
  | grep -L 'soc'

Comment on lines +846 to 847
"query": "// Base query with shared filters\nbase_data = from(bucket: \"${bucket}\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) =>\n exists r.type and\n r.type =~ /^${type:regex}$/ and\n r[\"area\"] =~ /^${area:regex}$/ and\n r[\"geography\"] =~ /^${geography:regex}$/ and\n r[\"region\"] =~ /^${region:regex}$/ and\n r[\"site\"] =~ /^${site:regex}$/ and\n r[\"product_full_name\"] =~ /^${model:regex}$/ and\n r[\"${unique_identifier}\"] =~ /^${device:regex}$/ and\n r[\"architecture\"] =~ /^${architecture:regex}$/ and\n r[\"soc\"] =~ /^${soc:regex}$/\n )\n\n// CPU usage per type\ncpu = base_data\n |> filter(fn: (r) =>\n r._measurement == \"cpu\" and\n r._field == \"usage_idle\" and\n r.cpu == \"cpu-total\"\n )\n |> map(fn: (r) => ({ r with _value: 100.0 - r._value }))\n |> group(columns: [\"type\"])\n |> mean()\n |> map(fn: (r) => ({ r with metric: \"CPU Usage\" }))\n\n// RAM usage per type\nram = base_data\n |> filter(fn: (r) =>\n r._measurement == \"mem\" and\n r._field == \"used_percent\"\n )\n |> group(columns: [\"type\"])\n |> mean()\n |> map(fn: (r) => ({ r with metric: \"RAM Usage\" }))\n\n// Built-in storage usage per type\ndisk_usr_local = base_data\n |> filter(fn: (r) =>\n r._measurement == \"disk\" and\n r._field == \"used_percent\" and\n r.path == \"/usr/local\"\n )\n |> group(columns: [\"type\"])\n |> mean()\n |> map(fn: (r) => ({ r with metric: \"Disk /usr/local\" }))\n\n// SD card storage usage per type\ndisk_sd = base_data\n |> filter(fn: (r) =>\n r._measurement == \"disk\" and\n r._field == \"used_percent\" and\n r.path == \"/var/volatile/spool/storage/SD_DISK\"\n )\n |> group(columns: [\"type\"])\n |> mean()\n |> map(fn: (r) => ({ r with metric: \"Disk /SD_DISK\" }))\n\n// Combine all metrics into a single table\nunion(tables: [cpu, ram, disk_usr_local, disk_sd])\n |> group()\n |> pivot(rowKey: [\"type\"], columnKey: [\"metric\"], valueColumn: \"_value\")",
"refId": "A"
Copy link

@coderabbitai coderabbitai bot Oct 8, 2025

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Fix SD card path to match data agent tags

This panel uses “/var/volatile/spool/storage/SD_DISK”, while other panels use “/var/spool/storage/SD_DISK”. The extra “volatile” likely yields no data here.

Apply:

-    r.path == "/var/volatile/spool/storage/SD_DISK"
+    r.path == "/var/spool/storage/SD_DISK"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"query": "// Base query with shared filters\nbase_data = from(bucket: \"${bucket}\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) =>\n exists r.type and\n r.type =~ /^${type:regex}$/ and\n r[\"area\"] =~ /^${area:regex}$/ and\n r[\"geography\"] =~ /^${geography:regex}$/ and\n r[\"region\"] =~ /^${region:regex}$/ and\n r[\"site\"] =~ /^${site:regex}$/ and\n r[\"product_full_name\"] =~ /^${model:regex}$/ and\n r[\"${unique_identifier}\"] =~ /^${device:regex}$/ and\n r[\"architecture\"] =~ /^${architecture:regex}$/ and\n r[\"soc\"] =~ /^${soc:regex}$/\n )\n\n// CPU usage per type\ncpu = base_data\n |> filter(fn: (r) =>\n r._measurement == \"cpu\" and\n r._field == \"usage_idle\" and\n r.cpu == \"cpu-total\"\n )\n |> map(fn: (r) => ({ r with _value: 100.0 - r._value }))\n |> group(columns: [\"type\"])\n |> mean()\n |> map(fn: (r) => ({ r with metric: \"CPU Usage\" }))\n\n// RAM usage per type\nram = base_data\n |> filter(fn: (r) =>\n r._measurement == \"mem\" and\n r._field == \"used_percent\"\n )\n |> group(columns: [\"type\"])\n |> mean()\n |> map(fn: (r) => ({ r with metric: \"RAM Usage\" }))\n\n// Built-in storage usage per type\ndisk_usr_local = base_data\n |> filter(fn: (r) =>\n r._measurement == \"disk\" and\n r._field == \"used_percent\" and\n r.path == \"/usr/local\"\n )\n |> group(columns: [\"type\"])\n |> mean()\n |> map(fn: (r) => ({ r with metric: \"Disk /usr/local\" }))\n\n// SD card storage usage per type\ndisk_sd = base_data\n |> filter(fn: (r) =>\n r._measurement == \"disk\" and\n r._field == \"used_percent\" and\n r.path == \"/var/volatile/spool/storage/SD_DISK\"\n )\n |> group(columns: [\"type\"])\n |> mean()\n |> map(fn: (r) => ({ r with metric: \"Disk /SD_DISK\" }))\n\n// Combine all metrics into a single table\nunion(tables: [cpu, ram, disk_usr_local, disk_sd])\n |> group()\n |> pivot(rowKey: [\"type\"], columnKey: [\"metric\"], valueColumn: \"_value\")",
"refId": "A"
// SD card storage usage per type
disk_sd = base_data
|> filter(fn: (r) =>
r._measurement == "disk" and
r._field == "used_percent" and
r.path == "/var/spool/storage/SD_DISK"
)
|> group(columns: ["type"])
|> mean()
|> map(fn: (r) => ({ r with metric: "Disk /SD_DISK" }))
🤖 Prompt for AI Agents
In
dashboard-deployments/system-monitoring-influxdb2-flux-grafana/provisioning/dashboards/system_overview.json
around lines 846-847, the SD card disk filter uses the path
"/var/volatile/spool/storage/SD_DISK" which doesn't match the agent tags used
elsewhere; update the filter path to "/var/spool/storage/SD_DISK" so it matches
other panels and returns data (leave metric name and grouping unchanged).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True, but unrelated. The way the file system is set up, both will work. Will fix in another PR.

Copy link

Choose a reason for hiding this comment

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

@daniel-falk, understood! Thank you for confirming and for planning to address it in a follow-up PR. Since you've noted it's unrelated to the architecture/SoC filter additions in this PR, that makes sense to handle separately.

If you haven't already, you might want to open an issue to track the path normalization across all dashboard panels to ensure it doesn't get lost. Let me know if you'd like me to create one for you.

@daniel-falk daniel-falk merged commit 1431884 into main Oct 15, 2025
4 checks passed
@daniel-falk daniel-falk deleted the more-filters branch October 15, 2025 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants