Repository navigation
scrape-manager: add Prometheus YAML/JSON config parser and compliance tests - #60
Merged
Merged
Conversation
bwplotka
marked this pull request as ready for review
November 18, 2026 06:15
Member
Author
|
I think this is cool - ensuring 1:1 compat. WDYT @nicolastakashi @saswatamcode |
saswatamcode
approved these changes
Nov 18, 2026
saswatamcode
left a comment
Member
There was a problem hiding this comment.
LGTM, I think this is a good way to maintain compatibility
Extend sync_testdata.go to recursively copy prometheus/config/testdata into testdata/config and common/config/testdata into testdata/http_config, and extract upstream error and scrape config expectations from config_test.go, http_config_test.go, and tls_config_test.go into testdata/config_expected/expectations.json. Signed-off-by: Bartek Plotka <bwplotka@gmail.com>
Align RelabelError::InvalidRegex formatting with Go regexp.Compile ('error parsing regexp: ...'), reject explicit null relabel actions with 'relabel action cannot be empty', and accept scalar integer/float/boolean YAML values in Regexp::deserialize.
Signed-off-by: Bartek Plotka <bwplotka@gmail.com>
… tests Implement 1:1 Prometheus YAML and JSON configuration parsing and validation across http_config, discovery (static_configs and 36 *_sd_configs), and top-level config (global, runtime, rule_files, scrape_config_files, scrape_configs, alerting, storage, tracing, remote_write, remote_read, otlp, and generate_checksum), verified against all synced upstream testdata fixtures. Signed-off-by: Bartek Plotka <bwplotka@gmail.com>
bwplotka
force-pushed
the
bwplotka/yaml-config
branch
from
November 19, 2026 05:50
524d7ee to
4a0c5b3
Compare
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.
Extends
tests/go-harnessto syncprometheus/prometheus/config/testdataandprometheus/common/config/testdatafixtures and upstream test tables (expectedErrors,TestGetScrapeConfigs,TestValidationSettings,TestEscapingSettings,invalidHTTPClientConfigs,validTLSConfigs, andinvalidTLSConfigs), and adds a 1:1 Prometheus YAML/JSON configuration parser and validator inprometheus-scrape-manager.Commits in order:
f1c2696tests/go-harness: sync prometheus and common YAML/JSON config testdata— syncstestdata/config/(218 files),testdata/http_config/(51 files), and AST-extracted test expectation tables intestdata/config_expected/expectations.json.e8bb17arelabel: match Prometheus YAML error messages and scalar regex parsing— alignsRelabelError::InvalidRegex, explicitaction: null, and scalar YAML regex unmarshaling withprometheus/prometheus/model/relabel.524d7eescrape-manager: add Prometheus YAML/JSON config parser and compliance tests— implementshttp_config,discovery(all 36*_sd_configs),config, and theconfig_compliancetest suite.Compliance test coverage
expectedErrorsbad config cases fromprometheus/config/config_test.go..good.yml/.good.yamlPrometheus configuration fixtures intestdata/config/.conf.good.ymlfield assertions and<secret>redaction parity (29redacted occurrences, zero leaked secrets).roundtrip.good.ymlload -> serialize -> reload ->set_directorystructural equality.external_labels.good.yml${VAR}and$VARexpansion with--enable-feature=expand-external-labels.TestGetScrapeConfigsglobbing, inheritance, protocol, and duplicate job name cases.TestValidationSettingsandTestEscapingSettingscases (utf8vslegacyvalidation andallow-utf-8,underscores,dots,valuesescaping).agent_mode.*.yml), OTLP translation/resource attribute validation (otlp_*.yml), runtime/TSDB config validation, andgenerate_checksumoverrule_filesandscrape_config_files.invalidHTTPClientConfigs, 10validTLSConfigs, andinvalidTLSConfigsfromprometheus/common/config.