Skip to content

Stop gateway outages from paging java-chat as failed - #167

Merged
WilliamAGH merged 2 commits into
mainfrom
dev
Aug 4, 2026
Merged

Stop gateway outages from paging java-chat as failed#167
WilliamAGH merged 2 commits into
mainfrom
dev

Conversation

@WilliamAGH

Copy link
Copy Markdown
Owner

Summary

  • fix(embeddings): keep the keep-alive failure escalation out of ERROREmbeddingModelKeepAlive logged ERROR on the second consecutive background probe failure. Every ERROR line feeds the critical java-chat-error-log Grafana alert, so a routine LLM gateway redeploy (minutes of 503s while the compose stack recreates) paged java-chat while the app kept serving. The escalation now logs WARN, matching the first failure and the slow-probe loop; health still flips DOWN immediately. Provider-health paging is owned by the dependencies health group (java-chat-dependencies-degraded) and the gateway's own availability rules.
  • fix(dev): drop DEBUG Spring MVC plumbing from the deployed dev log streamlogging.level.org.springframework.web=DEBUG shipped to Loki from dev.javachat.ai (~74k lines/24h, 99.5% framework plumbing), burying the EmbeddingModelKeepAlive events the java-chat Loki alert rules parse.

Pairs with WilliamAGH/grafana-config 2afc20a, which revived the silently-dead java-chat-error-log rule (its | json pipeline dropped every raw log line after the Alloy envelope unwrap).

Test plan

  • ./gradlew test for EmbeddingModelKeepAliveTest + EmbeddingModelKeepAliveSchedulerTest (8 tests, green; updated assertion expects WARN, zero ERROR)
  • JavaChatApplicationTests green
  • CI Build & Test workflow green on dev (push 599118c4), Coolify dev deploy finished and verified healthy

A background keep-alive probe failure is a monitoring signal, not a
user-facing request failure — the class doc already says so — yet the
second consecutive failure logged ERROR. Every ERROR line feeds the
critical java-chat-error-log Grafana alert, so a routine LLM gateway
redeploy (minutes of 503s while the compose stack recreates) paged
java-chat even though the app kept serving.

Provider-health paging is owned by the dependencies health group
(java-chat-dependencies-degraded) and the gateway's own availability
rules, so the repeated-failure escalation now logs WARN like the first
failure and the slow-probe loop. ERROR stays reserved for user-facing
failures. Health still flips DOWN immediately; only the log level moves.
…ream

dev.javachat.ai runs the dev profile, so logging.level.org.springframework.web=DEBUG
shipped to Loki: a 5,000-line 3h sample held ~4,975 framework request-plumbing
lines against 24 application lines (73,705 lines/24h vs production's 1,233),
burying the EmbeddingModelKeepAlive events the java-chat Loki alert rules parse.
Raise the level locally when debugging Spring MVC itself rather than for every
deployed request.
Copilot AI lite review requested due to automatic review settings August 4, 2026 17:14
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: db210cff-bb53-4c43-8a92-11310b1b3bb8

📥 Commits

Reviewing files that changed from the base of the PR and between 148bbcf and 599118c.

📒 Files selected for processing (3)
  • src/main/java/com/williamcallahan/javachat/service/EmbeddingModelKeepAlive.java
  • src/main/resources/application-dev.properties
  • src/test/java/com/williamcallahan/javachat/service/EmbeddingModelKeepAliveTest.java

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes

    • Repeated embedding service health-check failures are now reported as warnings instead of errors, reducing unnecessary high-severity alerts.
    • Health and availability monitoring continue to track repeated probe failures.
  • Documentation

    • Added guidance explaining repeated probe-failure logging and the impact of verbose web logging in development environments.

Walkthrough

Repeated embedding probe failures now log at WARN instead of ERROR. The related test checks the new event level. The development profile removes default Spring MVC DEBUG logging and documents a temporary command-line override.

Changes

Embedding probe logging

Layer / File(s) Summary
Repeated probe failure escalation
src/main/java/com/williamcallahan/javachat/service/EmbeddingModelKeepAlive.java, src/test/java/com/williamcallahan/javachat/service/EmbeddingModelKeepAliveTest.java
Repeated probe failures use WARN logging. The test verifies the WARN event and rejects a matching ERROR event.
Development logging configuration
src/main/resources/application-dev.properties
The profile retains application DEBUG logging, removes Spring MVC DEBUG logging, and documents a temporary override.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested labels: bug, java

Suggested reviewers: copilot

Poem

Probes may stumble, then gently warn,
No ERROR storm from dusk to morn.
Debug stays where app traces belong,
Spring MVC sleeps unless called along.
Tests keep the logging path strong.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: preventing gateway outages from triggering java-chat failure paging.
Description check ✅ Passed The description directly explains the logging changes, monitoring behavior, tests, and deployment validation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot added bug Something isn't working java Pull requests that update java code labels Aug 4, 2026

Copilot AI left a comment

Copy link
Copy Markdown

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 reduces noisy paging and log-volume in the dev deployment by (1) downgrading repeated background embedding keep-alive probe failures from ERROR to WARN (while still flipping actuator health to DOWN immediately), and (2) removing Spring MVC DEBUG logging from the dev profile so Loki/Grafana alerts and operational signals remain visible.

Changes:

  • Change repeated embedding probe failure “loop” escalation from ERRORWARN in EmbeddingModelKeepAlive.
  • Strengthen tests to assert zero ERROR logs for embedding_model_probe_* events and to expect WARN for the loop event.
  • Remove logging.level.org.springframework.web=DEBUG from application-dev.properties and add rationale comments.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/main/java/com/williamcallahan/javachat/service/EmbeddingModelKeepAlive.java Downgrades repeated probe failure escalation logging from ERROR to WARN and documents rationale.
src/test/java/com/williamcallahan/javachat/service/EmbeddingModelKeepAliveTest.java Updates assertions to match WARN escalation and ensures no probe events emit ERROR.
src/main/resources/application-dev.properties Stops shipping Spring MVC DEBUG logs in the dev profile and documents why.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +42 to +51
# More verbose logging for development.
#
# `dev` is also the profile the deployed dev.javachat.ai runs under, so anything set here ships
# to Loki. org.springframework.web at DEBUG was 99.5% of this service's log volume — a 5,000-line
# sample over 3h on 2026-08-04 held 1,991 DispatcherServlet + 1,990 HttpEntityMethodProcessor +
# 994 RequestResponseBodyMethodProcessor lines against 24 application lines, essentially all of it
# request plumbing for the 15s /actuator/prometheus scrape. It buried the signal that matters
# (EmbeddingModelKeepAlive, which the java-chat Loki alert rules parse) and cost 73,705 lines/24h
# against production's 1,233. Raise it locally when debugging Spring MVC itself, e.g.
# `--logging.level.org.springframework.web=DEBUG`, rather than for every deployed request.
Comment on lines +33 to +37
* <p>The escalation stays at WARN even when repeated: a background probe failure is a
* monitoring signal, never a user-facing request failure, and ERROR lines feed the
* critical java-chat-error-log Grafana alert. Provider-health paging is owned by the
* dependencies health group (java-chat-dependencies-degraded) and the gateway's own
* availability rules, so a routine gateway redeploy must not page here.</p>
@WilliamAGH
WilliamAGH merged commit 4f0e249 into main Aug 4, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working java Pull requests that update java code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants