Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
13 changes: 13 additions & 0 deletions influxdb/cue.mod/module.cue
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module: "github.com/perses/plugins/influxdb@v0"
language: {
version: "v0.8.0"
}
source: {
kind: "git"
}
deps: {
"github.com/perses/perses/cue@v0": {
v: "v0.53.0-rc.0"
default: true
}
}
36 changes: 36 additions & 0 deletions influxdb/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
module github.com/perses/plugins/influxdb

go 1.25.5

require (
github.com/perses/perses v0.53.0-rc.0
github.com/stretchr/testify v1.11.1
)

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/go-jose/go-jose/v4 v4.1.3 // indirect
github.com/golang-jwt/jwt/v5 v5.3.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/jpillora/backoff v1.0.0 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/muhlemmer/gu v0.3.1 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_golang v1.23.2 // indirect
github.com/prometheus/client_model v0.6.2 // indirect
github.com/prometheus/common v0.67.4 // indirect
github.com/prometheus/procfs v0.17.0 // indirect
github.com/zitadel/oidc/v3 v3.45.1 // indirect
github.com/zitadel/schema v1.3.1 // indirect
go.yaml.in/yaml/v2 v2.4.3 // indirect
golang.org/x/net v0.48.0 // indirect
golang.org/x/oauth2 v0.34.0 // indirect
golang.org/x/sys v0.39.0 // indirect
golang.org/x/text v0.32.0 // indirect
google.golang.org/protobuf v1.36.10 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
68 changes: 68 additions & 0 deletions influxdb/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/go-jose/go-jose/v4 v4.1.3 h1:CVLmWDhDVRa6Mi/IgCgaopNosCaHz7zrMeF9MlZRkrs=
github.com/go-jose/go-jose/v4 v4.1.3/go.mod h1:x4oUasVrzR7071A4TnHLGSPpNOm2a21K9Kf04k1rs08=
github.com/golang-jwt/jwt/v5 v5.3.0 h1:pv4AsKCKKZuqlgs5sUmn4x8UlGa0kEVt/puTpKx9vvo=
github.com/golang-jwt/jwt/v5 v5.3.0/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE=
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA=
github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/muhlemmer/gu v0.3.1 h1:7EAqmFrW7n3hETvuAdmFmn4hS8W+z3LgKtrnow+YzNM=
github.com/muhlemmer/gu v0.3.1/go.mod h1:YHtHR+gxM+bKEIIs7Hmi9sPT3ZDUvTN/i88wQpZkrdM=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU=
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/nexucis/lamenv v0.5.2 h1:tK/u3XGhCq9qIoVNcXsK9LZb8fKopm0A5weqSRvHd7M=
github.com/nexucis/lamenv v0.5.2/go.mod h1:HusJm6ltmmT7FMG8A750mOLuME6SHCsr2iFYxp5fFi0=
github.com/perses/perses v0.53.0-rc.0 h1:f3V1j6EqnKyXUY0mNt4Zp/T6+5U/5SjtCzLHxj9sJDQ=
github.com/perses/perses v0.53.0-rc.0/go.mod h1:q+gB4M2yT//cO6GlCjhOTJLDoSrqtkMLul72Z0WOueI=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_golang v1.23.2 h1:Je96obch5RDVy3FDMndoUsjAhG5Edi49h0RJWRi/o0o=
github.com/prometheus/client_golang v1.23.2/go.mod h1:Tb1a6LWHB3/SPIzCoaDXI4I8UHKeFTEQ1YCr+0Gyqmg=
github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk=
github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE=
github.com/prometheus/common v0.67.4 h1:yR3NqWO1/UyO1w2PhUvXlGQs/PtFmoveVO0KZ4+Lvsc=
github.com/prometheus/common v0.67.4/go.mod h1:gP0fq6YjjNCLssJCQp0yk4M8W6ikLURwkdd/YKtTbyI=
github.com/prometheus/procfs v0.17.0 h1:FuLQ+05u4ZI+SS/w9+BWEM2TXiHKsUQ9TADiRH7DuK0=
github.com/prometheus/procfs v0.17.0/go.mod h1:oPQLaDAMRbA+u8H5Pbfq+dl3VDAvHxMUOVhe0wYB2zw=
github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=
github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
github.com/zitadel/oidc/v3 v3.45.1 h1:x7J8NywTUtLR9T5uu2dufae3gJrl6VVpIfvGZy+kzJg=
github.com/zitadel/oidc/v3 v3.45.1/go.mod h1:oFArtAPTXEA4ajkIe/JfBjv7hhlD0kr///UqaO3Uzd0=
github.com/zitadel/schema v1.3.1 h1:QT3kwiRIRXXLVAs6gCK/u044WmUVh6IlbLXUsn6yRQU=
github.com/zitadel/schema v1.3.1/go.mod h1:071u7D2LQacy1HAN+YnMd/mx1qVE2isb0Mjeqg46xnU=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.yaml.in/yaml/v2 v2.4.3 h1:6gvOSjQoTB3vt1l+CU+tSyi/HOjfOjRLJ4YwYZGwRO0=
go.yaml.in/yaml/v2 v2.4.3/go.mod h1:zSxWcmIDjOzPXpjlTTbAsKokqkDNAVtZO0WOMiT90s8=
golang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU=
golang.org/x/net v0.48.0/go.mod h1:+ndRgGjkh8FGtu1w1FGbEC31if4VrNVMuKTgcAAnQRY=
golang.org/x/oauth2 v0.34.0 h1:hqK/t4AKgbqWkdkcAeI8XLmbK+4m4G5YeQRrmiotGlw=
golang.org/x/oauth2 v0.34.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA=
golang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk=
golang.org/x/sys v0.39.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
golang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU=
golang.org/x/text v0.32.0/go.mod h1:o/rUWzghvpD5TXrTIBuJU77MTaN0ljMWE47kxGJQ7jY=
google.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE=
google.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
7 changes: 7 additions & 0 deletions influxdb/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type { Config } from 'jest';
import sharedConfig from '../jest.shared';
const config: Config = {
...sharedConfig,
displayName: 'influxdb',
};
export default config;
69 changes: 69 additions & 0 deletions influxdb/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"name": "@perses-dev/influxdb-plugin",
"version": "0.1.0-rc.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",
"type-check": "tsc --noEmit"
},
"main": "lib/cjs/index.js",
"module": "lib/index.js",
"types": "lib/index.d.ts",
"dependencies": {},
"peerDependencies": {
"@emotion/react": "^11.7.1",
"@emotion/styled": "^11.6.0",
"@mui/material": "^5.0.0",
"@hookform/resolvers": "^3.2.0",
"@perses-dev/components": "^0.53.0-rc.1",
"@perses-dev/core": "^0.53.0-beta.4",
"@perses-dev/dashboards": "^0.53.0-rc.1",
"@perses-dev/explore": "^0.53.0-rc.1",
"@perses-dev/plugin-system": "^0.53.0-rc.1",
"@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": "^6.27.0",
"zod": "^3.22.4"
},
"devDependencies": {
"@swc/cli": "^0.4.1-nightly.20240914",
"@swc/core": "^1.7.28",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^12.1.4",
"@testing-library/user-event": "^14.5.2",
"@types/color-hash": "^2.0.0",
"@types/jest": "^29.5.14",
"@types/lodash": "^4.17.13",
"@types/react": "^18.3.12",
"concurrently": "^8.2.2",
"cross-env": "^7.0.3",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"typescript": "^5.6.3"
},
"files": [
"dist",
"README.md"
]
}
25 changes: 25 additions & 0 deletions influxdb/rsbuild.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { pluginReact } from '@rsbuild/plugin-react';
import { ModuleFederationPlugin } from '@module-federation/enhanced/rspack';
export default {
plugins: [pluginReact()],
tools: {
rspack: {
plugins: [
new ModuleFederationPlugin({
name: 'influxdb',
filename: 'remoteEntry.js',
exposes: {
'./plugin': './src/getPluginModule.ts',
},
shared: {
react: { singleton: true, requiredVersion: false },
'react-dom': { singleton: true, requiredVersion: false },
'@perses-dev/core': { singleton: true, requiredVersion: false },
'@perses-dev/plugin-system': { singleton: true, requiredVersion: false },
'@perses-dev/components': { singleton: true, requiredVersion: false },
},
}),
],
},
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
kind: GlobalDatasource
metadata:
name: influxdb-v1-demo
spec:
default: false
plugin:
kind: InfluxDBV1Datasource
spec:
directUrl: http://localhost:8086
version: v1
database: mydb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
kind: GlobalDatasource
metadata:
name: influxdb-v1-proxy
spec:
default: false
plugin:
kind: InfluxDBV1Datasource
spec:
version: v1
database: mydb
proxy:
kind: HTTPProxy
spec:
url: http://localhost:8086
allowedEndpoints:
- endpointPattern: /query
method: GET
- endpointPattern: /query
method: POST
- endpointPattern: /write
method: POST
secret: influxdb-secret
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
kind: GlobalDatasource
metadata:
name: influxdb-v3-demo
spec:
default: false
plugin:
kind: InfluxDBV3Datasource
spec:
directUrl: http://localhost:8086
version: v3
organization: myorg
bucket: mybucket
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
kind: GlobalDatasource
metadata:
name: influxdb-v3-proxy
spec:
default: false
plugin:
kind: InfluxDBV3Datasource
spec:
version: v3
organization: myorg
bucket: mybucket
proxy:
kind: HTTPProxy
spec:
url: http://localhost:8086
allowedEndpoints:
- endpointPattern: /api/v3/query_sql
method: POST
- endpointPattern: /api/v3/query_influxql
method: POST
secret: influxdb-secret
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// Copyright The Perses Authors
}
proxy: commonProxy.#HTTPProxy
#proxy: {

}
directUrl: common.#url
#directUrl: {

}
database: string
version: "v1"
#directUrl | #proxy
spec: {
kind: "InfluxDBV1Datasource"

)
commonProxy "github.com/perses/shared/cue/common/proxy"
"github.com/perses/shared/cue/common"
import (

package model

// limitations under the License.
// See the License for the specific language governing permissions and
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// distributed under the License is distributed on an "AS IS" BASIS,
// Unless required by applicable law or agreed to in writing, software
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// You may obtain a copy of the License at
// you may not use this file except in compliance with the License.
// Licensed under the Apache License, Version 2.0 (the "License");
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
}
}
"database": "mydb"
"version": "v1",
"directUrl": "http://localhost:8086",
"spec": {
"kind": "InfluxDBV1Datasource",
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// 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.

package model

import (
"github.com/perses/shared/cue/common"
commonProxy "github.com/perses/shared/cue/common/proxy"
)

kind: "InfluxDBV3Datasource"
spec: {
#directUrl | #proxy
version: "v3"
organization: string
bucket: string
}

#directUrl: {
directUrl: common.#url
}

#proxy: {
proxy: commonProxy.#HTTPProxy
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"kind": "InfluxDBV3Datasource",
"spec": {
"directUrl": "http://localhost:8086",
"version": "v3",
"organization": "myorg",
"bucket": "mybucket"
}
}
Loading