-
Notifications
You must be signed in to change notification settings - Fork 42
[FEATURE] Add LogExplorer plugin #577
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
Open
rickardsjp
wants to merge
18
commits into
perses:main
Choose a base branch
from
rickardsjp:logexplorer
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
2398fa5
`percli plugin generate`
rickardsjp 8531e2d
fix prettier
rickardsjp 8fd2467
Add meta fields to `package.json`
rickardsjp 9e06072
Add placeholder to LogExplorer
rickardsjp 4b35c58
bump perses version to the current beta release
rickardsjp 82587f6
Bring rsbuild config in line with Prometheus plugin
rickardsjp 3de4d70
make plugin a workspace of the monorepo
rickardsjp 414acea
Add a logstable-based explorer
rickardsjp 731531d
Add query params to URL in LogExplorer
rickardsjp a85b6a0
Update versions and module org
rickardsjp 459eb87
Add VolumeHistogramPanel and volume query generation (+ plugin interf…
rickardsjp 21872e7
Add createVolumeQuery for Loki
rickardsjp 6727676
Add createVolumeQuery stub for ClickHouse
rickardsjp 0709a61
Add VictoriaLogs volume query and remove __name__ histogram label
rickardsjp 78a90b8
Add license headers
rickardsjp 15bbe5b
Add `passWithNoTests` to the `test` command.
rickardsjp 69ef4f8
Remove unneeded Go files from the plugin generation
rickardsjp caed0a6
Remove unused CUE dependencies from logexplorer
rickardsjp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,20 @@ | ||
| { | ||
| "$schema": "https://json.schemastore.org/swcrc", | ||
| "jsc": { | ||
| "parser": { | ||
| "syntax": "typescript", | ||
| "tsx": true | ||
| }, | ||
| "target": "es2022", | ||
| "transform": { | ||
| "react": { | ||
| "runtime": "automatic", | ||
| "useBuiltins": true | ||
| } | ||
| } | ||
| }, | ||
| "module": { | ||
| "type": "commonjs" | ||
| }, | ||
| "exclude": ["\\.(stories|test)\\."] | ||
| } |
This file contains hidden or 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,21 @@ | ||
| .idea/ | ||
|
|
||
| # Local | ||
| .DS_Store | ||
| *.local | ||
| *.log* | ||
|
|
||
| # Dist | ||
| node_modules | ||
| dist/ | ||
|
|
||
| # IDE | ||
| .vscode/* | ||
| !.vscode/extensions.json | ||
| .idea | ||
|
|
||
| # generated archives | ||
| *.tar.gz | ||
|
|
||
| # external CUE dependencies | ||
| /*/cue.mod/pkg/ |
This file contains hidden or 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,21 @@ | ||
| { | ||
| "$schema": "https://json.schemastore.org/swcrc", | ||
| "jsc": { | ||
| "parser": { | ||
| "syntax": "typescript", | ||
| "tsx": true | ||
| }, | ||
| "target": "es2022", | ||
| "transform": { | ||
| "react": { | ||
| "runtime": "automatic", | ||
| "useBuiltins": true | ||
| } | ||
| } | ||
| }, | ||
| "module": { | ||
| "type": "es6" | ||
| }, | ||
| "sourceMaps": true, | ||
| "exclude": ["\\.(stories|test)\\."] | ||
| } |
This file contains hidden or 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,41 @@ | ||
| # Plugin Module: log-explorer | ||
|
|
||
| ### How to install | ||
|
|
||
| This plugin requires react and react-dom 18 | ||
|
|
||
| Install peer dependencies: | ||
|
|
||
| ```bash | ||
| npm install react@18 react-dom@18 | ||
| ``` | ||
|
|
||
| Install the plugin: | ||
|
|
||
| ```bash | ||
| npm install @my-org/log-explorer | ||
| ``` | ||
|
|
||
| ## Development | ||
|
|
||
| ### Setup | ||
|
|
||
| Install dependencies: | ||
|
|
||
| ```bash | ||
| npm install | ||
| ``` | ||
|
|
||
| ### Get Started | ||
|
|
||
| Start the dev server: | ||
|
|
||
| ```bash | ||
| npm run dev | ||
| ``` | ||
|
|
||
| Build the plugin for distribution: | ||
|
|
||
| ```bash | ||
| npm run build | ||
| ``` |
This file contains hidden or 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,7 @@ | ||
| module: "github.com/perses-dev/log-explorer@v0" | ||
| language: { | ||
| version: "v0.12.0" | ||
| } | ||
| source: { | ||
| kind: "git" | ||
| } |
This file contains hidden or 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,26 @@ | ||
| // Copyright The Perses Authors | ||
| // Licensed under the Apache License, Version 2.0 (the \"License\"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an \"AS IS\" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
|
|
||
| import type { Config } from "@jest/types"; | ||
| import shared from "../jest.shared"; | ||
|
|
||
| const jestConfig: Config.InitialOptions = { | ||
| ...shared, | ||
|
|
||
| setupFilesAfterEnv: [ | ||
| ...(shared.setupFilesAfterEnv ?? []), | ||
| "<rootDir>/src/setup-tests.ts", | ||
| ], | ||
| }; | ||
|
|
||
| export default jestConfig; |
This file contains hidden or 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,72 @@ | ||
| { | ||
| "name": "@perses-dev/log-explorer", | ||
| "version": "0.1.0", | ||
| "homepage": "https://github.com/perses/plugins/blob/main/README.md", | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/perses/plugins.git" | ||
| }, | ||
| "bugs": { | ||
| "url": "https://github.com/perses/plugins/issues" | ||
| }, | ||
| "scripts": { | ||
| "dev": "rsbuild dev", | ||
| "build": "npm run build-mf && concurrently \"npm:build:*\"", | ||
| "build-mf": "rsbuild build", | ||
| "build:cjs": "swc ./src -d dist/lib/cjs --strip-leading-paths --config-file .cjs.swcrc", | ||
| "build:esm": "swc ./src -d dist/lib --strip-leading-paths --config-file .swcrc", | ||
| "build:types": "tsc --project tsconfig.build.json", | ||
| "lint": "eslint src --ext .ts,.tsx", | ||
| "test": "cross-env LC_ALL=C TZ=UTC jest --passWithNoTests", | ||
| "type-check": "tsc --noEmit" | ||
| }, | ||
| "main": "lib/cjs/index.js", | ||
| "module": "lib/index.js", | ||
| "types": "lib/index.d.ts", | ||
| "devDependencies": { | ||
| "@types/qs": "^6.9.18" | ||
| }, | ||
| "peerDependencies": { | ||
| "@emotion/react": "^11.7.1", | ||
| "@emotion/styled": "^11.6.0", | ||
| "@hookform/resolvers": "^3.2.0", | ||
| "@perses-dev/components": "^0.53.0-rc.2", | ||
| "@perses-dev/core": "^0.53.0-rc.0", | ||
| "@perses-dev/dashboards": "^0.53.0-rc.2", | ||
| "@perses-dev/explore": "^0.53.0-rc.2", | ||
| "@perses-dev/plugin-system": "^0.53.0-rc.2", | ||
| "@tanstack/react-query": "^4.39.1", | ||
| "date-fns": "^4.1.0", | ||
| "date-fns-tz": "^3.2.0", | ||
| "echarts": "5.5.0", | ||
| "immer": "^10.1.1", | ||
| "lodash": "^4.17.21", | ||
| "react": "^17.0.2 || ^18.0.0", | ||
| "react-dom": "^17.0.2 || ^18.0.0", | ||
| "react-hook-form": "^7.52.2", | ||
| "react-router-dom": "^5 || ^6 || ^7", | ||
| "use-resize-observer": "^9.0.0" | ||
| }, | ||
| "files": [ | ||
| "lib/**/*", | ||
| "__mf/**/*", | ||
| "mf-manifest.json", | ||
| "mf-stats.json" | ||
| ], | ||
| "perses": { | ||
| "moduleName": "LogExplorer", | ||
| "moduleOrg": "perses.dev", | ||
| "schemasPath": "schemas", | ||
| "plugins": [ | ||
| { | ||
| "kind": "Explore", | ||
| "spec": { | ||
| "display": { | ||
| "name": "Log Explorer" | ||
| }, | ||
| "name": "LogExplorer" | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| } |
This file contains hidden or 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,46 @@ | ||
| // Copyright The Perses Authors | ||
| // Licensed under the Apache License, Version 2.0 (the \"License\"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an \"AS IS\" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
|
|
||
| import { pluginReact } from '@rsbuild/plugin-react'; | ||
| import { createConfigForPlugin } from '../rsbuild.shared'; | ||
|
|
||
| export default createConfigForPlugin({ | ||
| name: 'LogExplorer', | ||
| rsbuildConfig: { | ||
| server: { port: 3009 }, | ||
| plugins: [pluginReact()], | ||
| }, | ||
| moduleFederation: { | ||
| exposes: { | ||
| './LogExplorer': './src/explore/log-explorer', | ||
| }, | ||
| shared: { | ||
| react: { requiredVersion: '18.2.0', singleton: true }, | ||
| 'react-dom': { requiredVersion: '18.2.0', singleton: true }, | ||
| echarts: { singleton: true }, | ||
| 'date-fns': { singleton: true }, | ||
| 'date-fns-tz': { singleton: true }, | ||
| lodash: { singleton: true }, | ||
| '@perses-dev/components': { singleton: true }, | ||
| '@perses-dev/plugin-system': { singleton: true }, | ||
| '@perses-dev/explore': { singleton: true }, | ||
| '@perses-dev/dashboards': { singleton: true }, | ||
| '@emotion/react': { requiredVersion: '^11.11.3', singleton: true }, | ||
| '@emotion/styled': { singleton: true }, | ||
| '@hookform/resolvers': { singleton: true }, | ||
| '@tanstack/react-query': { singleton: true }, | ||
| 'react-hook-form': { singleton: true }, | ||
| 'react-router-dom': { singleton: true }, | ||
| }, | ||
| }, | ||
| }); |
This file contains hidden or 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,18 @@ | ||
| // Copyright The Perses Authors | ||
| // Licensed under the Apache License, Version 2.0 (the \"License\"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an \"AS IS\" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
|
|
||
| import React from 'react'; | ||
| import ReactDOM from 'react-dom/client'; | ||
|
|
||
| const root = ReactDOM.createRoot(document.getElementById('root')!); | ||
| root.render(<React.StrictMode></React.StrictMode>); |
This file contains hidden or 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,14 @@ | ||
| // Copyright The Perses Authors | ||
| // Licensed under the Apache License, Version 2.0 (the \"License\"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an \"AS IS\" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
|
|
||
| /// <reference types="@rsbuild/core/types" /> |
This file contains hidden or 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,14 @@ | ||
| // Copyright The Perses Authors | ||
| // Licensed under the Apache License, Version 2.0 (the \"License\"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an \"AS IS\" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
|
|
||
| export * from './log-explorer'; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
I think it will need to be added
LogQueryPlugininterface too, so it's easier to use it everywhere and future Log plugins, know it's existing.