Skip to content

Conversation

@benc-uk
Copy link
Owner

@benc-uk benc-uk commented Sep 14, 2025

✨ Summary

This PR introduces a new monitor type that allows users to run Prometheus queries as health checks. The implementation includes backend support for executing PromQL queries, frontend UI updates to support the new monitor type, and database schema changes to accommodate Prometheus monitoring configuration.

🔧 Key Changes

  • deploy/kubernetes/postgres.yaml - Updated Kubernetes PostgreSQL deployment
  • frontend/src/components/MonitorIcon.tsx - Added icon support for Prometheus monitor type
  • frontend/src/index.css - Updated CSS styles for new monitor type
  • frontend/src/types.ts - Added TypeScript types for Prometheus monitoring
  • frontend/src/views/Edit.tsx - Updated edit view to support Prometheus monitor configuration
  • frontend/src/views/Monitor.tsx - Updated monitor view to display Prometheus monitoring details
  • services/common/monitor/ - Added new Prometheus query monitor implementation
  • services/common/result/result.go - Updated result handling for Prometheus queries
  • sql/init/nanomon_init.sql - Updated database schema for Prometheus monitoring

🌐 Backend/API

  • Added new prom_query.go and prometheus.go files implementing Prometheus query execution
  • Enhanced monitor factory to support Prometheus query monitor type
  • Updated result handling to accommodate Prometheus query responses
  • Added error handling for empty Prometheus query results and improved logging

📦 Build

  • Updated Dockerfile.database with new database configuration

🏗️ Infra & Deployment

  • Updated Kubernetes PostgreSQL deployment configuration
  • Database schema changes to support Prometheus monitor type

👁️ Frontend

  • Added Prometheus monitor icon and visual representation
  • Updated edit form to include Prometheus query configuration fields
  • Enhanced monitor detail view to display Prometheus-specific information
  • Added CSS styling for new monitor type elements

📝 Documentation

  • Updated README.md with comprehensive Prometheus monitor documentation
  • Added new monitor type "prometheus" to the supported monitor types list
  • Documented Prometheus query monitor configuration including:
    • Target URL format (e.g., http://prometheus-server:9090)
    • Required "query" property for PromQL expressions
    • Optional "timeout" property (defaults to 5s)
    • Available outputs: result_type, value, metric, prom_timestamp, result_count
    • Integration with existing rule evaluation system
  • Updated frontend documentation to reflect new Prometheus icon and UI elements
  • Clarified distinction between Prometheus metric export (existing) and Prometheus querying (new)

🆗 Impact

This change significantly expands the monitoring capabilities of Nanomon by allowing users to leverage existing Prometheus infrastructure for health checks. Users can now create monitors that execute PromQL queries and evaluate the results as pass/fail conditions. This integration enables more sophisticated monitoring scenarios and better integration with existing observability stacks. The changes are additive and should not impact existing monitor types or functionality.

…nd add error handling for empty Prometheus query results
- Bump versions of @azure/msal-browser, @azure/msal-react, FontAwesome, Bootstrap, React, and related packages in frontend/package.json.
- Update devDependencies including ESLint, TypeScript, and Vite to their latest versions.
- Add temporary override for MSAL compatibility with React 19.

chore: update Go module dependencies

- Upgrade Go version to 1.25.0 in go.mod.
- Update various dependencies including chi, prometheus/client_golang, and others to their latest versions.
- Adjust indirect dependencies accordingly.

docs: improve readme formatting

- Highlight default listening ports for API and frontend in readme.md.
- Fix formatting for source code links in readme.md.

chore: add initial package-lock.json

- Create package-lock.json for frontend dependencies.
@benc-uk benc-uk merged commit 4291266 into main Sep 27, 2025
5 checks passed
@benc-uk benc-uk deleted the prom-mon-type branch September 27, 2025 11:26
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