WOOP-1151: Add workload_custom_metrics_data_source TF resource#669
Merged
damiankaminski merged 10 commits intomasterfrom Mar 30, 2026
Merged
WOOP-1151: Add workload_custom_metrics_data_source TF resource#669damiankaminski merged 10 commits intomasterfrom
damiankaminski merged 10 commits intomasterfrom
Conversation
Contributor
damiankaminski
commented
Mar 23, 2026
- Supports Prometheus data source type with presets (e.g. "jvm") and manual metric definitions
- Full CRUD operations using the WorkloadOptimizationAPI custom metrics endpoints
- Import support with format <cluster_id>/<data_source_id>
- Read uses List endpoint and filters by ID (no individual GET endpoint exists)
- Unit tests covering create (presets + manual metrics), read not-found, update, delete, and import
damiankaminski
commented
Mar 23, 2026
b1b0218 to
e611060
Compare
- Supports Prometheus data source type with presets (e.g. "jvm") and manual metric definitions - Full CRUD operations using the WorkloadOptimizationAPI custom metrics endpoints - Import support with format <cluster_id>/<data_source_id> - Read uses List endpoint and filters by ID (no individual GET endpoint exists)
478d4b7 to
e61bc26
Compare
Read manual metrics from the new `resolved` API field by filtering queries with MANUAL origin, instead of matching `resolved_metrics` against Terraform state. This fixes `terraform import` which previously lost all manual metrics because there was no prior state to compare against. Also updates the input field from `Custom` to `Manual` to match the renamed API field, and removes the now-unnecessary `getConfiguredManualMetrics` helper.
Aligns the Terraform schema with the CREATE/UPDATE API and CRD by using a single `query` field per metric block instead of a `queries` list. Multiple queries for the same metric are expressed as multiple metric entries with the same name.
… diffs The metric block used TypeList which is order-sensitive, causing Terraform to show false diffs when the API returned metrics in a different order than the config. Switching to TypeSet makes comparison order-agnostic by hashing on name+query content.
ZuzanaLietavcova
approved these changes
Mar 30, 2026
…theusConfig and add unit tests
This was referenced Mar 31, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.