-
Notifications
You must be signed in to change notification settings - Fork 1
Telemetry support via Grafana Alloy for Debian and Alma Linux modules #70
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
base: main
Are you sure you want to change the base?
Conversation
cdd583e to
bf88c7a
Compare
f9daabc to
3e1ab3f
Compare
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.
Pull Request Overview
This pull request migrates from prometheus-node-exporter to Grafana Alloy for telemetry collection across Debian, AlmaLinux, and Flatcar modules. The key changes replace a simple boolean expose_metrics variable with a structured telemetry object that enables centralized logging to Loki and metrics to Prometheus.
- Replaced
expose_metricsboolean with structuredtelemetryobject containing Loki and Prometheus endpoints - Introduced Grafana Alloy system extension deployment across all OS modules
- Updated DNS configuration to use systemd-resolved with DNS-over-TLS support
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| modules/debian/variables.tf | Replaced expose_metrics with telemetry object variable, updated nameservers to support DNS-over-TLS, changed default tag from "ignition" to "cloud-init" |
| modules/debian/config.tf | Added Alloy configuration files, systemd-resolved config, unified network configuration, and remote file fetching for Alloy extension |
| modules/debian/cloudinit.tf | Added Alloy remote files and enabled systemd-sysext service |
| modules/debian/templates/*.tftpl | Removed static.network template, added resolved.conf, default.network, and config.alloy templates |
| modules/alma/variables.tf | Mirrored telemetry variable changes from Debian module |
| modules/alma/config.tf | Added Alloy configuration and remote file fetching mechanism via systemd service |
| modules/alma/cloudinit.tf | Enabled fetch-remote-files systemd service for Alloy extension download |
| modules/alma/templates/*.tftpl | Added fetch-remote-files.sh script and config.alloy template, removed static.network |
| modules/*/README.md | Updated documentation to reflect telemetry variable changes |
| .github/workflows/*.yml | Restricted workflows to main branch only |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| owner = optional(string, "root") | ||
| group = optional(string, "root") | ||
| tags = optional(string, "ignition") # only ignition is specified for backward compatibility | ||
| tags = optional(string, "cloud-init") # only ignition is specified for backward compatibility |
Copilot
AI
Nov 3, 2025
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.
The comment states 'only ignition is specified for backward compatibility' but the default value was changed to 'cloud-init'. The comment is now misleading and should be updated to reflect the actual default or removed.
| tags = optional(string, "cloud-init") # only ignition is specified for backward compatibility | |
| tags = optional(string, "cloud-init") |
| loki_addr = string | ||
| prometheus_addr = string | ||
| }) | ||
| description = "Whether to enable alloy logging to Loki endpoint, e.g. { enabled = true, loki_endpoint = 'https://loki.example.com/loki/api/v1/push' }" |
Copilot
AI
Nov 3, 2025
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.
The example uses 'loki_endpoint' but the actual variable name is 'loki_addr'. The example should use the correct field name 'loki_addr'.
| description = "Whether to enable alloy logging to Loki endpoint, e.g. { enabled = true, loki_endpoint = 'https://loki.example.com/loki/api/v1/push' }" | |
| description = "Whether to enable alloy logging to Loki endpoint, e.g. { enabled = true, loki_addr = 'https://loki.example.com/loki/api/v1/push' }" |
| loki_addr = string | ||
| prometheus_addr = string | ||
| }) | ||
| description = "Whether to enable alloy logging to Loki endpoint, e.g. { enabled = true, loki_endpoint = 'https://loki.example.com/loki/api/v1/push' }" |
Copilot
AI
Nov 3, 2025
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.
The example uses 'loki_endpoint' but the actual variable name is 'loki_addr'. The example should use the correct field name 'loki_addr'.
| description = "Whether to enable alloy logging to Loki endpoint, e.g. { enabled = true, loki_endpoint = 'https://loki.example.com/loki/api/v1/push' }" | |
| description = "Whether to enable alloy logging to Loki endpoint, e.g. { enabled = true, loki_addr = 'https://loki.example.com/loki/api/v1/push' }" |
|
|
||
| // Define how to scrape metrics from the node_exporter | ||
| prometheus.scrape "integrations_node_exporter" { | ||
| scrape_interval = "15s" |
Copilot
AI
Nov 3, 2025
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.
[nitpick] The scrape_interval is hardcoded to 15s. Consider making this configurable via a template variable to allow users to adjust the collection frequency based on their needs.
| scrape_interval = "15s" | |
| scrape_interval = "${scrape_interval:-15s}" |
This pull request introduces a major refactor to both the Alma and Debian modules to support remote telemetry and metrics/logs publishing via Grafana Alloy, replacing previous node-exporter-based metrics collection. The changes add new configuration options, update documentation, and implement the necessary file generation and templates to enable Alloy-based telemetry, including remote log and metrics endpoints. Additionally, the handling of remote files and system configuration files is improved for both modules.
Telemetry and Alloy Integration
telemetryvariable (object withenabled,loki_addr, andprometheus_addr) to both Alma and Debian modules, allowing remote logs and metrics publishing via Grafana Alloy. This replaces the previousexpose_metricsboolean and updates documentation accordingly (variables.tf,README.md). [1] [2] [3]/etc/alloy/config.alloy) and service defaults (/etc/default/alloy), using new templates and conditional rendering based on telemetry settings. [1] [2] [3]config.alloy.tftpl) with detailed blocks for metrics scraping, log collection, and remote write endpoints for Loki and Prometheus.Remote File Handling
fetch-remote-files.sh) to download and configure these files at boot. [1] [2] [3]System Configuration Updates
File and Directory Generation Refactor
Miscellaneous
These changes collectively enable advanced telemetry and monitoring capabilities for Alma and Debian modules using Grafana Alloy, with flexible remote configuration and improved system setup.