[FEATURE] Add GreptimeDB datasource Plugin#629
Conversation
Signed-off-by: sun <[email protected]>
|
The CI workflow failure seems unrelated to the changes in this PR. |
Signed-off-by: sun <[email protected]>
Signed-off-by: sun <[email protected]>
Signed-off-by: sun <[email protected]>
Fixgeneration
|
Added |
|
Hi team, @jgbernalp we have addressed most review issues could you please check again. |
Signed-off-by: sun <[email protected]>
Signed-off-by: sun <[email protected]>
Signed-off-by: sun <[email protected]>
Signed-off-by: sun <[email protected]>
Signed-off-by: sun <[email protected]>
Signed-off-by: sun <[email protected]>
Signed-off-by: sun <[email protected]>
Signed-off-by: sun <[email protected]>
Signed-off-by: sun <[email protected]>
Signed-off-by: sun <[email protected]>
Signed-off-by: sun <[email protected]>
chore: plugin version
|
the CI error was caused by perses-dev peerDependencies upgration, should be fixed |
Code reviewFound 1 issue:
plugins/greptimedb/package.json Lines 44 to 85 in 21a1d26 The component exists but is dead code without proper wiring: plugins/greptimedb/src/explore/GreptimeDBTraceExplorer.tsx Lines 1 to 5 in 21a1d26 Reference: Tempo plugin's correct pattern: Lines 14 to 18 in 21a1d26 Lines 78 to 87 in 21a1d26 🤖 Generated with Claude Code |
yes, it is a knowned issue. |
|
@sunchanglong in that case, please remove the dead code and create an GitHub issue for later implementation |
Signed-off-by: sun <[email protected]>
feat: remove explorer
|
the dead code has been removed. |
| @@ -0,0 +1,32 @@ | |||
| module github.com/perses/plugins/greptimedb | |||
|
|
|||
| go 1.25.7 | |||
There was a problem hiding this comment.
| go 1.25.7 | |
| go 1.26.0 |
There was a problem hiding this comment.
the version was updated for previous review suggestion. the go version changed frequently.
| #kind: "GreptimeDBDatasource" | ||
|
|
||
| kind: #kind | ||
| spec: { |
There was a problem hiding this comment.
headers is missing from the spec. When using the proxy headers are included but this datasource uses them directly. Is there any reason to use them directly instead of using the Perses secrets via the proxy configuration? Plain credential storage should be avoided.
There was a problem hiding this comment.
it seems we don't have tests for this schema
There was a problem hiding this comment.
It seems we don't have tests for this schema
| }; | ||
|
|
||
| try { | ||
| const response = await fetch(url.toString(), init); |
There was a problem hiding this comment.
this fetch should be imported from @perses-dev/core
| try { | ||
| const response = await fetch(url.toString(), init); | ||
| if (!response.ok) { | ||
| const errorText = await response.text(); |
There was a problem hiding this comment.
We should check the content type as errors might come formatted in JSON and they will be hard to read from the UI if we just assume they are text, e.g.: https://github.com/perses/plugins/blob/main/loki/src/model/loki-client.ts#L88
| if (normalized.includes('second')) return String(BigInt(Math.trunc(raw)) * 1_000_000_000n); | ||
|
|
||
| if (raw > 1_000_000_000_000_000) return String(BigInt(Math.trunc(raw))); | ||
| if (raw > 1_000_000_000_000) return String(BigInt(Math.trunc(raw)) * 1_000_000n); |
There was a problem hiding this comment.
If dataType is undefined, I think we are missing the microsecond check here and they will fall into nanoseconds giving wrong timestamp results. Maybe this is right but the test needs to cover this case as well to make it clear?
Description
This pull request adds a new GreptimeDB plugin to the plugins repository so Perses can query and visualize metrics & logs data from GreptimeDB.
The implementation covers the main GreptimeDB query workflows used in Perses dashboards:
querying time series data from GreptimeDB based on panel time range
converting GreptimeDB responses into the data format expected by Perses panels, so charts and related visual components can consume results without additional handling
A few points worth calling out for review:
GreptimeDB response data is normalized and mapped into Perses-compatible series/frames, including timestamps, values, and label dimensions
plugin schemas, SDK integration helpers, datasource configuration, query editor support, and tests are included in the same change
only files required for the GreptimeDB plugin and workspace/plugin registration were touched
This change is intended to address GreptimeDB datasource support discussed in the linked issue and related follow-up conversations.
Screenshots
Checklist
[<catalog_entry>] <commit message>naming convention using one of thefollowing
catalog_entryvalues:FEATURE,ENHANCEMENT,BUGFIX,BREAKINGCHANGE,DOC,IGNORE.UI Changes