-
Notifications
You must be signed in to change notification settings - Fork 66
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
Update Grafana, build plugins #607
Conversation
WalkthroughThis pull request introduces updates to the monitoring package, focusing on Grafana image and plugin management. The changes include updating the Grafana version to 11.4.0, modifying the Dockerfile to support plugin installation, and adjusting the Kubernetes deployment configuration. The Makefile has been enhanced to dynamically set the Grafana version and streamline the Docker image build process. The version in Changes
Sequence DiagramsequenceDiagram
participant Makefile
participant Dockerfile
participant Grafana Deployment
Makefile->>Dockerfile: Build Grafana image
Dockerfile-->>Dockerfile: Install plugins
Dockerfile->>Grafana Deployment: Deploy configured image
Grafana Deployment->>Grafana Deployment: Use new plugins and configuration
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Signed-off-by: Andrei Kvapil <[email protected]>
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 (2)
packages/extra/monitoring/images/grafana/Dockerfile (1)
10-15
: Consider optimizing plugin installation steps.The plugin installation commands can be combined to reduce image layers:
ARG VLOGS_VERSION=v0.14.1 -RUN curl -L https://github.com/VictoriaMetrics/victorialogs-datasource/releases/download/${VLOGS_VERSION}/victoriametrics-logs-datasource-${VLOGS_VERSION}.tar.gz | \ - tar -xzf - -C /var/lib/grafana-plugins - -RUN grafana-cli --pluginsDir /var/lib/grafana-plugins plugins install natel-discrete-panel -RUN grafana-cli --pluginsDir /var/lib/grafana-plugins plugins install grafana-worldmap-panel +RUN curl -L https://github.com/VictoriaMetrics/victorialogs-datasource/releases/download/${VLOGS_VERSION}/victoriametrics-logs-datasource-${VLOGS_VERSION}.tar.gz | \ + tar -xzf - -C /var/lib/grafana-plugins && \ + grafana-cli --pluginsDir /var/lib/grafana-plugins plugins install natel-discrete-panel && \ + grafana-cli --pluginsDir /var/lib/grafana-plugins plugins install grafana-worldmap-panelpackages/extra/monitoring/Makefile (1)
1-2
: Consider adding version validation.The version extraction from Chart.yaml could benefit from validation:
-GRAFANA_TAG = $(shell awk '$$1 == "version:" {print $$2}' Chart.yaml) +GRAFANA_TAG = $(shell awk '$$1 == "version:" {print $$2}' Chart.yaml) +$(if $(GRAFANA_TAG),,$(error Failed to extract version from Chart.yaml)) +$(if $(shell echo "$(GRAFANA_TAG)" | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$$'),,$(error Invalid version format in Chart.yaml))
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
Makefile
(1 hunks)packages/extra/monitoring/Chart.yaml
(1 hunks)packages/extra/monitoring/Makefile
(2 hunks)packages/extra/monitoring/images/grafana.tag
(1 hunks)packages/extra/monitoring/images/grafana/Dockerfile
(1 hunks)packages/extra/monitoring/templates/grafana/grafana.yaml
(1 hunks)packages/extra/versions_map
(1 hunks)
✅ Files skipped from review due to trivial changes (2)
- packages/extra/monitoring/Chart.yaml
- packages/extra/monitoring/images/grafana.tag
🔇 Additional comments (6)
packages/extra/versions_map (1)
27-28
: LGTM! Version mappings are properly updated.Good practice to pin the previous version (1.7.0) to a specific commit while keeping the new version (1.8.0) at HEAD for development.
packages/extra/monitoring/images/grafana/Dockerfile (1)
1-8
: LGTM! Good security practices in place.
- Using specific version for base image
- Proper permission handling
- Appropriate user context switching
packages/extra/monitoring/Makefile (1)
15-26
: LGTM! Well-structured image build configuration.Good practices observed:
- Platform specification
- Proper cache configuration
- Clean metadata handling
Makefile (1)
9-9
: LGTM! Build target properly integrated.The monitoring image build is correctly added to the build sequence, following the established pattern.
packages/extra/monitoring/templates/grafana/grafana.yaml (2)
41-41
: Add validation for the image tag file.Good practice moving to externalized version management. However, consider adding validation to handle cases where the file is missing or empty.
Run this script to verify the image tag file exists and contains valid content:
✅ Verification successful
Image tag file exists and contains valid content
The file
packages/extra/monitoring/images/grafana.tag
exists and contains a properly formatted image reference with SHA256 digest, ensuring immutable deployments. No additional validation is required.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify Grafana image tag file exists and contains valid content TAG_FILE="packages/extra/monitoring/images/grafana.tag" if [ ! -f "$TAG_FILE" ]; then echo "Error: $TAG_FILE not found" exit 1 fi # Check if file is empty or contains only whitespace if ! grep -q '[^[:space:]]' "$TAG_FILE"; then echo "Error: $TAG_FILE is empty or contains only whitespace" exit 1 fi echo "Content of $TAG_FILE:" cat "$TAG_FILE"Length of output: 475
48-51
: Document plugin management changes and verify plugin availability.The shift from runtime to build-time plugin installation has several implications:
- Ensure all required plugins are included in the new image
- Document the list of pre-installed plugins
- Provide migration steps for custom plugins in existing deployments
Run this script to verify plugin configuration in the Dockerfile:
Consider adding documentation in the chart's README about:
- List of pre-installed plugins
- Process for adding custom plugins
- Migration guide for existing installations
✅ Verification successful
✓ Plugin installation properly configured in Dockerfile
The previously runtime-configured plugins (worldmap-panel, discrete-panel) are now pre-installed in the image using grafana-cli, and the custom plugin path is correctly set via GF_PATHS_PLUGINS.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify plugin installation configuration in Dockerfile # Check Dockerfile for plugin installation echo "Checking plugin installation in Dockerfile:" rg -A 5 'GF_PATHS_PLUGINS|grafana-plugins' packages/extra/monitoring/images/grafana/Dockerfile # List any references to removed plugins echo -e "\nChecking references to worldmap and discrete panel plugins:" rg 'grafana-worldmap-panel|natel-discrete-panel' packages/extra/monitoring/Length of output: 1344
Signed-off-by: Andrei Kvapil [email protected]
Summary by CodeRabbit
Release Notes
New Features
Improvements
Version Update