mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Tempo: Add new intrinsics (#77146)
This commit is contained in:
parent
03ca9c7c66
commit
44839a1bdd
@ -106,27 +106,79 @@ describe('generateQueryFromFilters generates the correct query for', () => {
|
|||||||
describe('gets correct tags', () => {
|
describe('gets correct tags', () => {
|
||||||
it('for filtered tags when no tags supplied', () => {
|
it('for filtered tags when no tags supplied', () => {
|
||||||
const tags = getFilteredTags(emptyTags, []);
|
const tags = getFilteredTags(emptyTags, []);
|
||||||
expect(tags).toEqual(['duration', 'kind', 'name', 'status']);
|
expect(tags).toEqual([
|
||||||
|
'duration',
|
||||||
|
'kind',
|
||||||
|
'name',
|
||||||
|
'rootName',
|
||||||
|
'rootServiceName',
|
||||||
|
'status',
|
||||||
|
'statusMessage',
|
||||||
|
'traceDuration',
|
||||||
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('for filtered tags when API v1 tags supplied', () => {
|
it('for filtered tags when API v1 tags supplied', () => {
|
||||||
const tags = getFilteredTags(v1Tags, []);
|
const tags = getFilteredTags(v1Tags, []);
|
||||||
expect(tags).toEqual(['duration', 'kind', 'name', 'status', 'bar', 'foo']);
|
expect(tags).toEqual([
|
||||||
|
'duration',
|
||||||
|
'kind',
|
||||||
|
'name',
|
||||||
|
'rootName',
|
||||||
|
'rootServiceName',
|
||||||
|
'status',
|
||||||
|
'statusMessage',
|
||||||
|
'traceDuration',
|
||||||
|
'bar',
|
||||||
|
'foo',
|
||||||
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('for filtered tags when API v1 tags supplied with tags to filter out', () => {
|
it('for filtered tags when API v1 tags supplied with tags to filter out', () => {
|
||||||
const tags = getFilteredTags(v1Tags, ['duration']);
|
const tags = getFilteredTags(v1Tags, ['duration']);
|
||||||
expect(tags).toEqual(['kind', 'name', 'status', 'bar', 'foo']);
|
expect(tags).toEqual([
|
||||||
|
'kind',
|
||||||
|
'name',
|
||||||
|
'rootName',
|
||||||
|
'rootServiceName',
|
||||||
|
'status',
|
||||||
|
'statusMessage',
|
||||||
|
'traceDuration',
|
||||||
|
'bar',
|
||||||
|
'foo',
|
||||||
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('for filtered tags when API v2 tags supplied', () => {
|
it('for filtered tags when API v2 tags supplied', () => {
|
||||||
const tags = getFilteredTags(uniq(getUnscopedTags(v2Tags)), []);
|
const tags = getFilteredTags(uniq(getUnscopedTags(v2Tags)), []);
|
||||||
expect(tags).toEqual(['duration', 'kind', 'name', 'status', 'cluster', 'container', 'db']);
|
expect(tags).toEqual([
|
||||||
|
'duration',
|
||||||
|
'kind',
|
||||||
|
'name',
|
||||||
|
'rootName',
|
||||||
|
'rootServiceName',
|
||||||
|
'status',
|
||||||
|
'statusMessage',
|
||||||
|
'traceDuration',
|
||||||
|
'cluster',
|
||||||
|
'container',
|
||||||
|
'db',
|
||||||
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('for filtered tags when API v2 tags supplied with tags to filter out', () => {
|
it('for filtered tags when API v2 tags supplied with tags to filter out', () => {
|
||||||
const tags = getFilteredTags(getUnscopedTags(v2Tags), ['duration', 'cluster']);
|
const tags = getFilteredTags(getUnscopedTags(v2Tags), ['duration', 'cluster']);
|
||||||
expect(tags).toEqual(['kind', 'name', 'status', 'container', 'db']);
|
expect(tags).toEqual([
|
||||||
|
'kind',
|
||||||
|
'name',
|
||||||
|
'rootName',
|
||||||
|
'rootServiceName',
|
||||||
|
'status',
|
||||||
|
'statusMessage',
|
||||||
|
'traceDuration',
|
||||||
|
'container',
|
||||||
|
'db',
|
||||||
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('for unscoped tags', () => {
|
it('for unscoped tags', () => {
|
||||||
|
@ -27,7 +27,16 @@ export const operators = ['=', '!=', '>', '<', '>=', '<=', '=~', '!~'];
|
|||||||
export const stringOperators = ['=', '!=', '=~', '!~'];
|
export const stringOperators = ['=', '!=', '=~', '!~'];
|
||||||
export const numberOperators = ['=', '!=', '>', '<', '>=', '<='];
|
export const numberOperators = ['=', '!=', '>', '<', '>=', '<='];
|
||||||
|
|
||||||
export const intrinsics = ['duration', 'kind', 'name', 'status'];
|
export const intrinsics = [
|
||||||
|
'duration',
|
||||||
|
'kind',
|
||||||
|
'name',
|
||||||
|
'rootName',
|
||||||
|
'rootServiceName',
|
||||||
|
'status',
|
||||||
|
'statusMessage',
|
||||||
|
'traceDuration',
|
||||||
|
];
|
||||||
export const scopes: string[] = ['resource', 'span'];
|
export const scopes: string[] = ['resource', 'span'];
|
||||||
|
|
||||||
export const functions = ['avg', 'min', 'max', 'sum', 'count', 'by'];
|
export const functions = ['avg', 'min', 'max', 'sum', 'count', 'by'];
|
||||||
|
Loading…
Reference in New Issue
Block a user