-
Notifications
You must be signed in to change notification settings - Fork 43
[FEATURE] Add OpenGemini plugin #530
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
aviralgarg05
wants to merge
7
commits into
perses:main
Choose a base branch
from
aviralgarg05:feat/opengemini-plugin
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
7 commits
Select commit
Hold shift + click to select a range
82eb8a0
[FEATURE] Add OpenGemini plugin
aviralgarg05 027ca93
fix(opengemini): fixes ci workflows
aviralgarg05 ebf3d1e
fix: resolve failing CI checks
aviralgarg05 bf2dfaf
fix(opengemini): align schemas with latest plugin standards
aviralgarg05 4a6a3f6
Merge remote-tracking branch 'origin/main' into feat/opengemini-plugin
aviralgarg05 3df4246
fix: add license headers and correct selector syntax
aviralgarg05 2a563a5
refactor(opengemini): move database config to datasource
aviralgarg05 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| runtimes: | ||
| - dart@3.7.2 | ||
| - go@1.22.3 | ||
| - java@17.0.10 | ||
| - node@22.2.0 | ||
| - python@3.11.11 | ||
| tools: | ||
| - dartanalyzer@3.7.2 | ||
| - eslint@8.57.0 | ||
| - lizard@1.17.31 | ||
| - pmd@7.11.0 | ||
| - pylint@3.3.6 | ||
| - revive@1.7.0 | ||
| - semgrep@1.78.0 | ||
| - trivy@0.66.0 | ||
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 @@ | ||
| --- | ||
| description: Configuration for AI behavior when interacting with Codacy's MCP Server | ||
| applyTo: '**' | ||
| --- | ||
| --- | ||
| # Codacy Rules | ||
| Configuration for AI behavior when interacting with Codacy's MCP Server | ||
|
|
||
| ## CRITICAL: After ANY successful `edit_file` or `reapply` operation | ||
| - YOU MUST IMMEDIATELY run the `codacy_cli_analyze` tool from Codacy's MCP Server for each file that was edited, with: | ||
| - `rootPath`: set to the workspace path | ||
| - `file`: set to the path of the edited file | ||
| - `tool`: leave empty or unset | ||
| - If any issues are found in the new edits, propose and apply fixes for them. | ||
| - > NOTE: Failure to follow this rule is considered a critical error. | ||
| ## When you tried to run the `codacy_cli_analyze` tool and the Codacy CLI is not installed | ||
| - Ask the user 'Codacy CLI is not installed. Would you like me to install it now?' | ||
| - If the user responds with "yes", run the `codacy_cli_install` tool and then continue with the original task | ||
| - If the user responds with "no", instruct the user that they can disable automatic analysis in the extension settings | ||
| - Wait for the user to respond before proceeding with any other actions | ||
|
|
||
| ## After every response | ||
| - If you made any file edits in this conversation, verify you ran `codacy_cli_analyze` tool from Codacy's MCP Server | ||
|
|
||
| ## When there are no Codacy MCP Server tools available, or the MCP Server is not reachable | ||
| - Suggest the user the following troubleshooting steps: | ||
| - Try to reset the MCP on the extension | ||
| - If the user is using VSCode, suggest them to review their Copilot > MCP settings in Github, under their organization or personal account. Refer them to Settings > Copilot > Enable MCP servers in Copilot. Suggested URL (https://github.com/settings/copilot/features) or https://github.com/organizations/{organization-name}/settings/copilot/features (This can only be done by their organization admins / owners) | ||
| - If none of the above steps work, suggest the user to contact Codacy support | ||
|
|
||
| ## Trying to call a tool that needs a rootPath as a parameter | ||
| - Always use the standard, non-URL-encoded file system path | ||
|
|
||
| ## CRITICAL: Dependencies and Security Checks | ||
| - IMMEDIATELY after ANY of these actions: | ||
| - Running npm/yarn/pnpm install | ||
| - Adding dependencies to package.json | ||
| - Adding requirements to requirements.txt | ||
| - Adding dependencies to pom.xml | ||
| - Adding dependencies to build.gradle | ||
| - Any other package manager operations | ||
| - You MUST run the `codacy_cli_analyze` tool with: | ||
| - `rootPath`: set to the workspace path | ||
| - `tool`: set to "trivy" | ||
| - `file`: leave empty or unset | ||
| - If any vulnerabilities are found because of the newly added packages: | ||
| - Stop all other operations | ||
| - Propose and apply fixes for the security issues | ||
| - Only continue with the original task after security issues are resolved | ||
| - EXAMPLE: | ||
| - After: npm install react-markdown | ||
| - Do: Run codacy_cli_analyze with trivy | ||
| - Before: Continuing with any other tasks | ||
|
|
||
| ## General | ||
| - Repeat the relevant steps for each modified file. | ||
| - "Propose fixes" means to both suggest and, if possible, automatically apply the fixes. | ||
| - You MUST NOT wait for the user to ask for analysis or remind you to run the tool. | ||
| - Do not run `codacy_cli_analyze` looking for changes in duplicated code or code complexity metrics. | ||
| - Complexity metrics are different from complexity issues. When trying to fix complexity in a repository or file, focus on solving the complexity issues and ignore the complexity metric. | ||
| - Do not run `codacy_cli_analyze` looking for changes in code coverage. | ||
| - Do not try to manually install Codacy CLI using either brew, npm, npx, or any other package manager. | ||
| - If the Codacy CLI is not installed, just run the `codacy_cli_analyze` tool from Codacy's MCP Server. | ||
| - When calling `codacy_cli_analyze`, only send provider, organization and repository if the project is a git repository. | ||
|
|
||
| ## Whenever a call to a Codacy tool that uses `repository` or `organization` as a parameter returns a 404 error | ||
| - Offer to run the `codacy_setup_repository` tool to add the repository to Codacy | ||
| - If the user accepts, run the `codacy_setup_repository` tool | ||
| - Do not ever try to run the `codacy_setup_repository` tool on your own | ||
| - After setup, immediately retry the action that failed (only retry once) | ||
| --- |
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,5 @@ | ||
| node_modules/ | ||
| dist/ | ||
| lib/ | ||
| *.log | ||
| .DS_Store |
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,64 @@ | ||
| # OpenGemini Plugin for Perses | ||
|
|
||
| This plugin provides OpenGemini datasource and time series query support for [Perses](https://github.com/perses/perses). | ||
|
|
||
| ## Overview | ||
|
|
||
| [OpenGemini](https://github.com/openGemini/openGemini) is a CNCF sandbox project - an open-source distributed time-series database with high concurrency, high performance, and high scalability. It is fully compatible with InfluxDB v1.x Line Protocol, InfluxQL, and read/write APIs. | ||
|
|
||
| ## Plugins Included | ||
|
|
||
| ### OpenGeminiDatasource | ||
|
|
||
| A datasource plugin for connecting to OpenGemini instances. Supports: | ||
|
|
||
| - Direct URL connection | ||
| - HTTP Proxy configuration | ||
|
|
||
| ### OpenGeminiTimeSeriesQuery | ||
|
|
||
| A time series query plugin that uses InfluxQL to query data from OpenGemini. Features: | ||
|
|
||
| - InfluxQL query support | ||
| - Database selection | ||
| - Variable substitution | ||
|
|
||
| ## Installation | ||
|
|
||
| 1. Build the plugin: | ||
|
|
||
| ```bash | ||
| cd plugins/opengemini | ||
| npm install | ||
| npm run build | ||
| ``` | ||
|
|
||
| 2. Copy the built plugin to your Perses plugins directory. | ||
|
|
||
| 3. Restart Perses to load the plugin. | ||
|
|
||
| ## Usage | ||
|
|
||
| ### Creating a Datasource | ||
|
|
||
| 1. Go to Admin > Global Datasources or Project > Datasources | ||
| 2. Click "Add Datasource" | ||
| 3. Select "OpenGeminiDatasource" | ||
| 4. Configure the URL to your OpenGemini instance (default port: 8086) | ||
|
|
||
| ### Creating Queries | ||
|
|
||
| 1. Create or edit a dashboard panel | ||
| 2. Select "OpenGeminiTimeSeriesQuery" as the query type | ||
| 3. Enter your database name | ||
| 4. Write your InfluxQL query | ||
|
|
||
| Example query: | ||
|
|
||
| ```sql | ||
| SELECT mean("value") FROM "cpu" WHERE time > now() - 1h GROUP BY time(1m), "host" | ||
| ``` | ||
|
|
||
| ## License | ||
|
|
||
| Apache License 2.0 |
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,17 @@ | ||
| module: "github.com/perses/plugins/opengemini@v0" | ||
| language: { | ||
| version: "v0.15.1" | ||
| } | ||
| source: { | ||
| kind: "git" | ||
| } | ||
| deps: { | ||
| "github.com/perses/perses/cue@v0": { | ||
| v: "v0.53.0-rc.0" | ||
| default: true | ||
| } | ||
| "github.com/perses/shared/cue@v0": { | ||
| v: "v0.53.0-rc.1" | ||
| default: 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,24 @@ | ||
| // 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'], | ||
| modulePathIgnorePatterns: ['<rootDir>/dist/'], | ||
| }; | ||
|
|
||
| export default jestConfig; |
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.
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.
we are not using codacy, can you remove the relative file please ?