-
Notifications
You must be signed in to change notification settings - Fork 0
Infinite time for schema searches #21
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
Conversation
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.
WalkthroughThe 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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests
Comment |
|
There was a problem hiding this 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 scansEpoch 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 startGood 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
📒 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.jsondashboard-deployments/system-monitoring-influxdb2-flux-grafana/provisioning/dashboards/device_details.jsondashboard-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.jsondashboard-deployments/system-monitoring-influxdb2-flux-grafana/provisioning/dashboards/device_details.jsondashboard-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 goodVersion increment aligns with dashboard changes.
dashboard-deployments/system-monitoring-influxdb2-flux-grafana/provisioning/dashboards/overview_of_devices.json (1)
1197-1197: Dashboard version increment acknowledgedMatches the content changes.
dashboard-deployments/system-monitoring-influxdb2-flux-grafana/provisioning/dashboards/device_details.json (1)
1115-1115: Version bump OKConsistent with changes.



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