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

Target alias #648

Merged
merged 2 commits into from
Jul 16, 2024
Merged

Target alias #648

merged 2 commits into from
Jul 16, 2024

Conversation

JaSei
Copy link
Contributor

@JaSei JaSei commented Feb 6, 2024

What does this do?

Some targets (Influx for example) use alias instead of legendFormat (which is Prometheus "alias"). This commit setup both of them by current legendFormat.

Why is it a good idea?

For Influxdb SqlTarget isn't now possible to set "alias" via Target. Of course is possible to use InfluxDBTarget (https://github.com/weaveworks/grafanalib/blob/main/grafanalib/influxdb.py) but there missing other options (like hide, because it's not child of Target). So I've chosen solution to extend Target to support all needed for my influx.

Context

Questions

If you don't like this solution, I see other solutions

  1. add new alias option - similar as Add support for alias expressions in data targets #285
  2. InfluxDBTarget class should be inherit from Target

…hich is Prometheus 'alias'). This commit setup both of them by legendFormat.
@JamesGibo JamesGibo merged commit 0b54201 into weaveworks:main Jul 16, 2024
5 checks passed
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