Open
Conversation
…compliance Dashboard filenames with underscores (e.g., alerts_dashboard.json) were causing Kubernetes ConfigMap creation to fail because underscores violate RFC 1123 naming rules. This fix sanitizes dashboard names by replacing underscores with hyphens for Kubernetes resource names while preserving the original filename structure for Grafana UIDs and data keys. Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
…validation Improves dashboard ConfigMap naming to handle all RFC 1123 edge cases: 1. **Added sanitize_k8s_name() utility function** (lib.py): - Converts to lowercase - Replaces all non-alphanumeric chars (including underscores, dots) with hyphens - Collapses consecutive hyphens into single hyphen - Strips leading/trailing hyphens - Validates result matches RFC 1123 pattern: ^[a-z0-9]([a-z0-9-]*[a-z0-9])?$ 2. **Updated dashboard provisioning** (aws_eks_cluster.py): - Uses new sanitize_k8s_name() function instead of inline replace - Validation now catches invalid names before Kubernetes API errors 3. **Comprehensive test coverage** (test_lib.py, test_dashboard_configmaps.py): - 40+ unit tests for sanitization edge cases - Tests for leading/trailing special chars, uppercase, consecutive chars - Integration tests for ConfigMap structure and naming patterns - RFC 1123 pattern validation tests Fixes: dashboard names with underscores (alerts_dashboard.json) now correctly sanitize to Kubernetes-compliant names (grafana-alerts-dashboard-dashboard). Addresses review feedback: complete RFC 1123 sanitization, validation, and tests. Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
… dashboard Fixed the k8s-views-global dashboard to properly support multi-cluster deployments: - Enabled "All" cluster selection (includeAll: true) - Added default selection to "All" clusters - Changed all cluster query filters from exact match (=) to regex (=~) (59 occurrences) - Changed all job query filters from exact match (=) to regex (=~) (19 occurrences) - Fixed dashboard UID to use hyphens instead of underscores (k8s-views-global) This aligns with the multi-cluster pattern used in alerts_dashboard.json and enables users to view metrics across all clusters or select specific clusters. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…w dashboard Cleaned up unnecessary template variables and annotations that don't apply to PTD: - Removed datasource variable (now hardcoded to mimir for all queries) - Removed job variable (only had one entry, not useful) - Removed terraform and oncall annotation toggles (unused tags) - Updated all 87 datasource references to use "mimir" directly - Removed all 19 job filter references from queries This simplifies the dashboard configuration and removes controls that don't apply to PTD's infrastructure setup. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
… View Changed the default resolution from 30s to 1m to provide a better balance between query performance and data granularity. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Fixed ruff linter warnings: - B904: Use explicit exception chaining with 'from e' - TRY003/EM102: Assign error message to variable before raising - F841: Remove unused 'cluster_name' variable in test Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds some basic grafana dashboards and the pulumi code needed to deploy and manage them. For now, there are two dashboards included:
Category of change