Skip to content

Use SdkClient for persistence in TransportGetMonitorAction - #2053

Merged
AWSHurneyt merged 2 commits into
opensearch-project:remote-metadata-supportfrom
manaswini1920:feature/sdk-persistence-refactor
Mar 26, 2026
Merged

Use SdkClient for persistence in TransportGetMonitorAction#2053
AWSHurneyt merged 2 commits into
opensearch-project:remote-metadata-supportfrom
manaswini1920:feature/sdk-persistence-refactor

Conversation

@manaswini1920

@manaswini1920 manaswini1920 commented Mar 25, 2026

Copy link
Copy Markdown
Collaborator

Description

Replace direct client.get() with sdkClient.getDataObjectAsync() for monitor retrieval.
SDK handles local vs remote routing internally based on remote_metadata_type setting.
Follows the same pattern as ML Commons (TransportRegisterAgentAction).

Reference: https://github.com/opensearch-project/ml-commons/blob/main/plugin/src/main/java/org/opensearch/ml/action/agents/TransportRegisterAgentAction.java

  • Add TENANT_ID_HEADER constant to AlertingPlugin
  • Use sdkClient for all persistence (no dual-path branching)
  • Extract tenantId from request header, pass to SDK
  • Add 3 unit tests

Related Issues

Depends on #2047, #2052
Part of #2094

Check List

  • New functionality includes testing.
  • Commits are signed per the DCO using --signoff.

@riysaxen-amzn
riysaxen-amzn self-requested a review March 25, 2026 19:35
@manaswini1920
manaswini1920 force-pushed the feature/sdk-persistence-refactor branch from 5656563 to 8d4bb0c Compare March 25, 2026 19:59
@manaswini1920 manaswini1920 changed the title feat(alerting): Refactor TransportGetMonitorAction to use SDK in remo… Use SdkClient for persistence in TransportGetMonitorAction Mar 25, 2026
@manaswini1920
manaswini1920 changed the base branch from main to remote-metadata-support March 25, 2026 22:10
Replace direct client.get() with sdkClient.getDataObjectAsync() for
monitor retrieval. SDK handles local vs remote routing internally.
Follows ML Commons pattern (TransportRegisterAgentAction).

Signed-off-by: Manaswini Ragamouni <ragamanu@amazon.com>
@manaswini1920
manaswini1920 force-pushed the feature/sdk-persistence-refactor branch from 8d4bb0c to 95a7bbe Compare March 26, 2026 05:27
Signed-off-by: Manaswini Ragamouni <ragamanu@amazon.com>
@AWSHurneyt
AWSHurneyt merged commit 9858daa into opensearch-project:remote-metadata-support Mar 26, 2026
18 checks passed
manaswini1920 pushed a commit to manaswini1920/alerting that referenced this pull request Apr 10, 2026
…etadata support

- Migrate TransportGetMonitorAction to use SdkClient (opensearch-project#2053)
- Migrate GetAlerts, DeleteComment, GetWorkflowAlerts, ExecuteMonitor to SdkClient (opensearch-project#2061)
- Fix listener leak in TransportExecuteMonitorAction for empty source (opensearch-project#2080)
- Migrate DeleteMonitor, GetDestinations, SearchAlertingComment, SearchMonitor to SdkClient (opensearch-project#2060)
- Migrate IndexAlertingComment, IndexMonitor to SdkClient (opensearch-project#2081)
- Migrate MonitorMetadataService to SdkClient (opensearch-project#2083)
- Add new query level trigger evaluation independent of ScriptingService (opensearch-project#2079, opensearch-project#2090)
- Migrate AlertService to SdkClient (opensearch-project#2088)
- Migrate TransportAcknowledgeAlertAction to SdkClient (opensearch-project#2089)

Signed-off-by: Manaswini Ragamouni <ragamanu@amazon.com>
AWSHurneyt pushed a commit that referenced this pull request Apr 10, 2026
…etadata support (#2093)

- Migrate TransportGetMonitorAction to use SdkClient (#2053)
- Migrate GetAlerts, DeleteComment, GetWorkflowAlerts, ExecuteMonitor to SdkClient (#2061)
- Fix listener leak in TransportExecuteMonitorAction for empty source (#2080)
- Migrate DeleteMonitor, GetDestinations, SearchAlertingComment, SearchMonitor to SdkClient (#2060)
- Migrate IndexAlertingComment, IndexMonitor to SdkClient (#2081)
- Migrate MonitorMetadataService to SdkClient (#2083)
- Add new query level trigger evaluation independent of ScriptingService (#2079, #2090)
- Migrate AlertService to SdkClient (#2088)
- Migrate TransportAcknowledgeAlertAction to SdkClient (#2089)

Signed-off-by: Manaswini Ragamouni <ragamanu@amazon.com>
Co-authored-by: Manaswini Ragamouni <ragamanu@amazon.com>
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.

5 participants