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

Support SHOW CARDINALITY #11476

Closed
hahnjo opened this Issue Apr 4, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@hahnjo
Contributor

hahnjo commented Apr 4, 2018

What Grafana version are you using?

5.0.4

What datasource are you using?

InfluxDB 1.4

What was the expected result?

I want to show series cardinality in a Singlestat panel, as introduced in InfluxDB 1.4:

SHOW TAG VALUES EXACT CARDINALITY FROM cpu WITH KEY = "host"

What happened instead?

Format as: Table


Message:

i.a.find(...) is undefined

Stack trace:

[1606]/m</e.prototype.setTableColumnToSensibleDefault@http://localhost:3000/public/build/0.2ba40e7163b7f9a6ed4b.js:7:293870
[1606]/m</e.prototype.tableHandler@http://localhost:3000/public/build/0.2ba40e7163b7f9a6ed4b.js:7:293571
[1606]/m</e.prototype.onDataReceived@http://localhost:3000/public/build/0.2ba40e7163b7f9a6ed4b.js:7:293040
o.prototype.emit@http://localhost:3000/public/build/vendor.2c3c591224fb193f7fd3.js:44:25316
a</e.prototype.emit@http://localhost:3000/public/build/app.a4b7f5a163ea89ff6420.js:1:13149
[1523]/f</e.prototype.handleQueryResult@http://localhost:3000/public/build/0.2ba40e7163b7f9a6ed4b.js:7:18119
u@http://localhost:3000/public/build/vendor.2c3c591224fb193f7fd3.js:92:69119
l/<@http://localhost:3000/public/build/vendor.2c3c591224fb193f7fd3.js:92:69565
$digest@http://localhost:3000/public/build/vendor.2c3c591224fb193f7fd3.js:92:75262
$apply@http://localhost:3000/public/build/vendor.2c3c591224fb193f7fd3.js:92:77074
A/s<@http://localhost:3000/public/build/vendor.2c3c591224fb193f7fd3.js:92:73133
i@http://localhost:3000/public/build/vendor.2c3c591224fb193f7fd3.js:92:21976
me/l.defer/n<@http://localhost:3000/public/build/vendor.2c3c591224fb193f7fd3.js:92:23440

Format as: Time series

N/A

Additional information

I think it's related to how the query returns the data. From Query Inspector:

{
  "xhrStatus": "complete",
  "request": {
    "method": "GET",
    "url": "api/datasources/proxy/4/query",
    "params": {
      "db": "cluster",
      "q": "SHOW TAG VALUES EXACT CARDINALITY FROM cpu WITH KEY = \"host\"",
      "epoch": "ms"
    },
    "data": null,
    "precision": "ms"
  },
  "response": {
    "results": [
      {
        "statement_id": 0,
        "series": [
          {
            "name": "cpu",
            "columns": [
              "count"
            ],
            "values": [
              [
                37
              ]
            ]
          }
        ]
      }
    ]
  }
}

-> There is only one column and I couldn't find an option to display a plain value.

@hahnjo

This comment has been minimized.

Show comment
Hide comment
@hahnjo

hahnjo Apr 5, 2018

Contributor

From experimenting with MySQL and selecting a single value there, Table seems to be right thing and gives me the expected Singlestat. I'll try to find out why it throws an error with InfluxDB.

Contributor

hahnjo commented Apr 5, 2018

From experimenting with MySQL and selecting a single value there, Table seems to be right thing and gives me the expected Singlestat. I'll try to find out why it throws an error with InfluxDB.

@bergquist bergquist closed this in #11504 Apr 19, 2018

bergquist added a commit that referenced this issue Apr 19, 2018

bergquist added a commit that referenced this issue Apr 19, 2018

Merge branch 'master' into 11392_whats_new_v51
* master:
  build: only lint the pkg folder
  changelog: adds note about closing #11476
  singlestat: Fix optimization in setTableColumnToSensibleDefault
  influxdb: Check before assuming first column to be 'time'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment