Skip to content

Conversation

@njshah301
Copy link
Collaborator

@njshah301 njshah301 commented Jan 6, 2026

This commit introduces a new backend endpoint at /_dr/task/triggerMosApiServiceState that initiates the process of fetching the latest service states for all TLDs from the MoSAPI endpoint and exporting them as metrics to Cloud Monitoring.

The key changes include:
- A new TriggerServiceStateAction class that handles the GET request to the new endpoint.
- Logic within MosApiStateService to concurrently fetch states for all configured TLDs.
- A new MosApiMetrics class (currently a placeholder) responsible for sending the collected states to the monitoring service.
- Unit tests for the new action and the updated service logic.

This endpoint will be called periodically to ensure that the MosApi service health metrics are kept up-to-date.


This change is Reviewable

 This commit introduces a new backend endpoint at `/_dr/task/triggerMosApiServiceState` that initiates the process of fetching the latest service states for all TLDs from the MoSAPI endpoint and exporting them as metrics to Cloud Monitoring.

  The key changes include:
   - A new `TriggerServiceStateAction` class that handles the GET request to the new endpoint.
     - Logic within `MosApiStateService` to concurrently fetch states for all configured TLDs.
     - A new `MosApiMetrics` class (currently a placeholder) responsible for sending the collected states to the monitoring service.
     - Unit tests for the new action and the updated service logic.

This endpoint will be called periodically to ensure that the MosApi service health metrics are kept up-to-date.
@njshah301 njshah301 force-pushed the njshah301/mosapi-trigger-service-monitoring-api branch from cc53a07 to a191394 Compare January 6, 2026 15:55
@njshah301 njshah301 requested review from CydeWeys and ptkach January 6, 2026 15:56
@njshah301 njshah301 enabled auto-merge January 6, 2026 18:03
@njshah301 njshah301 requested a review from gbrodman January 7, 2026 15:24
Copy link
Member

@CydeWeys CydeWeys left a comment

Choose a reason for hiding this comment

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

@CydeWeys made 1 comment.
Reviewable status: 0 of 7 files reviewed, 1 unresolved discussion (waiting on @gbrodman, @njshah301, and @ptkach).


core/src/main/java/google/registry/mosapi/TriggerServiceStateAction.java line 51 at r2 (raw file):

    response.setContentType(MediaType.PLAIN_TEXT_UTF_8);
    try {
      stateService.triggerMetricsForAllServiceStateSummaries();

It's often helpful to have a single INFO logging line in advance of doing all the work. Something like "Beginning fetch of MoSAPI metrics for all TLDs."

Copy link
Member

@CydeWeys CydeWeys left a comment

Choose a reason for hiding this comment

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

@CydeWeys reviewed 7 files and all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @gbrodman, @njshah301, and @ptkach).

@njshah301 njshah301 added this pull request to the merge queue Jan 7, 2026
Merged via the queue into google:master with commit 826ad85 Jan 7, 2026
9 of 10 checks passed
@njshah301 njshah301 deleted the njshah301/mosapi-trigger-service-monitoring-api branch January 7, 2026 20:10
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