Skip to content

Add Target object for external data source support on Monitor and Alert models.#916

Merged
riysaxen-amzn merged 1 commit intoopensearch-project:mainfrom
manaswini1920:feature/workspace-datasource-fields
Mar 25, 2026
Merged

Add Target object for external data source support on Monitor and Alert models.#916
riysaxen-amzn merged 1 commit intoopensearch-project:mainfrom
manaswini1920:feature/workspace-datasource-fields

Conversation

@manaswini1920
Copy link
Contributor

@manaswini1920 manaswini1920 commented Mar 19, 2026

Description

Add Target object for external data source support on Monitor and Alert models.

  • New Target data class in common-utils with type (enum: LOCAL, AOSS_COLLECTION, AOS_DOMAIN) and endpoint (URL of remote collection/domain)
  • Monitor: added target: Target field (defaults to {type: LOCAL})
  • Alert: added target: Target? field, copied from parent Monitor at alert creation time across all 5 Monitor-taking constructors
  • All new fields are optional with defaults for backward compatibility
  • Target only serialized when non-LOCAL (conditional toXContent)
  • StreamInput/writeTo version-gated to V_3_6_0 for rolling upgrade safety
  • Includes TargetTests with 7 unit tests covering serialization, parsing, validation, and enum handling

Related Issues

Resolves

Testing

  • 7 new unit tests in TargetTests — default construction, AOSS/AOS targets, endpoint validation, stream roundtrip, XContent roundtrip, enum parsing
  • All existing tests pass — backward compatibility verified

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff.
  • Public documentation issue/PR created.

@eirsep
Copy link
Member

eirsep commented Mar 19, 2026

let's plz add UT coverage

@manaswini1920 manaswini1920 force-pushed the feature/workspace-datasource-fields branch from f432ddc to aa20a53 Compare March 24, 2026 00:57
@manaswini1920 manaswini1920 changed the title Add workspace_id, target_type, target_arn fields to Monitor and Alert… Add Target object for external data source support on Monitor and Alert models. Mar 24, 2026
@manaswini1920 manaswini1920 force-pushed the feature/workspace-datasource-fields branch 2 times, most recently from 298c17a to 3d1745e Compare March 24, 2026 03:02
Copy link
Collaborator

@engechas engechas left a comment

Choose a reason for hiding this comment

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

There's some inconsistency between the changes in the ser/de of the Alert/Monitor models. Wanted to ensure that is intentional

@manaswini1920 manaswini1920 force-pushed the feature/workspace-datasource-fields branch 2 times, most recently from 9276e02 to 8d09774 Compare March 24, 2026 17:25
engechas
engechas previously approved these changes Mar 24, 2026
Add Target data class (type + endpoint) to support external data source
targeting. Monitors can target LOCAL (default), AOSS_COLLECTION, or
AOS_DOMAIN endpoints. Target is copied from Monitor to Alert at alert
creation time to preserve data source context for dashboards.

Signed-off-by: Manaswini Ragamouni <ragamanu@amazon.com>
@riysaxen-amzn riysaxen-amzn merged commit eba8e70 into opensearch-project:main Mar 25, 2026
9 checks passed
manaswini1920 pushed a commit to manaswini1920/common-utils that referenced this pull request Mar 25, 2026
manaswini1920 pushed a commit to manaswini1920/common-utils that referenced this pull request Mar 25, 2026
… and Alert (opensearch-project#916)"

This reverts commit eba8e70.

Signed-off-by: Manaswini Ragamouni <ragamanu@amazon.com>
riysaxen-amzn pushed a commit that referenced this pull request Mar 25, 2026
… and Alert (#916)" (#917)

This reverts commit eba8e70.

Signed-off-by: Manaswini Ragamouni <ragamanu@amazon.com>
Co-authored-by: Manaswini Ragamouni <ragamanu@amazon.com>
manaswini1920 pushed a commit to manaswini1920/common-utils that referenced this pull request Mar 25, 2026
…r and Alert (opensearch-project#916)" (opensearch-project#917)

This reverts commit a4d2442.

Signed-off-by: Manaswini Ragamouni <ragamanu@amazon.com>
AWSHurneyt pushed a commit that referenced this pull request Mar 25, 2026
…r and Alert (#916)" (#917) (#918)

This reverts commit a4d2442.

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.

4 participants