Skip to content

Conversation

ywwg
Copy link
Member

@ywwg ywwg commented Feb 26, 2025

Global and Data Source configurations can still specify legacy mode, but Prometheus now requires that the overall validation mode be set to UTF-8.

@ywwg ywwg changed the title scraper: Remove support for global legacy validation mode scraper: Remove support for global legacy validation setting Feb 26, 2025
@ywwg ywwg marked this pull request as ready for review February 26, 2025 17:24
@ywwg ywwg force-pushed the owilliams/escapeconfig-00-cleanup branch from f628748 to bb1fe65 Compare February 26, 2025 17:24
Copy link
Member

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

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

Much cleaner, thanks!

@ywwg ywwg force-pushed the owilliams/escapeconfig-00-cleanup branch from e9e16f9 to db82701 Compare March 12, 2025 18:25
@ywwg ywwg requested a review from bwplotka March 12, 2025 18:26
Copy link
Member

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

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

Thanks! Lgtm

Nit: Consider changing PR title as it's bit wider that just scraper (or/and) commit title.

@ywwg ywwg changed the title scraper: Remove support for global legacy validation setting deps: Remove support for legacy global validation setting Mar 13, 2025
Global and Data Source configurations can specify legacy mode, but Prometheus now requires that the overall validation mode be set to UTF-8

Signed-off-by: Owen Williams <owen.williams@grafana.com>
@ywwg ywwg changed the title deps: Remove support for legacy global validation setting utf8: Remove support for legacy global validation setting Mar 13, 2025
@ywwg ywwg force-pushed the owilliams/escapeconfig-00-cleanup branch from db82701 to 94b43c5 Compare March 13, 2025 14:48
@bwplotka
Copy link
Member

=== NAME  TestInvalidFileUpdate
    file_test.go:414: 
        	Error Trace:	D:/a/prometheus/prometheus/discovery/file/file_test.go:107
        	            				D:/a/prometheus/prometheus/discovery/file/file_test.go:414
        	Error:      	Received unexpected error:
        	            	rename C:\Users\RUNNER~1\AppData\Local\Temp\TestInvalidFileUpdate1329895897\001\1399140205 C:\Users\RUNNER~1\AppData\Local\Temp\TestInvalidFileUpdate1329895897\001\valid.yml: Access is denied.
        	Test:       	TestInvalidFileUpdate
--- FAIL: TestInvalidFileUpdate (0.11s)
=== CONT  TestFileUpdate
=== NAME  TestRemoveFile
    file_test.go:482: update received after 102.0034ms
--- PASS: TestRemoveFile (0.21s)
=== NAME  TestNoopFileUpdate
    file_test.go:380: update received after 106.6192ms
--- PASS: TestNoopFileUpdate (0.21s)
=== NAME  TestFileUpdate
    file_test.go:397: 
        	Error Trace:	D:/a/prometheus/prometheus/discovery/file/file_test.go:90
        	            				D:/a/prometheus/prometheus/discovery/file/file_test.go:397
        	Error:      	Received unexpected error:
        	            	rename C:\Users\RUNNER~1\AppData\Local\Temp\TestFileUpdate742520923\001\2492825128 C:\Users\RUNNER~1\AppData\Local\Temp\TestFileUpdate742520923\001\valid.yml: Access is denied.
        	Test:       	TestFileUpdate
--- FAIL: TestFileUpdate (0.10s)

Windows is consistently failing so far...

@ywwg
Copy link
Member Author

ywwg commented Mar 13, 2025

Windows is consistently failing so far...

how did you find the error? the log is humongous and there are 100 instances of the word "error" and I couldn't find this

@ywwg
Copy link
Member Author

ywwg commented Mar 13, 2025

windows error appears on other PRs, merging anyway.

@ywwg
Copy link
Member Author

ywwg commented Mar 13, 2025

mmm after I check that the docs are still accurate

@ywwg ywwg merged commit 0bfbd46 into main Mar 13, 2025
43 of 45 checks passed
@ywwg ywwg deleted the owilliams/escapeconfig-00-cleanup branch March 13, 2025 18:21
@ywwg ywwg added the area/utf8 Issues pertaining to UTF-8 support label Mar 13, 2025
ywwg added a commit that referenced this pull request Mar 26, 2025
The new metric_name_escaping_scheme config option works in parallel with metric_name_validation_scheme and controls which escaping scheme is requested when scraping. When not specified, the scheme will request underscores if the validation scheme is set to legacy, and will request allow-utf-8 when the validation scheme is set to utf8. This setting allows users to allow utf8 names if they like, but explicitly request an escaping scheme rather than UTF-8.

Fixes #16034

Built on #16080

Signed-off-by: Owen Williams <owen.williams@grafana.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/utf8 Issues pertaining to UTF-8 support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants