├── .nvmrc ├── .config ├── .cprc.json ├── webpack │ ├── constants.ts │ ├── utils.ts │ └── webpack.config.ts ├── .prettierrc.js ├── .eslintrc ├── types │ └── custom.d.ts ├── Dockerfile ├── tsconfig.json ├── jest-setup.js ├── jest │ ├── mocks │ │ └── react-inlinesvg.tsx │ └── utils.js ├── jest.config.js └── README.md ├── .eslintrc ├── tsconfig.json ├── .vscode └── settings.json ├── CHANGELOG.md ├── .gitattributes ├── jest-setup.js ├── src ├── .DS_Store ├── img │ └── logo.png ├── components │ ├── .DS_Store │ ├── ZincEditor.test.tsx │ ├── config │ │ └── ConfigEditor.tsx │ ├── QueryEditorHelp.tsx │ ├── ZincEditor.tsx │ ├── QueryEditor.test.tsx │ └── QueryEditor.tsx ├── README.md ├── module.ts ├── plugin.json ├── services │ ├── organizations.ts │ └── streams.ts ├── queryparser.ts ├── types.ts ├── features │ ├── query │ │ └── queryBuilder.ts │ └── log │ │ ├── queryResponseBuilder.ts │ │ └── LogsModel.ts ├── LICENSE ├── utils │ └── zincutils.ts ├── datasource.test.ts └── datasource.ts ├── .prettierrc.js ├── publish.sh ├── cypress └── integration │ └── 01-smoke.spec.ts ├── deployment ├── create_secret.sh ├── grafana.ini └── grafana_statefulset.yaml ├── jest.config.js ├── docker-compose.yaml ├── .gitignore ├── .github └── workflows │ └── is-compatible.yml ├── package.json ├── README.md └── LICENSE /.nvmrc: -------------------------------------------------------------------------------- 1 | 16 -------------------------------------------------------------------------------- /.config/.cprc.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.5.1" 3 | } 4 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./.config/.eslintrc" 3 | } -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./.config/tsconfig.json" 3 | } -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "cSpell.words": [ 3 | "openobserve" 4 | ] 5 | } -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## 1.0.0 (Unreleased) 4 | 5 | Initial release. -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /jest-setup.js: -------------------------------------------------------------------------------- 1 | // Jest setup provided by Grafana scaffolding 2 | import './.config/jest-setup'; 3 | -------------------------------------------------------------------------------- /.config/webpack/constants.ts: -------------------------------------------------------------------------------- 1 | export const SOURCE_DIR = 'src'; 2 | export const DIST_DIR = 'dist'; 3 | -------------------------------------------------------------------------------- /src/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openobserve/openobserve-grafana-plugin/HEAD/src/.DS_Store -------------------------------------------------------------------------------- /src/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openobserve/openobserve-grafana-plugin/HEAD/src/img/logo.png -------------------------------------------------------------------------------- /src/components/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openobserve/openobserve-grafana-plugin/HEAD/src/components/.DS_Store -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | // Prettier configuration provided by Grafana scaffolding 3 | ...require("./.config/.prettierrc.js") 4 | }; -------------------------------------------------------------------------------- /publish.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | npm run build 4 | mv dist zo_gp 5 | tar -czvf zo_gp.tar.gz ./zo_gp/ 6 | 7 | aws s3 cp zo_gp.tar.gz s3://zincsearch-releases/zo_gp/zo_gp.tar.gz 8 | 9 | rm -rf zo_gp.tar.gz zo_gp 10 | 11 | -------------------------------------------------------------------------------- /src/README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | # OpenObserve 4 | 5 | OpenObserve 6 | 7 | # License 8 | 9 | OpenObserve commercial license. Please contact hello@openobserve.ai for more information. 10 | -------------------------------------------------------------------------------- /cypress/integration/01-smoke.spec.ts: -------------------------------------------------------------------------------- 1 | import { e2e } from '@grafana/e2e'; 2 | 3 | e2e.scenario({ 4 | describeName: 'Smoke test', 5 | itName: 'Smoke test', 6 | scenario: () => { 7 | e2e.pages.Home.visit(); 8 | e2e().contains('Welcome to Grafana').should('be.visible'); 9 | }, 10 | }); 11 | -------------------------------------------------------------------------------- /deployment/create_secret.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | kubectl delete secret grafana-config 4 | kubectl create secret generic grafana-config --from-file=grafana.ini 5 | 6 | # same command as above with dry run 7 | # kubectl create secret generic grafana-config --from-file=grafana.ini --dry-run=client -o yaml 8 | 9 | -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | // force timezone to UTC to allow tests to work regardless of local timezone 2 | // generally used by snapshots, but can affect specific tests 3 | process.env.TZ = 'UTC'; 4 | 5 | module.exports = { 6 | // Jest configuration provided by Grafana scaffolding 7 | ...require('./.config/jest.config'), 8 | }; 9 | -------------------------------------------------------------------------------- /docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: '3.0' 2 | 3 | services: 4 | grafana: 5 | container_name: 'openobserve' 6 | build: 7 | context: ./.config 8 | args: 9 | grafana_version: ${GRAFANA_VERSION:-9.3.8} 10 | ports: 11 | - 3000:3000/tcp 12 | volumes: 13 | - ./dist:/var/lib/grafana/plugins/openobserve 14 | - ./provisioning:/etc/grafana/provisioning 15 | -------------------------------------------------------------------------------- /.config/.prettierrc.js: -------------------------------------------------------------------------------- 1 | /* 2 | * ⚠️⚠️⚠️ THIS FILE WAS SCAFFOLDED BY `@grafana/create-plugin`. DO NOT EDIT THIS FILE DIRECTLY. ⚠️⚠️⚠️ 3 | * 4 | * In order to extend the configuration follow the steps in .config/README.md 5 | */ 6 | 7 | module.exports = { 8 | endOfLine: 'auto', 9 | printWidth: 120, 10 | trailingComma: 'es5', 11 | semi: true, 12 | jsxSingleQuote: false, 13 | singleQuote: true, 14 | useTabs: false, 15 | tabWidth: 2, 16 | }; 17 | -------------------------------------------------------------------------------- /src/module.ts: -------------------------------------------------------------------------------- 1 | import { DataSourcePlugin } from '@grafana/data'; 2 | import { DataSource } from './datasource'; 3 | import { ConfigEditor } from './components/config/ConfigEditor'; 4 | import { QueryEditor } from './components/QueryEditor'; 5 | import { MyQuery, MyDataSourceOptions } from './types'; 6 | import { QueryEditorHelp } from 'components/QueryEditorHelp'; 7 | 8 | export const plugin = new DataSourcePlugin(DataSource) 9 | .setConfigEditor(ConfigEditor) 10 | .setQueryEditor(QueryEditor) 11 | .setQueryEditorHelp(QueryEditorHelp); 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | .pnpm-debug.log* 8 | 9 | node_modules/ 10 | 11 | # Runtime data 12 | pids 13 | *.pid 14 | *.seed 15 | *.pid.lock 16 | 17 | # Directory for instrumented libs generated by jscoverage/JSCover 18 | lib-cov 19 | 20 | # Coverage directory used by tools like istanbul 21 | coverage 22 | 23 | # Compiled binary addons (https://nodejs.org/api/addons.html) 24 | dist/ 25 | artifacts/ 26 | work/ 27 | ci/ 28 | e2e-results/ 29 | **/cypress/videos 30 | **/cypress/report.json 31 | 32 | # Editor 33 | .idea 34 | 35 | .eslintcache 36 | 37 | .DS_Store 38 | -------------------------------------------------------------------------------- /src/components/ZincEditor.test.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { act, render } from '@testing-library/react'; 3 | import { ZincEditor } from './ZincEditor'; 4 | 5 | describe('ZincEditor', () => { 6 | let props: any; 7 | let wrapper: any; 8 | 9 | beforeEach(async () => { 10 | props = { 11 | query: '', 12 | onChange: jest.fn(), 13 | placeholder: '', 14 | fields: [], 15 | runQuery: jest.fn(), 16 | }; 17 | 18 | await act(async () => { 19 | wrapper = render(); 20 | }); 21 | }); 22 | 23 | it('renders without crashing', async () => { 24 | expect(wrapper).not.toBeNull(); 25 | }); 26 | }); 27 | -------------------------------------------------------------------------------- /.github/workflows/is-compatible.yml: -------------------------------------------------------------------------------- 1 | name: Latest Grafana API compatibility check 2 | on: [pull_request] 3 | 4 | jobs: 5 | compatibilitycheck: 6 | runs-on: ubuntu-latest 7 | steps: 8 | - uses: actions/checkout@v3 9 | - name: Setup Node.js environment 10 | uses: actions/setup-node@v3 11 | with: 12 | node-version: '22.13.0' 13 | cache: 'npm' 14 | - name: Install dependencies 15 | run: npm ci 16 | - name: Build plugin 17 | run: npm run build 18 | - name: Compatibility check 19 | run: npx @grafana/levitate@latest is-compatible --path src/module.ts --target @grafana/data,@grafana/ui,@grafana/runtime 20 | -------------------------------------------------------------------------------- /src/plugin.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://raw.githubusercontent.com/grafana/grafana/master/docs/sources/developers/plugins/plugin.schema.json", 3 | "type": "datasource", 4 | "name": "OpenObserve", 5 | "id": "openobserve", 6 | "info": { 7 | "description": "OpenObserve", 8 | "author": { 9 | "name": "OpenObserve" 10 | }, 11 | "keywords": ["OpenObserve"], 12 | "logos": { 13 | "small": "img/logo.png", 14 | "large": "img/logo.png" 15 | }, 16 | "links": [], 17 | "screenshots": [], 18 | "version": "%VERSION%", 19 | "updated": "%TODAY%" 20 | }, 21 | "dependencies": { 22 | "grafanaDependency": "^9.3.8", 23 | "plugins": [] 24 | }, 25 | "logs": true, 26 | "metrics": true 27 | } 28 | -------------------------------------------------------------------------------- /.config/.eslintrc: -------------------------------------------------------------------------------- 1 | /* 2 | * ⚠️⚠️⚠️ THIS FILE WAS SCAFFOLDED BY `@grafana/create-plugin`. DO NOT EDIT THIS FILE DIRECTLY. ⚠️⚠️⚠️ 3 | * 4 | * In order to extend the configuration follow the steps in 5 | * https://grafana.com/developers/plugin-tools/create-a-plugin/extend-a-plugin/extend-configurations#extend-the-eslint-config 6 | */ 7 | { 8 | "extends": ["@grafana/eslint-config"], 9 | "root": true, 10 | "rules": { 11 | "react/prop-types": "off" 12 | }, 13 | "overrides": [ 14 | { 15 | "plugins": ["deprecation"], 16 | "files": ["src/**/*.{ts,tsx}"], 17 | "rules": { 18 | "deprecation/deprecation": "warn" 19 | }, 20 | "parserOptions": { 21 | "project": "./tsconfig.json" 22 | } 23 | } 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /.config/types/custom.d.ts: -------------------------------------------------------------------------------- 1 | // Image declarations 2 | declare module '*.gif' { 3 | const src: string; 4 | export default src; 5 | } 6 | 7 | declare module '*.jpg' { 8 | const src: string; 9 | export default src; 10 | } 11 | 12 | declare module '*.jpeg' { 13 | const src: string; 14 | export default src; 15 | } 16 | 17 | declare module '*.png' { 18 | const src: string; 19 | export default src; 20 | } 21 | 22 | declare module '*.webp' { 23 | const src: string; 24 | export default src; 25 | } 26 | 27 | declare module '*.svg' { 28 | const content: string; 29 | export default content; 30 | } 31 | 32 | // Font declarations 33 | declare module '*.woff'; 34 | declare module '*.woff2'; 35 | declare module '*.eot'; 36 | declare module '*.ttf'; 37 | declare module '*.otf'; 38 | -------------------------------------------------------------------------------- /.config/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG grafana_version=latest 2 | ARG grafana_image=grafana-enterprise 3 | 4 | FROM grafana/${grafana_image}:${grafana_version} 5 | 6 | # Make it as simple as possible to access the grafana instance for development purposes 7 | # Do NOT enable these settings in a public facing / production grafana instance 8 | ENV GF_AUTH_ANONYMOUS_ORG_ROLE "Admin" 9 | ENV GF_AUTH_ANONYMOUS_ENABLED "true" 10 | ENV GF_AUTH_BASIC_ENABLED "false" 11 | # Set development mode so plugins can be loaded without the need to sign 12 | ENV GF_DEFAULT_APP_MODE "development" 13 | 14 | # Inject livereload script into grafana index.html 15 | USER root 16 | RUN sed -i 's/<\/body><\/html>/