forked from grafana/pyroscope
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use labels API when possible instead of Series (grafana/phlare#857)
* Use labels API when possible instead of Series * More cleanup * Uses only connect http API. * format * Correctly convert query to labels matcher * Removes todos * Fixes tenants tests * Fixes tenants tests * Fixes tenants tests * Fixes e2e tests
- Loading branch information
1 parent
de3a917
commit 1c5e5b1
Showing
7 changed files
with
236 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { queryToMatchers } from '@webapp/services/tags'; | ||
|
||
describe('queryToMatchers', () => { | ||
it('full query', () => { | ||
const query = | ||
'goroutine:goroutine:count:goroutine:count{service_name="cortex-dev-01/ruler", foo="bar"}'; | ||
const matchers = queryToMatchers(query); | ||
|
||
expect(matchers).toEqual([ | ||
'{__profile_type__="goroutine:goroutine:count:goroutine:count", service_name="cortex-dev-01/ruler", foo="bar"}', | ||
]); | ||
}); | ||
it('just profile type', () => { | ||
const query = 'goroutine:goroutine:count:goroutine:count'; | ||
const matchers = queryToMatchers(query); | ||
|
||
expect(matchers).toEqual([ | ||
'{__profile_type__="goroutine:goroutine:count:goroutine:count"}', | ||
]); | ||
}); | ||
|
||
it('just tags', () => { | ||
const query = '{service_name="cortex-dev-01/ruler", foo="bar"}'; | ||
const matchers = queryToMatchers(query); | ||
|
||
expect(matchers).toEqual([ | ||
'{service_name="cortex-dev-01/ruler", foo="bar"}', | ||
]); | ||
}); | ||
}); |
Oops, something went wrong.