Explore: Enable click on name label

- click on the name label in a prometheus table was disabled
- it was disabled because every query used to have a metric which is no
longer true
- this change enables it
This commit is contained in:
David Kaltschmidt
2019-02-26 14:21:46 -08:00
parent c04395ce3a
commit 539333bb01
2 changed files with 4 additions and 3 deletions

View File

@@ -100,7 +100,7 @@ export class ResultTransformer {
table.columns.push({ text: 'Time', type: 'time' });
_.each(sortedLabels, (label, labelIndex) => {
metricLabels[label] = labelIndex + 1;
table.columns.push({ text: label, filterable: !label.startsWith('__') });
table.columns.push({ text: label, filterable: true });
});
const valueText = resultCount > 1 || valueWithRefId ? `Value #${refId}` : 'Value';
table.columns.push({ text: valueText });

View File

@@ -66,11 +66,12 @@ describe('Prometheus Result Transformer', () => {
]);
expect(table.columns).toMatchObject([
{ text: 'Time', type: 'time' },
{ text: '__name__' },
{ text: 'instance' },
{ text: '__name__', filterable: true },
{ text: 'instance', filterable: true },
{ text: 'job' },
{ text: 'Value' },
]);
expect(table.columns[4].filterable).toBeUndefined();
});
it('should column title include refId if response count is more than 2', () => {