Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v10.3.x] Elasticsearch: Fix creating of legend so it is backward compatible with frontend produced frames #81786

Merged
merged 1 commit into from
Feb 2, 2024

Conversation

grafana-delivery-bot[bot]
Copy link
Contributor

Backport f2936d6 from #81708


During backend migration, we focused on making sure that legends generated on frontend and backend are the same. We were able to achieve this trough #66039, but unfortunately, this solution does not hold when it comes to using transformations - related to https://github.com/grafana/support-escalations/issues/8787. When transformations that rename fields are used, the renaming does not work because DisplayNameFromDS overwrites it.

So I was checking if there are other options and I was able to achieve the same frames naming using frame.Name and deleting labels for data.FrameTypeTimeSeriesMulti.

Here are comparisons on frame created in frontend (left) and backend (right) - both have the same name and no labels:

image

How to test:

  1. Run make devenv sources=elastic
  2. Run cd devenv and then ./setup.sh
    Go to http://localhost:3000/d/es_complex_template/datasource-tests-elasticsearch-complex-with-template-variables?orgId=1 and make sure that legends on frontend running queries and backend running queries are same (see the recording bellow).
    For now, ignore Multiple metrics and aggregations section which was skipped also in Elasticsearch: Fix legend generated on backend #66039 and it is not related to this change - it is related to label named metric. I will address this in separate PR.
esnamingfix.mp4

…th frontend produced frames (#81708)

* Elasticsearch: Fix creating of legend so it is backward compatible with frontend produced frames

* Update tests

(cherry picked from commit f2936d6)
@ivanahuckova ivanahuckova enabled auto-merge (squash) February 2, 2024 11:59
@ivanahuckova ivanahuckova merged commit f0778dd into v10.3.x Feb 2, 2024
22 checks passed
@ivanahuckova ivanahuckova deleted the backport-81708-to-v10.3.x branch February 2, 2024 12:00
@briangann briangann modified the milestones: 10.3.x, 10.3.3 Feb 2, 2024
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.

None yet

2 participants