Skip to content

feat(observability): add metrics_relabel_configs to scrape config - #1834

Open
ibrahimyesilay wants to merge 1 commit into
stackitcloud:mainfrom
ibrahimyesilay:feat/observability-scrapeconfig-relabel
Open

ibrahimyesilay wants to merge 1 commit into
stackitcloud:mainfrom
ibrahimyesilay:feat/observability-scrapeconfig-relabel

Conversation

@ibrahimyesilay

Copy link
Copy Markdown

Description

relates to #1832

Second part of #1832: adds metrics_relabel_configs to stackit_observability_scrapeconfig (resource and data source).

  • action (validated against the API enum), regex, replacement, separator and source_labels are optional + computed: the API fills in defaults for unset values (replace, .*, $1, ;), so without Computed every apply would end in an inconsistent result. No defaults are hard-coded in the provider.
  • target_label and modulus are optional; the API only returns them when set.
  • modulus is an int32 in the response but a float32 in the request payloads; the provider uses Int32 and 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

  • Unit tests for the mapping (including the empty case) and for the create/update payloads (unknown computed values are not sent).
  • TestAccResourceMin (observability) extended with two relabel rules — one fully specified, one with only source_labels and target_label to check the API defaults — on create, data source and update. Run against a STACKIT project: PASS.
  • make fmt, make lint, make test, make generate-docs pass locally.

Checklist

  • Issue was linked above
  • Code format was applied: make fmt
  • Examples were added / adjusted (see examples/ directory)
  • Docs are up-to-date: make generate-docs (will be checked by CI)
  • Unit tests got implemented or updated
  • Acceptance tests got implemented or updated (see e.g. here)
  • Unit tests are passing: make test (will be checked by CI)
  • No linter issues: make lint (will be checked by CI)

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

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant