Skip to content

[BUGFIX] prometheus: check for length of filters before adding braces#611

Open
coleenquadros wants to merge 3 commits intoperses:mainfrom
coleenquadros:check_len_filter
Open

[BUGFIX] prometheus: check for length of filters before adding braces#611
coleenquadros wants to merge 3 commits intoperses:mainfrom
coleenquadros:check_len_filter

Conversation

@coleenquadros
Copy link
Contributor

@coleenquadros coleenquadros commented Mar 23, 2026

Description

When metadata is used as a label matcher, it gets interpreted as a timeseries and does not return data since we dont add label matchers when defining the variable and forces the braces {} in the query.

      - kind: ListVariable
        spec:
          allowAllValue: false
          allowMultiple: false
          defaultValue: cloud
          display:
            hidden: false
            name: Label
          name: xyz_label_names
          plugin:
            kind: PrometheusLabelValuesVariable
            spec:
              datasource:
                kind: PrometheusDatasource
                name: rbac-query-proxy-datasource
              labelName: label_name
              matchers:
                - xyz_label_names{} >>> returns no data because of the braces
		dashboard.AddVariable("xyz_label_names",
			listVar.List(
				labelValuesVar.PrometheusLabelValues("label_name",
					dashboards.AddVariableDatasource(datasource),
					labelValuesVar.Matchers("xyz_label_names"),
				),
				listVar.DisplayName("Label"),
				listVar.DefaultValue("name"),
				listVar.AllowAllValue(false),
				listVar.AllowMultiple(false),
		

Checklist

  • Pull request has a descriptive title and context useful to a reviewer.
  • Pull request title follows the [<catalog_entry>] <commit message> naming convention using one of the
    following catalog_entry values: FEATURE, ENHANCEMENT, BUGFIX, BREAKINGCHANGE, DOC,IGNORE.
  • All commits have DCO signoffs.

@coleenquadros coleenquadros requested a review from Nexucis as a code owner March 23, 2026 15:31
@AntoineThebaud
Copy link
Contributor

Hello @coleenquadros can you add some context for this change in PR description please? Also the second commit doesn't seem related at all

@AntoineThebaud
Copy link
Contributor

Could you move the changes related to the PieChart Go SDK to a separate PR please?

Signed-off-by: Coleen Iona Quadros <coleen.quadros27@gmail.com>
Signed-off-by: Coleen Iona Quadros <coleen.quadros27@gmail.com>
This reverts commit cd6e479.

Signed-off-by: Coleen Iona Quadros <coleen.quadros27@gmail.com>
@AntoineThebaud
Copy link
Contributor

AntoineThebaud commented Mar 26, 2026

Sorry I don't understand the issue you are trying to fix. The fact labelValuesVar.Matchers("xyz_label_names") generates the matcher xyz_label_names{} with empty braces is not a problem, in promQL querying metric_name is fully equivalent as querying metric_name{}. Just in case I checked if there could be any bug with the interpretation of empty braces on perses side & even the specific Prometheus API we use here but it's working as expected.

Thus please precise

  • what payload you are submitting,
  • what result you are currently getting,
  • and what you would expect to have instead and why?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants