Skip to content

Mimir integration#42

Draft
gsanchietti wants to merge 15 commits intomainfrom
mimir-integration
Draft

Mimir integration#42
gsanchietti wants to merge 15 commits intomainfrom
mimir-integration

Conversation

@gsanchietti
Copy link
Member

@gsanchietti gsanchietti commented Feb 20, 2026

📋 Description

This pull request introduces a complete proxy integration for Grafana Mimir, enabling secure, multi-tenant metrics and alerting management for each organization. It adds backend support for proxying all Mimir API calls (including Alertmanager), updates the API documentation, and provides user and developer documentation in both English and Italian. Additionally, it updates the CI workflow and NGINX configuration to support the new proxy endpoints.

Backend: Mimir Proxy Integration

  • Implements a generic reverse proxy handler (ProxyMimir in collect/methods/mimir.go) that authenticates systems, resolves their organization_id, injects the X-Scope-OrgID header, and forwards any HTTP method to the configured Mimir backend. This supports all Prometheus and Alertmanager APIs, ensuring requests are properly scoped per organization. [1] [2] [3] [4] [5]

API & Documentation Updates

  • Extends the OpenAPI specification to document the new /api/services/mimir/{path} endpoints, supporting GET, POST, PUT, and DELETE, with full details on authentication, multi-tenancy, and request/response formats. [1] [2]
  • Adds comprehensive user documentation for alerting and Alertmanager usage, including authentication, troubleshooting, and usage examples in both English and Italian (docs/en/08-alerting.md, docs/it/08-alerting.md). [1] [2]
  • Updates the documentation navigation and translation files to include the new Alerting documentation section. [1] [2]

Configuration & CI Enhancements

  • Adds Mimir backend configuration to collect/.env.example and loads it in the service configuration, defaulting to http://localhost:9009. [1] [2]
  • Updates the CI workflow to add an image description for the Mimir backend and injects this as a label in the container build process. [1] [2]

Infrastructure: NGINX Proxy

  • Adds an NGINX location block to forward /services/mimir/ requests to the collect service's Mimir proxy endpoint, ensuring proper routing and header forwarding for the new API.

Compression Handling

  • Adjusts the backend's gzip middleware to exclude Mimir proxy endpoints, preventing double-compression issues when proxying binary or already compressed data.

Related Issue: #[ISSUE_NUMBER]

🚀 Testing Environment

To trigger a fresh deployment of all services in the PR preview environment, comment:

update deploy

Automatic PR environments:

✅ Merge Checklist

Code Quality:

  • Backend Tests
  • Collect Tests
  • Sync Tests
  • Frontend Tests

Builds:

  • Backend Build
  • Collect Build
  • Sync Build
  • Frontend Build

@github-actions
Copy link
Contributor

🔗 Redirect URIs Added to Logto

The following redirect URIs have been automatically added to the Logto application configuration:

Redirect URIs:

  • https://my-frontend-qa-pr-42.onrender.com/login-redirect
  • https://my-proxy-qa-pr-42.onrender.com/login-redirect

Post-logout redirect URIs:

  • https://my-frontend-qa-pr-42.onrender.com/login
  • https://my-proxy-qa-pr-42.onrender.com/login

These will be automatically removed when the PR is closed or merged.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 20, 2026

🤖 My API structural change detected

Preview documentation

Structural change details

Added (10)

  • DELETE /api/alerting/config
  • DELETE /api/services/mimir/alertmanager/api/v2/silences/{silence_id}
  • GET /api/alerting/alerts
  • GET /api/alerting/config
  • GET /api/services/mimir/alertmanager/api/v2/alerts
  • GET /api/services/mimir/alertmanager/api/v2/silences
  • GET /api/services/mimir/alertmanager/api/v2/silences/{silence_id}
  • POST /api/alerting/config
  • POST /api/services/mimir/alertmanager/api/v2/alerts
  • POST /api/services/mimir/alertmanager/api/v2/silences
Powered by Bump.sh

@edospadoni edospadoni deployed to mimir-integration - my-mimir-qa PR #42 February 20, 2026 11:00 — with Render Active
@edospadoni edospadoni deployed to mimir-integration - my-mimir-qa PR #42 February 24, 2026 16:13 — with Render Active
@edospadoni edospadoni temporarily deployed to mimir-integration - my-collect-qa PR #42 February 24, 2026 16:13 — with Render Destroyed
@edospadoni edospadoni deployed to mimir-integration - my-mimir-qa PR #42 February 24, 2026 16:15 — with Render Active
@edospadoni edospadoni requested a deployment to mimir-integration - my-mimir-qa PR #42 February 24, 2026 16:38 — with Render In progress
@edospadoni edospadoni deployed to mimir-integration - my-mimir-qa PR #42 February 24, 2026 16:40 — with Render Active
@edospadoni edospadoni had a problem deploying to mimir-integration - my-mimir-qa PR #42 February 25, 2026 06:59 — with Render Failure
@gsanchietti
Copy link
Member Author

update deploy

@github-actions
Copy link
Contributor

🚀 Build triggers updated!

All .render-build-trigger files have been automatically updated to ensure fresh deployments of all services in the PR preview environment.

@gsanchietti
Copy link
Member Author

update deploy

gsanchietti and others added 13 commits February 26, 2026 12:56
- Add authenticated metrics proxy endpoint (ANY /api/mimir/*)
  - HTTP Basic Auth: system_key + system_secret (no JWT)
  - Adds X-Scope-OrgID = organization_id for multi-tenancy
- Add MIMIR_URL config field (default: http://localhost:9009)
- Update nginx to route /mimir/ -> backend
- Add mimir/docker-compose.yml for dedicated metrics VM (Server B)
- Add OpenAPI documentation for /api/mimir/{path} endpoint
- Add user documentation (EN+IT) and operator README

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- alert.py: push/resolve/silence/list alerts via collect Mimir proxy (HTTP Basic auth)
- alerting_config.py: manage alerting config via backend API (Logto OIDC auth)
- scripts/README.md: usage documentation for both scripts

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@edospadoni
Copy link
Member

update deploy

Auto-updated .render-build-trigger files to ensure all services
are deployed in PR preview environments.

🤖 Generated by GitHub Actions
@github-actions
Copy link
Contributor

🚀 Build triggers updated!

All .render-build-trigger files have been automatically updated to ensure fresh deployments of all services in the PR preview environment.

@edospadoni edospadoni deployed to mimir-integration - my-collect-qa PR #42 February 26, 2026 15:22 — with Render Active
@edospadoni edospadoni deployed to mimir-integration - my-mimir-qa PR #42 February 26, 2026 15:22 — with Render Active
@edospadoni edospadoni deployed to mimir-integration - my-backend-qa PR #42 February 26, 2026 15:23 — with Render Active
@edospadoni edospadoni deployed to mimir-integration - my-frontend-qa PR #42 February 26, 2026 15:23 — with Render Active
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