Open blazej24 opened 3 years ago
@blazej24 thanks for the issue. This is the expected behavior.
The hover legend shows just the tags that are included in the group key in order to keep them legible. If you need to adjust the tags available in the hover legend, you can use another group function after the aggregate.
@russorat thanks for such a quick answer!
Unfortunately, this doesn't work. If I do two groups in a row in my query, it works the same way as if the first group was not there at all. Meaning, the result of this:
1 from(bucket: "sdk-perf")
2 |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
3 |> filter(fn: (r) => r["platform"] == "linux_x64" or r["platform"] == "mac_x64" or r["platform"] == "win64")
4 |> filter(fn: (r) => r["_field"] == "time-taken")
5 |> group(columns: ["platform"])
6 |> aggregateWindow(every: v.windowPeriod, fn: last, createEmpty: false)
7 |> group(columns: ["platform", "git-commit-id", "git-tag", "git-branch", "project"])
8 |> yield(name: "last")
and a version with line 5 removed (also a version with lines 6 and 7 swapped), works exactly the same - indeed I get all the tags I want on the hover legend, but also the query returns a separate table for each unique tuple of tags; instead of only for my one tag I want to really group by ("platform"). So again, I'm getting not connected points on the graph, instead a line for each platform.
"View raw data" and Table view confirm this - instead of Table 0, 1, 2 for my three build platforms, I'm getting a lot of tables; actually each data point gets it own table as "git-commit-id" is almost always unique (I know, that is bad for performance, but for our scale it's fine).
Have I misunderstood and you meant something else, or indeed it doesn't work?
@russorat Hi, I'm just checking if you got a chance to read my last reply; if not, could you please have a look? Thanks!
@blazej24 thanks for the reply.
I'm trying to use the same structure you have to illustrate this. For example, without any grouping in the query:
Next, i add the group by cpu, and aggregate window using last:
Notice i only have the column i am grouping by in my hover legend, even though the data that is returned has the host tag:
Finally i group by host, and i see the data has changed and the hover legend has updated to reflect that:
Changing the grouping does not change the data that is returned by the query (it still has both tags) but it informs how the data is visualized and what is shown in the legend.
The legend shows only the columns in the group key of the results. You can see that in the #group
line of the raw data view.
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:
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:
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: