Skip to content

Commit 6cfd2cd

Browse files
committed
init
0 parents  commit 6cfd2cd

51 files changed

Lines changed: 5264 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.claude/settings.json‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"enabledPlugins": {
3+
"qdrant@qdrant": true
4+
}
5+
}

‎.github/workflows/release.yml‎

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Release Chrome Extension
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
build-and-release:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: '20'
23+
cache: 'npm'
24+
25+
- name: Get version from tag
26+
id: version
27+
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
28+
29+
- name: Install dependencies
30+
run: npm ci
31+
32+
- name: Update manifest version
33+
run: |
34+
jq --arg ver "${{ steps.version.outputs.VERSION }}" '.version = $ver' public/manifest.json > manifest.tmp
35+
mv manifest.tmp public/manifest.json
36+
37+
- name: Build
38+
run: npm run build
39+
40+
- name: Create extension zip
41+
run: |
42+
cd dist
43+
zip -r ../qdrant-chrome-plugin-${{ steps.version.outputs.VERSION }}.zip . -x "*.DS_Store"
44+
45+
- name: Create GitHub Release
46+
uses: softprops/action-gh-release@v2
47+
with:
48+
name: v${{ steps.version.outputs.VERSION }}
49+
generate_release_notes: true
50+
files: qdrant-chrome-plugin-${{ steps.version.outputs.VERSION }}.zip

‎.gitignore‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.DS_Store
2+
.idea/
3+
*.swp
4+
*.swo
5+
*~
6+
node_modules/
7+
dist/

‎CONTRIBUTING.md‎

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
# Contributing to Qdrant Chrome Plugin
2+
3+
Thank you for your interest in contributing! This guide will help you get started.
4+
5+
## Development Setup
6+
7+
1. Clone the repository:
8+
```bash
9+
git clone https://github.com/qdrant/qdrant-chrome-plugin.git
10+
cd qdrant-chrome-plugin
11+
```
12+
13+
2. Load the extension in Chrome:
14+
- Open `chrome://extensions`
15+
- Enable **Developer mode**
16+
- Click **Load unpacked** and select the project folder
17+
18+
3. After making changes, click the **reload** button on the extension card in `chrome://extensions`
19+
20+
No build tools or npm install required - the extension uses vanilla HTML/CSS/JS.
21+
22+
## Architecture
23+
24+
### Key Files
25+
26+
- **`lib/qdrant-api.js`** - Qdrant REST API client. All API calls go through here.
27+
- **`lib/storage.js`** - Wrapper around `chrome.storage.local` for cluster config persistence.
28+
- **`popup/popup.js`** - Cluster connection management (add/edit/delete/test).
29+
- **`dashboard/dashboard.js`** - Main dashboard rendering logic.
30+
- **`dashboard/rules/rule-engine.js`** - Insight rule registry, executor, and renderer.
31+
- **`dashboard/rules/*.js`** - Individual rule files grouped by scope.
32+
33+
### Data Flow
34+
35+
```
36+
User clicks cluster → dashboard.js loads
37+
→ QdrantApi.getDashboardData() fetches from all endpoints
38+
→ RuleEngine.run(dashboardData) executes all registered rules
39+
→ RuleEngine.render(insights) shows insights panel
40+
→ renderDashboard() renders all tabs
41+
```
42+
43+
## Adding New Rules
44+
45+
The rule engine is designed to make adding new rules as simple as possible. Each rule is a self-contained function that receives the full dashboard context and returns zero or more insights.
46+
47+
### Step 1: Choose the Right File
48+
49+
| File | Scope |
50+
|-----------------------------|---------------------------------------------------------|
51+
| `rules/cluster-rules.js` | Cluster-wide: memory, raft, consensus, nodes |
52+
| `rules/collection-rules.js` | Per-collection: config, performance, indexing |
53+
| `rules/segment-rules.js` | Per-shard/segment: replicas, optimizer, deleted vectors |
54+
55+
Or create a new file (e.g., `rules/my-rules.js`) and add a `<script>` tag in `dashboard.html` before `dashboard.js`.
56+
57+
### Step 2: Write the Rule
58+
59+
```js
60+
RuleEngine.register('my-rule-name', function(ctx) {
61+
const insights = [];
62+
63+
// ctx contains:
64+
// ctx.cluster - GET /cluster result
65+
// ctx.collections - array of collection names
66+
// ctx.collectionDetails - { [name]: { info, cluster } }
67+
// ctx.telemetry - GET /telemetry result (connected node)
68+
// ctx.nodeTelemetry - { [peerId]: telemetry } (all reachable nodes)
69+
70+
for (const name of ctx.collections) {
71+
const info = ctx.collectionDetails[name]?.info;
72+
if (!info) continue;
73+
74+
if (/* your condition */) {
75+
insights.push({
76+
level: 'warning', // critical | warning | performance | info
77+
category: 'config', // memory | optimizer | replication | indexing | config | cluster
78+
collection: name, // or null for cluster-wide insights
79+
title: 'Short title',
80+
detail: 'Explanation with actionable advice.',
81+
});
82+
}
83+
}
84+
85+
return insights;
86+
});
87+
```
88+
89+
### Step 3: Done
90+
91+
No other files need to change. The rule automatically registers on script load, executes when data loads, and appears in the insights panel.
92+
93+
### Insight Levels
94+
95+
| Level | When to Use | Display |
96+
|---------------|--------------------------------------------------------|------------------------|
97+
| `critical` | Immediate action required (data loss risk, errors) | Always visible, red |
98+
| `warning` | Should be addressed soon (degraded performance, no HA) | Always visible, yellow |
99+
| `performance` | Optimization opportunity (quantization, indexes) | Collapsible, purple |
100+
| `info` | Informational (current state, no action needed) | Collapsible, blue |
101+
102+
### Guidelines for Rules
103+
104+
- One rule should check one thing
105+
- Use descriptive rule names: `no-quantization`, `high-segment-count`, `replica-not-active`
106+
- Include actionable advice in `detail` - don't just report the problem, suggest a fix
107+
- Use `formatNumber()` and `formatBytes()` for readable values (available globally)
108+
- Set appropriate thresholds - avoid noisy rules that trigger on tiny collections
109+
- Each rule is wrapped in try/catch by the engine, so a broken rule won't crash the dashboard
110+
111+
### Iterating Over Multiple Nodes
112+
113+
For segment-level rules that need telemetry from all nodes, use the helper pattern from `segment-rules.js`:
114+
115+
```js
116+
function _allNodeTelemetries(ctx) {
117+
if (ctx.nodeTelemetry && Object.keys(ctx.nodeTelemetry).length > 0) {
118+
return Object.entries(ctx.nodeTelemetry);
119+
}
120+
return [[ctx.cluster?.peer_id?.toString() || 'local', ctx.telemetry]];
121+
}
122+
```
123+
124+
## Submitting Changes
125+
126+
1. Fork the repository
127+
2. Create a feature branch: `git checkout -b feature/my-feature`
128+
3. Make your changes
129+
4. Test with at least one Qdrant instance (local Docker is fine)
130+
5. Submit a pull request
131+
132+
### PR Guidelines
133+
134+
- Keep PRs focused - one feature or fix per PR
135+
- Test the extension by loading it unpacked in Chrome
136+
- For new rules, include a brief description of what it detects and why it matters
137+
- Update README.md if adding new features visible to users
138+
139+
## Reporting Issues
140+
141+
- Use [GitHub Issues](../../issues)
142+
- Include your Qdrant version and Chrome version
143+
- Screenshots of the dashboard are helpful
144+
- For rule suggestions, describe the scenario and what insight should be shown

