Skip to content

Feature/ab#32049 prometheus#2419

Open
JamesPasta wants to merge 7 commits into
dev2from
feature/AB#32049-Promethious
Open

Feature/ab#32049 prometheus#2419
JamesPasta wants to merge 7 commits into
dev2from
feature/AB#32049-Promethious

Conversation

@JamesPasta
Copy link
Copy Markdown
Collaborator

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a 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 PR adds Prometheus-based monitoring and alerting support to the Unity GrantManager web app, including metrics exposure, exception/error counters, and an Alertmanager webhook endpoint that forwards alerts to Teams.

Changes:

  • Added Prometheus (/metrics) instrumentation and custom counters for exceptions and Serilog error-level logs.
  • Added an anonymous Alertmanager webhook API that summarizes firing alerts and posts them to Teams.
  • Added local (docker-compose) and OpenShift Prometheus/Alertmanager configuration manifests for scraping and alert rules.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
applications/Unity.GrantManager/src/Unity.GrantManager.Web/Unity.GrantManager.Web.csproj Adds Prometheus and OpenTelemetry NuGet dependencies.
applications/Unity.GrantManager/src/Unity.GrantManager.Web/Program.cs Configures OpenTelemetry instrumentation and wires Serilog sink + exception-counting middleware.
applications/Unity.GrantManager/src/Unity.GrantManager.Web/Middleware/ExceptionCounterMiddleware.cs New middleware to count exceptions and notify Teams on unhandled exceptions.
applications/Unity.GrantManager/src/Unity.GrantManager.Web/Middleware/ErrorCountingLoggerProvider.cs New Serilog sink that increments a Prometheus counter for error/critical logs.
applications/Unity.GrantManager/src/Unity.GrantManager.Web/GrantManagerWebModule.cs Exposes Prometheus HTTP metrics middleware and maps /metrics.
applications/Unity.GrantManager/src/Unity.GrantManager.Web/Controllers/Monitoring/AlertWebhookController.cs New Alertmanager webhook endpoint that forwards alert summaries to Teams.
applications/Unity.GrantManager/src/Unity.GrantManager.Web/Controllers/Monitoring/AlertPayload.cs Defines the Alertmanager webhook payload DTOs.
applications/Unity.GrantManager/scripts/prometheus/prometheus.yml Local Prometheus scrape config and alertmanager target configuration.
applications/Unity.GrantManager/scripts/prometheus/alertmanager.yml Local Alertmanager routing to the app webhook.
applications/Unity.GrantManager/scripts/prometheus/alert-rules.yml Local Prometheus alert rules for exception-rate detection.
applications/Unity.GrantManager/scripts/openshift/service-monitor.yaml ServiceMonitor CRD to scrape /metrics in OpenShift.
applications/Unity.GrantManager/scripts/openshift/prometheus-rule.yaml PrometheusRule CRD for exception alerts in OpenShift.
applications/Unity.GrantManager/scripts/openshift/alertmanager-config.yaml AlertmanagerConfig CRD routing cluster alerts to the app webhook.
applications/Unity.GrantManager/docker-compose.yml Adds local Prometheus and Alertmanager services for dev/test runs.

Comment thread applications/Unity.GrantManager/src/Unity.GrantManager.Web/Program.cs Outdated
Comment thread applications/Unity.GrantManager/scripts/prometheus/prometheus.yml Outdated
Comment thread applications/Unity.GrantManager/scripts/prometheus/alertmanager.yml Outdated
Comment thread applications/Unity.GrantManager/scripts/prometheus/alert-rules.yml Outdated
Comment thread applications/Unity.GrantManager/src/Unity.GrantManager.Web/Program.cs Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 16 changed files in this pull request and generated 7 comments.

Comment thread applications/Unity.GrantManager/src/Unity.GrantManager.Web/Program.cs Outdated
Comment on lines +14 to +18
[ApiController]
[Route("api/monitoring")]
[AllowAnonymous]
[IgnoreAntiforgeryToken]
public class AlertWebhookController(
Comment on lines +25 to +33
[HttpPost("alert")]
public async Task<IActionResult> ProcessAlert([FromBody] AlertManagerPayload? payload)
{
if (payload is null || !ModelState.IsValid || payload.Alerts.Count == 0)
{
return BadRequest();
}

try
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 16 changed files in this pull request and generated 11 comments.

Comment on lines +14 to +20
[ApiController]
[Route("api/monitoring")]
[AllowAnonymous]
[IgnoreAntiforgeryToken]
public class AlertWebhookController(
INotificationsAppService notificationsAppService,
ILogger<AlertWebhookController> logger) : AbpController
@JamesPasta JamesPasta changed the title Feature/ab#32049 promethious Feature/ab#32049 prometheous May 7, 2026
@JamesPasta JamesPasta changed the title Feature/ab#32049 prometheous Feature/ab#32049 prometheus May 7, 2026
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 7, 2026

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