Merge pull request #1182 from influxdata/hotfix/979-no-rp

Update schema exploration to support non-default rp
pull/1186/head
Chris Goller 2017-04-04 18:11:36 -05:00 committed by GitHub
commit 59281e2c1c
2 changed files with 6 additions and 3 deletions

View File

@ -12,6 +12,7 @@
1. [#1164](https://github.com/influxdata/chronograf/pull/1164): Restore ability to save raw queries to a Dashboard Cell 1. [#1164](https://github.com/influxdata/chronograf/pull/1164): Restore ability to save raw queries to a Dashboard Cell
1. [#1115](https://github.com/influxdata/chronograf/pull/1115): Fix Basepath issue where content would fail to render under certain circumstances 1. [#1115](https://github.com/influxdata/chronograf/pull/1115): Fix Basepath issue where content would fail to render under certain circumstances
1. [#1173](https://github.com/influxdata/chronograf/pull/1173): Fix saving email in Kapacitor alerts 1. [#1173](https://github.com/influxdata/chronograf/pull/1173): Fix saving email in Kapacitor alerts
1. [#979](https://github.com/influxdata/chronograf/issues/979): Fix empty tags for non-default retention policies
1. [#1179](https://github.com/influxdata/chronograf/pull/1179): Admin Databases Page will render a database without retention policies 1. [#1179](https://github.com/influxdata/chronograf/pull/1179): Admin Databases Page will render a database without retention policies
### Features ### Features

View File

@ -1,4 +1,5 @@
import AJAX from 'utils/ajax' import AJAX from 'utils/ajax'
import _ from 'lodash'
import {buildInfluxUrl, proxy} from 'utils/queryUrlGenerator' import {buildInfluxUrl, proxy} from 'utils/queryUrlGenerator'
export const showDatabases = async (source) => { export const showDatabases = async (source) => {
@ -36,14 +37,15 @@ export function showMeasurements(source, db) {
} }
export function showTagKeys({source, database, retentionPolicy, measurement}) { export function showTagKeys({source, database, retentionPolicy, measurement}) {
const query = `SHOW TAG KEYS FROM "${measurement}"` const rp = _.toString(retentionPolicy)
const query = `SHOW TAG KEYS FROM "${rp}"."${measurement}"`
return proxy({source, db: database, rp: retentionPolicy, query}) return proxy({source, db: database, rp: retentionPolicy, query})
} }
export function showTagValues({source, database, retentionPolicy, measurement, tagKeys}) { export function showTagValues({source, database, retentionPolicy, measurement, tagKeys}) {
const keys = tagKeys.sort().map((k) => `"${k}"`).join(', ') const keys = tagKeys.sort().map((k) => `"${k}"`).join(', ')
const query = `SHOW TAG VALUES FROM "${measurement}" WITH KEY IN (${keys})` const rp = _.toString(retentionPolicy)
const query = `SHOW TAG VALUES FROM "${rp}"."${measurement}" WITH KEY IN (${keys})`
return proxy({source, db: database, rp: retentionPolicy, query}) return proxy({source, db: database, rp: retentionPolicy, query})
} }