Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions opengemini/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules/
dist/
lib/
*.log
.DS_Store
64 changes: 64 additions & 0 deletions opengemini/README.md
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
17 changes: 17 additions & 0 deletions opengemini/cue.mod/module.cue
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
}
}
24 changes: 24 additions & 0 deletions opengemini/jest.config.ts
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;
Loading