-
Notifications
You must be signed in to change notification settings - Fork 100
[FEATURE] Initial Tempo Plugin #1561
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's an incredible work @zhuje. Thank you for doing it 🙏. That's awesome !!
Could you also add a doc about the Tempo datasource here: https://github.com/perses/perses/tree/main/docs/api/plugin ? Thanks ! |
Plugin includes: TraceQuery, TempoTraceQuery, TempoDatasource Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>
33059c0
to
fad6d91
Compare
@zhuje you have a conflict, would you mind to sync with the main branch please ? |
Plugin includes: TraceQuery, TempoTraceQuery, TempoDatasource Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>
I'll create a separate PR for this. |
…l '*' files within /ui to be a 'workspace'. -- TESTING to be squashed later. Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>
e26201c
to
9c09512
Compare
-- TEST to be squashed later Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>
696a5de
to
82b022a
Compare
Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>
…nt for dev purposes commit message to be squashed later Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>
030a413
to
8584533
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me !
Once the react tests are fixed, it will be good to merge on my side !
@sjcobb @nicolastakashi @jgbernalp @celian-garcia maybe you will have others things to say here :) |
ui/tempo-plugin/package.json
Outdated
{ | ||
"name": "@perses-dev/tempo-plugin", | ||
"version": "0.41.1", | ||
"description": "The plugin feature in Perses", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"description": "The plugin feature in Perses", | |
"description": "A Perses plugin to interact with Tempo traces", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do, good catch.
LGTM, just a minor suggestion |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great ! Thank you @zhuje! I wrote a few comments 👍
For everyone: What is the rule for the files extensions .ts vs .tsx. I think that some files have the .tsx extensio 57A6 n where they don't contain html. Is it a problem?
|
||
const getQueryType = useCallback( | ||
(pluginKind: string) => { | ||
if (isLoading) { | ||
return undefined; | ||
} | ||
if (isTraceQueryPluginLoading) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't you need to use there one or the other "isLoading" depending on the pluginKind ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. I'll make a switch statement to check which pluginKind
it is and return the corresponding isLoading
state. For example:
switch (pluginKind) {
case 'PrometheusTimeSeriesQuery':
return isTimeSeriesQueryLoading
case 'TempoTraceQuery':
return isTraceQueryPluginLoading
}
@@ -60,26 +60,37 @@ export function transformQueryResults(results: UseQueryResult[], definitions: Qu | |||
|
|||
export function useQueryType(): (pluginKind: string) => string | undefined { | |||
const { data: timeSeriesQueryPlugins, isLoading } = useListPluginMetadata('TimeSeriesQuery'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the readability, can we rename isLoading
to isTimeSeriesQueryLoading
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, makes sense.
Signed-off-by: Augustin Husson <augustin.husson@amadeus.com>
fix package-lock.json
I had the same question for ".ts vs .tsx". I found this answer on StackOverflow. Generally, I followed the format of the Prometheus plugin, so whatever extension they used for a particular component/file I also used. |
…oading status - Update description on Tempo plugin's package.json Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>
Resolve merge conflict in ui > core > src > model > index.ts by accepting both exports * from './http-proxy' and './kind' Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>
Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>
Awesome! Thank you for taking the time to fix everything @zhuje !! |
Description
This first iteration of the Tempo plugin creates a pluginType called
TraceQuery
and creates plugin kindsTempoTraceQuery
andTempoDatasource
. This PR does not include any UI changes that accommodate Tempo data. However, future enhancements should include data visualization (e.g. Scatterplot) for TempoTraceQueries and UI data source editing options for TempoDatasources.TempoDatasource
Currently, you can not add TempoDatasources via. the Perses UI. However, it can be created through the Perses API.
To demo the creation of a global TempoDatasource:
localhost:3200
./api/v1/globaldatasources
Figure 1. This figure shows the request and response from the Perses API when creating a global TempoDatasource.
Figure 2. The TempoDatasource is now listed as a global data source.
TempoTraceQuery
The following code block is a dashboard definition JSON example for a
TempoTraceQuery
. The client uses the Grafana Tempo endpoint, /api/search?fooParams to query traces. Thequery
must be written in Trace Query Language (TraceQL). For example"query": "{ duration > 900ms }"
.After the client makes the request, the response is stored in the
DataQueriesProvider
. Panels can then retrieve the data using the functionuseDataQueries()
e.g.const { queryResults: traceResults } = useDataQueries('TraceQuery');
) Currently, there are no panels that accommodate Tempo data, so there are no screenshots.Future Enhancements
Future enhancements should include a ScatterPlotPanel and TablePanel to display TempoTraceQuery results. Additionally, editing options will be added to the GlobalDatasource editing panels for TempoDatasources.
Screenshots
No UI Changes.
Checklist
[<catalog_entry>] <commit message>
naming convention using one of the followingcatalog_entry
values:FEATURE
,ENHANCEMENT
,BUGFIX
,BREAKINGCHANGE
,IGNORE
.UI Changes