Repository navigation
feat(observability): add metrics_relabel_configs to scrape config - #1834
Open
ibrahimyesilay wants to merge 1 commit into
Open
ibrahimyesilay wants to merge 1 commit into
ibrahimyesilay wants to merge 1 commit into
Conversation
Add `metrics_relabel_configs` to the observability scrape config resource and data source. `action`, `regex`, `replacement`, `separator` and `source_labels` are optional and computed, because the API fills in defaults for unset values (`replace`, `.*`, `$1`, `;`). relates to stackitcloud#1832
4 of 8 tasks
This branch has not been deployed
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.
Description
relates to #1832
Second part of #1832: adds
metrics_relabel_configstostackit_observability_scrapeconfig(resource and data source).action(validated against the API enum),regex,replacement,separatorandsource_labelsare optional + computed: the API fills in defaults for unset values (replace,.*,$1,;), so withoutComputedevery apply would end in an inconsistent result. No defaults are hard-coded in the provider.target_labelandmodulusare optional; the API only returns them when set.modulusis anint32in the response but afloat32in the request payloads; the provider usesInt32and converts when building the payload.This PR and #1833 both touch the scrape config resource and the observability acceptance test, so the second one to be merged will need a rebase — happy to do that.
Testing
TestAccResourceMin(observability) extended with two relabel rules — one fully specified, one with onlysource_labelsandtarget_labelto check the API defaults — on create, data source and update. Run against a STACKIT project: PASS.make fmt,make lint,make test,make generate-docspass locally.Checklist
make fmtexamples/directory)make generate-docs(will be checked by CI)make test(will be checked by CI)make lint(will be checked by CI)