influxdata / influxdata/influxdb
Graph doesn't show all tags, although Table does
- Dominant language
- Rust
- Stars
- 31.7k
- Forks
- 3.7k
- Avg merge
- 13h 37m
- Merged PRs (30d)
- 8
Description
Hi,
I'm using InfluxDB v. 2.0.4, and I have a use-case, where I'm reporting to InfluxDB how much time the performance test took during CI build, on different test platforms. So I have one field, with the time taken, and 5 tags. On the plot, I want to have a line for each test platform (stored in one tag), and when I hover the mouse on a given point, I want to see the values of 4 other tags (metadata like git branch, or project name).
So my query is:
```from(bucket: "perf")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["platform"] == "linux_x64" or r["platform"] == "win64" or r["platform"] == "test-dev")
|> filter(fn: (r) => r["_field"] == "time-taken")
|> group(columns: ["platform"])
|> aggregateWindow(every: v.windowPeriod, fn: last, createEmpty: false)
|> yield(name: "last")
```
__Note using "last" in aggregateWindow (with default setting "mean" this won't work).__ This gives the result I would expect to see on the Table view (all tags visible for every point):

But when I switch to Graph view, I see only the tags I grouped by (so only "platform"):

even though the query is the same, and "View Raw Data" shows that indeed all the tags are in the output of the query. The output I would like to see, is:

so all tags visible (git-branch, git-commit-id, git-tag, project, platform), not only the one I grouped by (platform). I took the screenshot by removing "group(columns: ["platform"])" from my query, but this is not the solution, as without grouping, I get a separate line on the graph (and a separate table on the Table view) for each unique tuple of all tags (git-branch, git-commit-id, git-tag, project, platform) which is not useful to me at all - as I would get ~50 plot lines instead ~5.
In other words, I have one "main" tag that I'm using in the query, and 4 others with some useful "metadata".
__Steps to reproduce:__
1. Write two points, each with one field and two tags, say "tagA", "tagB"
2. Create a query which groups by "tagA", and uses aggregate function "last"
3. Go to table view, see that both tagA and tagB are visible (also in View Raw Data)
4. Go to graph view, see that on the plot only tagA is visible for every data point
__Expected behavior:__
All tags are visible on Graph view, not only the ones I grouped by.
__Actual behavior:__
Only the tags I grouped by are visible.
__Environment info:__
* System info: Linux 4.15.0-139-generic x86_64 (official Docker image)
* InfluxDB version: InfluxDB 2.0.4 (git: 4e7a59bb9a) build_date: 2021-02-08T17:47:02Z
Contributor guide
Research direction
Reproduce the issue with two points carrying tagA and tagB, then run the grouped query using aggregateWindow with last. Compare Table view and Graph view, including View Raw Data. Done means Graph view displays all tags for each point while retaining one plot line per tagA value.
Written by the indexing model from the issue text.
Assessment
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100