@pingops/otel 0.3.0 → 0.4.0
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 +27 -4
- package/dist/index.cjs +559 -149
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +18 -56
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +18 -56
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +560 -150
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -49,24 +49,47 @@ const processor = new PingopsSpanProcessor({
|
|
|
49
49
|
- `baseUrl: string` - PingOps backend URL (required)
|
|
50
50
|
- `debug?: boolean` - Enable debug logging (default: `false`)
|
|
51
51
|
- `serviceName: string` - Service name for resource identification (required)
|
|
52
|
-
- `
|
|
53
|
-
- `headersDenyList?: string[]` - List of headers to exclude (case-insensitive, takes precedence)
|
|
52
|
+
- `transforms?: HttpTransformConfig` - Outbound transform rules for request/response headers, bodies, and query params
|
|
54
53
|
- `domainAllowList?: DomainRule[]` - Domain allow list rules
|
|
55
54
|
- `domainDenyList?: DomainRule[]` - Domain deny list rules
|
|
55
|
+
- `llmMonitoring?: LlmMonitoringConfig` - Optional GenAI usage enrichment (disabled by default)
|
|
56
56
|
- `batchSize?: number` - Batch size for sending spans, only used in batched mode (default: `50`)
|
|
57
57
|
- `batchTimeout?: number` - Batch timeout in milliseconds, only used in batched mode (default: `5000`)
|
|
58
58
|
- `exportMode?: 'immediate' | 'batched'` - Span export mode:
|
|
59
59
|
- **batched**: Recommended for production environments with long-running processes. Spans are batched and exported in groups for optimal performance (default)
|
|
60
60
|
- **immediate**: Recommended for short-lived environments such as serverless functions. Spans are exported immediately to prevent data loss when the process terminates
|
|
61
61
|
|
|
62
|
+
### LLM Monitoring (Opt-In)
|
|
63
|
+
|
|
64
|
+
```ts
|
|
65
|
+
const processor = new PingopsSpanProcessor({
|
|
66
|
+
apiKey: "your-api-key",
|
|
67
|
+
baseUrl: "https://api.pingops.com",
|
|
68
|
+
serviceName: "my-service",
|
|
69
|
+
llmMonitoring: {
|
|
70
|
+
enabled: true,
|
|
71
|
+
streaming: true,
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
When enabled, the processor enriches matching outbound LLM spans with:
|
|
77
|
+
|
|
78
|
+
- OTel GenAI attributes (provider, operation, model, token usage)
|
|
79
|
+
- PingOps token attributes (`pingops.gen_ai.usage.*`) for backend cost computation
|
|
80
|
+
|
|
62
81
|
### Domain Rules
|
|
63
82
|
|
|
64
83
|
```typescript
|
|
65
84
|
interface DomainRule {
|
|
66
85
|
domain: string; // Exact or suffix match (e.g., '.github.com')
|
|
67
86
|
paths?: string[]; // Path prefix matches
|
|
68
|
-
|
|
69
|
-
|
|
87
|
+
transforms?: HttpTransformConfig; // Domain-specific transform overrides global transforms
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
interface HttpTransformConfig {
|
|
91
|
+
applyDefaultSensitiveHeaderRedaction?: boolean; // default true
|
|
92
|
+
rules?: HttpTransformRule[];
|
|
70
93
|
}
|
|
71
94
|
```
|
|
72
95
|
|