Skip to content

Cloudprober external and browser probe don't properly parse label values with commas #951

Closed

Description

@sfc-gh-srhodes

Describe the bug

If a probe outputs a metric with a quoted label value containing a comma, Cloudprober doesn't properly parse it. foo{bar="baz,qux"} gets turned into foo{bar=""baz"}

https://prometheus.io/docs/concepts/data_model says Prometheus will tolerate any unicode characters in the value. Could we make cloudprober better-behaved here?

Cloudprober Version

v0.13.8

To Reproduce

Here's a minimal probe:

probe {
  name: "myprobe"
  type: EXTERNAL
  targets { host_names: "any" }
  external_probe {
    mode: ONCE
    command: "echo 'foo{bar=\"baz,qux\"}' 1"
  }
}

It shows up in /metrics as a malformed bar=""baz" metric.

# TYPE foo gauge
foo{bar=""baz",ptype="external",probe="myprobe",dst="any"} 1.000 1734659579901

Additional context

https://github.com/cloudprober/cloudprober/blob/v0.13.8/metrics/payload/line_metrics.go#L26 looks like the line parsing code causing the current behavior.

Activity

  1. added
    bug
    on Dec 20, 2024
  2. self-assigned this
    on Jan 7, 2025
  3. manugarg commented on Jan 7, 2025

    @manugarg
    Contributor

    Discussed this offline with @sfc-gh-srhodes. It's not high priority but it will be good to fix it.

  4. changed the title [-]Cloudprober external probe doesn't properly parse values with commas[/-] [+]Cloudprober external and browser probe doesn't properly parse label values with commas[/+] on Jan 25, 2025
  5. changed the title [-]Cloudprober external and browser probe doesn't properly parse label values with commas[/-] [+]Cloudprober external and browser probe don't properly parse label values with commas[/+] on Jan 25, 2025
  6. manugarg commented on Jan 26, 2025

    @manugarg
    Contributor

    #976 should fix it.

  7. added this to the v0.14.0 milestone on Jan 27, 2025
  8. manugarg commented on Jan 27, 2025

    @manugarg
    Contributor

    Fixed by #976 .

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

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions