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

Setting of config.displayName appears to clash with Grafana handling of displayName #53

Open
svet-b opened this issue May 3, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@svet-b
Copy link

svet-b commented May 3, 2021

When multiple queries are used in a panel, and yield data series with the same name, Grafana normally takes care of this by appending "1", "2", "3", etc to the names. However, this does not appear to work correctly for data from the GraphQL data source. I've described the situation, and how to reproduce it, in this comment on a related (but now closed) Grafana issue: grafana/grafana#31104 (comment).

From what I can tell, this is due to the fact that config.displayName is set here: https://github.com/fifemon/graphql-datasource/blob/master/src/DataSource.ts#L207, while Grafana does not expect it to be set by the datasource. Other datasources do not appear to do things this way, so I suspect the implementation in the GraphQL datasource is somehow non-standard.

@svet-b
Copy link
Author

svet-b commented May 4, 2021

FWIW, this PR has some more details on what Grafana expects to receive - looks like there were some changes around v7.2: grafana/grafana#27186. In this context, config.displayNameFromDS may be the correct way to pass the label.

@retzkek
Copy link
Contributor

retzkek commented May 4, 2021

Thanks for digging into this issue. I agree that it does look like config.displayNameFromDS is the right field to set now.

@svet-b
Copy link
Author

svet-b commented May 4, 2021

Hm...unfortunately field.config.displayNameFromDS still appears to lead to the same issue. (tried it in this fork branch https://github.com/ammpio/graphql-datasource/tree/ammp_v1.3.0a). I guess it would be good get some input on best practices from the Grafana devs. My best guess is still field.name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants