Skip to content

Conversation

@daniel-falk
Copy link
Contributor

@daniel-falk daniel-falk commented Sep 24, 2025

When selecting the options for dropdowns in the menu, we want to find all the devices and properties in the database schema. By default, a schema search is limited in time. This removes the limitation by starting at epoch time.

Summary by CodeRabbit

  • Improvements
    • Expanded variable dropdowns across Device Details, Overview of Devices, and System Overview dashboards by retrieving tag values from the earliest timestamp. This provides more complete and consistent filter options (e.g., device, model, area, region, site, type).
  • Chores
    • Bumped dashboard versions to reflect updates.

When selecting the options for dropdowns in the menu, we want to find
all the devices and properties in the database schema. By default, a
schema search is limited in time. This removes the limitation by
starting at epoch time.
@coderabbitai
Copy link

coderabbitai bot commented Sep 24, 2025

Walkthrough

The dashboards update Flux schema.tagValues calls to include an explicit start parameter (start: 1970-01-01T00:00:00Z) across multiple templated variables. Dashboard version numbers are incremented: device_details (35→36), overview_of_devices (31→32), system_overview (27→28).

Changes

Cohort / File(s) Summary
Grafana dashboards — add start to tagValues and bump versions
dashboard-deployments/system-monitoring-influxdb2-flux-grafana/provisioning/dashboards/device_details.json, .../overview_of_devices.json, .../system_overview.json
Added start: 1970-01-01T00:00:00Z to Flux schema.tagValues in templating definitions and queries for device and other tags (e.g., unique_identifier, area, geography, region, site, type, product_full_name, model). Incremented dashboard versions accordingly.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 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 clearly conveys that the pull request removes time constraints from schema queries by extending searches to the epoch, which aligns directly with the changes to include a start parameter of 1970-01-01T00:00:00Z in tagValues calls.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch longer-schema-time

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

@sonarqubecloud
Copy link

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: 0

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

917-917: Reduce schema scan cost by adding a predicate to tagValues()

Adding start at epoch meets the PR goal. To avoid full-bucket scans on large datasets, add a predicate to limit series inspected (e.g., to a ubiquitous measurement like "cpu"). Apply to both definition and query across all variables (area, geography, region, site, type, device, model).

Example (Area) — apply similarly to the others:

- "definition": "import \"influxdata/influxdb/schema\"\n\nschema.tagValues(bucket: \"${bucket}\", tag: \"area\", start: 1970-01-01T00:00:00Z)",
+ "definition": "import \"influxdata/influxdb/schema\"\n\nschema.tagValues(bucket: \"${bucket}\", tag: \"area\", start: 1970-01-01T00:00:00Z, predicate: (r) => r._measurement == \"cpu\")",

- "query": { "query": "import \"influxdata/influxdb/schema\"\n\nschema.tagValues(bucket: \"${bucket}\", tag: \"area\", start: 1970-01-01T00:00:00Z)" }
+ "query": { "query": "import \"influxdata/influxdb/schema\"\n\nschema.tagValues(bucket: \"${bucket}\", tag: \"area\", start: 1970-01-01T00:00:00Z, predicate: (r) => r._measurement == \"cpu\")" }

Also applies to: 925-926, 942-942, 950-951, 967-967, 975-976, 992-992, 1000-1001, 1017-1017, 1024-1025, 1041-1041, 1049-1050, 1079-1079, 1086-1087

dashboard-deployments/system-monitoring-influxdb2-flux-grafana/provisioning/dashboards/overview_of_devices.json (1)

1004-1005: Constrain schema.tagValues() with a predicate to avoid expensive full-history scans

Epoch start achieves “infinite” lookback. Add a predicate (e.g., measurement == "cpu") to all tagValues in both definition and query for device, area, geography, region, site, type, and model to reduce load and speed variable population.

Example (Device) — replicate to others:

- "definition": "import \"influxdata/influxdb/schema\"\n\nschema.tagValues(bucket: \"${bucket}\", tag: \"${unique_identifier}\", start: 1970-01-01T00:00:00Z)",
+ "definition": "import \"influxdata/influxdb/schema\"\n\nschema.tagValues(bucket: \"${bucket}\", tag: \"${unique_identifier}\", start: 1970-01-01T00:00:00Z, predicate: (r) => r._measurement == \"cpu\")",

- "query": { "query": "import \"influxdata/influxdb/schema\"\n\nschema.tagValues(bucket: \"${bucket}\", tag: \"${unique_identifier}\", start: 1970-01-01T00:00:00Z)" }
+ "query": { "query": "import \"influxdata/influxdb/schema\"\n\nschema.tagValues(bucket: \"${bucket}\", tag: \"${unique_identifier}\", start: 1970-01-01T00:00:00Z, predicate: (r) => r._measurement == \"cpu\")" }

Also consider updating the description at Line 1162 from “Model of the camera” to “Model of the Axis device” to align with repository wording guidance.

Also applies to: 1012-1013, 1029-1029, 1037-1038, 1054-1054, 1062-1063, 1079-1079, 1087-1088, 1104-1104, 1112-1113, 1129-1129, 1136-1137, 1161-1161, 1169-1170

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

1080-1080: Scope tagValues() with a predicate to limit work at epoch start

Good call adding epoch start. Add a predicate (e.g., measurement == "cpu") to reduce the series space scanned when populating the Device variable.

- "definition": "import \"influxdata/influxdb/schema\"\nschema.tagValues(\n  bucket: \"${bucket}\",\n  tag: \"host\",\n  start: 1970-01-01T00:00:00Z\n)",
+ "definition": "import \"influxdata/influxdb/schema\"\nschema.tagValues(\n  bucket: \"${bucket}\",\n  tag: \"host\",\n  start: 1970-01-01T00:00:00Z,\n  predicate: (r) => r._measurement == \"cpu\"\n)",

- "query": { "query": "import \"influxdata/influxdb/schema\"\nschema.tagValues(\n  bucket: \"${bucket}\",\n  tag: \"host\",\n  start: 1970-01-01T00:00:00Z\n)" }
+ "query": { "query": "import \"influxdata/influxdb/schema\"\nschema.tagValues(\n  bucket: \"${bucket}\",\n  tag: \"host\",\n  start: 1970-01-01T00:00:00Z,\n  predicate: (r) => r._measurement == \"cpu\"\n)" }

Also applies to: 1086-1087

📜 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 4eac70c and 4621e06.

📒 Files selected for processing (3)
  • dashboard-deployments/system-monitoring-influxdb2-flux-grafana/provisioning/dashboards/device_details.json (2 hunks)
  • dashboard-deployments/system-monitoring-influxdb2-flux-grafana/provisioning/dashboards/overview_of_devices.json (8 hunks)
  • dashboard-deployments/system-monitoring-influxdb2-flux-grafana/provisioning/dashboards/system_overview.json (8 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
🔇 Additional comments (3)
dashboard-deployments/system-monitoring-influxdb2-flux-grafana/provisioning/dashboards/system_overview.json (1)

1162-1162: Version bump looks good

Version increment aligns with dashboard changes.

dashboard-deployments/system-monitoring-influxdb2-flux-grafana/provisioning/dashboards/overview_of_devices.json (1)

1197-1197: Dashboard version increment acknowledged

Matches the content changes.

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

1115-1115: Version bump OK

Consistent with changes.

@daniel-falk daniel-falk merged commit 9695d96 into main Sep 26, 2025
4 checks passed
@daniel-falk daniel-falk deleted the longer-schema-time branch September 26, 2025 13:10
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