Skip to content

Conversation

aknuds1
Copy link
Contributor

@aknuds1 aknuds1 commented Jun 30, 2025

Fix MetricNameEscapingScheme error messages in config.ScrapeConfig.Validate.

…ages

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR corrects the error messages in ScrapeConfig.Validate to reference the proper MetricNameEscapingScheme field and ensures the received value is quoted in the output.

  • Replace incorrect field references (MetricNameValidationScheme) with MetricNameEscapingScheme
  • Add single quotes around the “got” value in both error messages
Comments suppressed due to low confidence (2)

config/config.go:910

  • [nitpick] Consider aligning terminology with the field name by replacing "name escaping method" with "metric name escaping scheme" for consistency, e.g., unknown global metric name escaping scheme specified.
		return fmt.Errorf("unknown global name escaping method specified, must be one of '%s', '%s', '%s', or '%s', got '%s'", model.AllowUTF8, model.EscapeUnderscores, model.EscapeDots, model.EscapeValues, globalConfig.MetricNameEscapingScheme)

config/config.go:924

  • [nitpick] Similarly, update the message to reference "metric name escaping scheme" instead of "name escaping method" to keep terminology consistent with the configuration field.
		return fmt.Errorf("unknown scrape config name escaping method specified, must be one of '%s', '%s', '%s', or '%s', got '%s'", model.AllowUTF8, model.EscapeUnderscores, model.EscapeDots, model.EscapeValues, c.MetricNameEscapingScheme)

@aknuds1 aknuds1 requested a review from bboreham June 30, 2025 14:35
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
@aknuds1 aknuds1 enabled auto-merge (squash) June 30, 2025 14:48
@aknuds1 aknuds1 merged commit d902abc into prometheus:main Jun 30, 2025
27 checks passed
@aknuds1 aknuds1 deleted the arve/fix-validation branch June 30, 2025 16:39
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.

4 participants