Skip to content

Fix silent connection errors in ConnectionContext with Micrometer alerting #35070

@freddyDOTCMS

Description

@freddyDOTCMS

Description

In ConnectionContext.close(), replace catch (Exception ignored) with a structured ERROR log entry and a Micrometer counter named analytics.connection.leak. This allows ops to alert on spikes in connection leaks rather than silently swallowing errors.

Improvement plan: https://docs.google.com/document/d/1hVfIurPqAJJ1PN1EalmvrWXnGNt5sY21MI-409lrXpU/edit?tab=t.klqavlz4cis7#heading=h.8vek9yxwq8yt

Parent epic: #35048

Acceptance Criteria

  • catch (Exception ignored) removed from ConnectionContext.close()
  • Replaced with a structured ERROR log entry (consistent with logging standard from Set up async structured JSON logging in analytics microservice #35056)
  • Micrometer counter analytics.connection.leak incremented on each caught exception
  • Counter is exposed via /actuator/metrics/analytics.connection.leak
  • Log entry includes enough context to identify the source (customerId, connection details if available)

Additional Context

  • Source task: Task 18 (Fix silent connection errors) from the improvement plan
  • Parallelizable after Phase 1 — blocked by: Refactor analytics service ingest code #35050
  • Related branch: issue-34849-Add-dotCMS-Analytics-Proxy-Endpoint-for-/v1/analytics/-to-dot-ca-event-manager

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions