@kimchitest/opencode-otel-plugin 1.0.5 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -12
- package/package.json +4 -4
- package/plugin.ts +4 -4
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# OpenCode OTEL Plugin for
|
|
1
|
+
# OpenCode OTEL Plugin for Kimchi
|
|
2
2
|
|
|
3
|
-
Sends usage telemetry from OpenCode to the
|
|
3
|
+
Sends usage telemetry from OpenCode to the Kimchi service.
|
|
4
4
|
|
|
5
5
|
OpenCode version 1.2.20+
|
|
6
6
|
|
|
@@ -16,6 +16,14 @@ Add to your `~/.config/opencode/opencode.json`:
|
|
|
16
16
|
}
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
+
To pin to a specific version (recommended for stability):
|
|
20
|
+
|
|
21
|
+
```json
|
|
22
|
+
{
|
|
23
|
+
"plugin": ["@kimchitest/opencode-otel-plugin@1.0.6"]
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
19
27
|
Set environment variables (see [Configuration](#configuration) section below), then restart OpenCode.
|
|
20
28
|
|
|
21
29
|
### Option 2: Local plugin
|
|
@@ -50,8 +58,8 @@ mkdir -p .opencode/plugins
|
|
|
50
58
|
| Variable | Required | Description |
|
|
51
59
|
|----------|----------|-------------|
|
|
52
60
|
| `OPENCODE_ENABLE_TELEMETRY` | Yes | Set to `1` to enable telemetry |
|
|
53
|
-
| `OPENCODE_OTLP_ENDPOINT` | Yes |
|
|
54
|
-
| `OPENCODE_OTLP_HEADERS` | Yes | Authorization header with your
|
|
61
|
+
| `OPENCODE_OTLP_ENDPOINT` | Yes | Kimchi logs ingest endpoint URL |
|
|
62
|
+
| `OPENCODE_OTLP_HEADERS` | Yes | Authorization header with your Kimchi API key |
|
|
55
63
|
|
|
56
64
|
#### Example Environment Variables
|
|
57
65
|
|
|
@@ -61,10 +69,10 @@ Add these to your shell config (`~/.zshrc`, `~/.bashrc`, etc.):
|
|
|
61
69
|
# Enable the plugin
|
|
62
70
|
export OPENCODE_ENABLE_TELEMETRY=1
|
|
63
71
|
|
|
64
|
-
#
|
|
72
|
+
# Kimchi endpoint for log ingestion
|
|
65
73
|
export OPENCODE_OTLP_ENDPOINT=https://api.cast.ai/ai-optimizer/v1beta/logs:ingest
|
|
66
74
|
|
|
67
|
-
# Authorization header with your
|
|
75
|
+
# Authorization header with your Kimchi API key
|
|
68
76
|
export OPENCODE_OTLP_HEADERS="Authorization=Bearer YOUR_API_KEY_HERE"
|
|
69
77
|
```
|
|
70
78
|
|
|
@@ -95,7 +103,7 @@ The plugin reads provider information from your OpenCode config (`~/.config/open
|
|
|
95
103
|
| `perplexity` | Perplexity |
|
|
96
104
|
| `hosted_vllm` | Hosted vLLM |
|
|
97
105
|
| `bedrock` | AWS Bedrock |
|
|
98
|
-
| `
|
|
106
|
+
| `kimchi` | Kimchi (serverless models) |
|
|
99
107
|
|
|
100
108
|
> **Important:** If your provider key does not match one of the valid values listed above, the request will be **rejected** and you will see an error toast notification in OpenCode. Make sure to use a provider key from the list above to ensure your usage data is recorded correctly.
|
|
101
109
|
|
|
@@ -103,11 +111,11 @@ The plugin reads provider information from your OpenCode config (`~/.config/open
|
|
|
103
111
|
|
|
104
112
|
```json
|
|
105
113
|
{
|
|
106
|
-
"model": "
|
|
114
|
+
"model": "kimchi/glm-5-fp8",
|
|
107
115
|
"provider": {
|
|
108
|
-
"
|
|
116
|
+
"kimchi": {
|
|
109
117
|
"npm": "@ai-sdk/openai-compatible",
|
|
110
|
-
"name": "
|
|
118
|
+
"name": "Kimchi",
|
|
111
119
|
"options": {
|
|
112
120
|
"baseURL": "https://llm.cast.ai/openai/v1",
|
|
113
121
|
"apiKey": "your-api-key"
|
|
@@ -150,7 +158,6 @@ The plugin shows error notifications via OpenCode toasts when issues occur:
|
|
|
150
158
|
### Debugging Steps
|
|
151
159
|
|
|
152
160
|
1. Verify environment variables are set correctly
|
|
153
|
-
2. Check your
|
|
161
|
+
2. Check your Kimchi API key is valid
|
|
154
162
|
3. Ensure the provider key in your OpenCode config matches a valid value
|
|
155
163
|
4. Verify the endpoint URL is correct
|
|
156
|
-
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kimchitest/opencode-otel-plugin",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "OpenCode OTEL plugin for
|
|
3
|
+
"version": "1.0.7",
|
|
4
|
+
"description": "OpenCode OTEL plugin for Kimchi - sends usage telemetry",
|
|
5
5
|
"main": "plugin.ts",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"opencode",
|
|
9
9
|
"otel",
|
|
10
10
|
"opentelemetry",
|
|
11
|
-
"
|
|
11
|
+
"kimchi",
|
|
12
12
|
"telemetry"
|
|
13
13
|
],
|
|
14
|
-
"author": "
|
|
14
|
+
"author": "Kimchi Team",
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"repository": {
|
|
17
17
|
"type": "git",
|
package/plugin.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* OpenCode OTEL Plugin for
|
|
2
|
+
* OpenCode OTEL Plugin for Kimchi
|
|
3
3
|
*
|
|
4
|
-
* Sends api_request events to the
|
|
4
|
+
* Sends api_request events to the Kimchi service for usage tracking.
|
|
5
5
|
*
|
|
6
6
|
* REQUIRED ATTRIBUTES:
|
|
7
7
|
* - model: The model identifier (e.g., "glm-5-fp8", "claude-sonnet-4-6")
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
* - "perplexity" - Perplexity
|
|
29
29
|
* - "hosted_vllm" - Hosted vLLM
|
|
30
30
|
* - "bedrock" - AWS Bedrock
|
|
31
|
-
* - "
|
|
31
|
+
* - "kimchi" - Kimchi (serverless models)
|
|
32
32
|
*
|
|
33
33
|
* ENVIRONMENT VARIABLES:
|
|
34
34
|
* - OPENCODE_ENABLE_TELEMETRY: Set to enable telemetry
|
|
35
|
-
* - OPENCODE_OTLP_ENDPOINT: The
|
|
35
|
+
* - OPENCODE_OTLP_ENDPOINT: The Kimchi logs ingest endpoint
|
|
36
36
|
* - OPENCODE_OTLP_HEADERS: Authorization header (format: "Authorization=Bearer <token>")
|
|
37
37
|
*
|
|
38
38
|
* Tested with OpenCode version: 1.2.20
|