‎README.md‎

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# Qdrant Cluster Dashboard - Chrome Extension
2+
3+
A Chrome extension for monitoring and managing Qdrant vector database clusters. Connect to one or more Qdrant instances and get real-time visibility into cluster health, collection configurations, shard distribution, and performance insights.
4+
5+
## Features
6+
7+
- **Multi-cluster support** - Connect to multiple Qdrant clusters with URL + API key
8+
- **Cluster overview** - Node count, collection count, memory usage, CPU, uptime
9+
- **Collection details** - Dense/sparse vector configs, HNSW parameters, optimizer settings, quantization, payload indexes
10+
- **Shard & segment visibility** - Per-node shard status, segment details (type, points, vectors, RAM/disk usage, storage config)
11+
- **Raft consensus monitoring** - Term, commit, pending operations, leader/follower roles
12+
- **Request statistics** - REST/gRPC endpoint latency (avg/min/max), request counts
13+
- **Rule-based insights engine** - Automatic detection of performance issues and configuration recommendations
14+
15+
## Insights & Recommendations
16+
17+
The extension includes a pluggable rule engine that analyzes your cluster configuration and produces actionable insights:
18+
19+
| Category | Examples |
20+
|---|---|
21+
| **Memory** | High resident memory usage, quantized vectors in RAM |
22+
| **Optimizer** | Optimizer errors, high segment count, large update queue |
23+
| **Replication** | No replication configured, dead replicas, recovery in progress |
24+
| **Config** | Missing quantization, no payload indexes, HNSW on disk, prevent_unoptimized disabled |
25+
| **Indexing** | Indexing progress, high deleted vector ratio |
26+
| **Cluster** | Single-node cluster, Raft pending operations, consensus issues |
27+
28+
Rules are easy to extend - see [Contributing](#adding-new-rules).
29+
30+
## Installation
31+
32+
### From Release
33+
34+
1. Download the latest `.zip` from [Releases](../../releases)
35+
2. Unzip the file
36+
3. Open `chrome://extensions` in Chrome
37+
4. Enable **Developer mode** (top right toggle)
38+
5. Click **Load unpacked** and select the unzipped folder
39+
40+
### From Source
41+
42+
1. Clone the repository:
43+
```bash
44+
git clone https://github.com/qdrant/qdrant-chrome-plugin.git
45+
```
46+
2. Open `chrome://extensions` in Chrome
47+
3. Enable **Developer mode**
48+
4. Click **Load unpacked** and select the repository folder
49+
50+
## Usage
51+
52+
1. Click the extension icon in Chrome toolbar
53+
2. Click **+** to add a cluster (name, URL, API key)
54+
3. Use **Test** to verify the connection
55+
4. Click **Save**, then click on the cluster to open the dashboard
56+
57+
### Dashboard Tabs
58+
59+
- **Overview** - System information (version, OS, CPU, RAM, disk) and memory usage breakdown
60+
- **Collections** - Detailed configuration for each collection with inline insight badges
61+
- **Shards & Segments** - Per-shard node distribution with segment details (type, storage, index config)
62+
- **Cluster** - Peer nodes, Raft consensus status
63+
- **Requests** - REST/gRPC endpoint statistics sorted by request count
64+
65+
## Qdrant API Endpoints Used
66+
67+
| Endpoint | Purpose |
68+
|---|---|
69+
| `GET /healthz` | Connection health check |
70+
| `GET /cluster` | Cluster topology, peers, Raft status |
71+
| `GET /collections` | List all collections |
72+
| `GET /collections/{name}` | Collection config, status, payload schema |
73+
| `GET /collections/{name}/cluster` | Shard distribution for a collection |
74+
| `GET /telemetry?details_level=10` | System info, memory, segments, request stats |
75+
76+
## Project Structure
77+
78+
```
79+
├── manifest.json # Chrome Extension Manifest V3
80+
├── lib/
81+
│ ├── storage.js # chrome.storage.local helper
82+
│ └── qdrant-api.js # Qdrant REST API client
83+
├── popup/
84+
│ ├── popup.html/css/js # Cluster connection management
85+
├── dashboard/
86+
│ ├── dashboard.html/css/js # Main dashboard UI
87+
│ └── rules/
88+
│ ├── rule-engine.js # Rule registry, runner, renderer
89+
│ ├── cluster-rules.js # Cluster-level rules (memory, raft, consensus)
90+
│ ├── collection-rules.js # Collection-level rules (config, performance)
91+
│ └── segment-rules.js # Shard/segment-level rules (replicas, optimizer)
92+
├── icons/ # Extension icons
93+
└── poc/ # Proof of concept (not included in extension)
94+
```
95+
96+
## Releasing
97+
98+
Releases are automated via GitHub Actions. To create a new release:
99+
100+
```bash
101+
git tag v0.1.0
102+
git push origin v0.1.0
103+
```
104+
105+
This creates a GitHub Release with a `.zip` file ready for Chrome Web Store upload.
106+
107+
## License
108+
109+
Apache License 2.0

0 commit comments

Comments
 (0)