vcluster-yaml-mcp-server 1.0.10 → 1.0.12
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/package.json +7 -1
- package/src/instrumentation.js +41 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vcluster-yaml-mcp-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.12",
|
|
4
4
|
"description": "MCP server for querying vcluster YAML configurations using jq",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -33,6 +33,12 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@modelcontextprotocol/sdk": "^1.20.1",
|
|
36
|
+
"@opentelemetry/api": "^1.9.0",
|
|
37
|
+
"@opentelemetry/auto-instrumentations-node": "^0.66.0",
|
|
38
|
+
"@opentelemetry/exporter-trace-otlp-grpc": "^0.207.0",
|
|
39
|
+
"@opentelemetry/resources": "^2.2.0",
|
|
40
|
+
"@opentelemetry/sdk-node": "^0.207.0",
|
|
41
|
+
"@opentelemetry/semantic-conventions": "^1.37.0",
|
|
36
42
|
"ajv": "^8.17.1",
|
|
37
43
|
"ajv-formats": "^3.0.1",
|
|
38
44
|
"chalk": "^5.4.1",
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// OpenTelemetry instrumentation setup
|
|
2
|
+
// This file must be loaded BEFORE the application code
|
|
3
|
+
|
|
4
|
+
import { NodeSDK } from '@opentelemetry/sdk-node';
|
|
5
|
+
import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-grpc';
|
|
6
|
+
import { getNodeAutoInstrumentations } from '@opentelemetry/auto-instrumentations-node';
|
|
7
|
+
|
|
8
|
+
// Configure OTLP exporter
|
|
9
|
+
const traceExporter = new OTLPTraceExporter({
|
|
10
|
+
url: process.env.OTEL_EXPORTER_OTLP_ENDPOINT || 'http://opentelemetry-collector.tempo.svc.cluster.local:4317',
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
// Initialize OpenTelemetry SDK with minimal config
|
|
14
|
+
// The SDK will automatically detect and set up resource attributes
|
|
15
|
+
const sdk = new NodeSDK({
|
|
16
|
+
serviceName: process.env.OTEL_SERVICE_NAME || 'vcluster-yaml-mcp-server',
|
|
17
|
+
traceExporter,
|
|
18
|
+
instrumentations: [
|
|
19
|
+
getNodeAutoInstrumentations({
|
|
20
|
+
// Disable file system instrumentation (too noisy)
|
|
21
|
+
'@opentelemetry/instrumentation-fs': {
|
|
22
|
+
enabled: false,
|
|
23
|
+
},
|
|
24
|
+
}),
|
|
25
|
+
],
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
// Start the SDK
|
|
29
|
+
sdk.start();
|
|
30
|
+
|
|
31
|
+
console.log('OpenTelemetry tracing initialized');
|
|
32
|
+
console.log(` Service: ${process.env.OTEL_SERVICE_NAME || 'vcluster-yaml-mcp-server'}`);
|
|
33
|
+
console.log(` Exporter: ${process.env.OTEL_EXPORTER_OTLP_ENDPOINT || 'http://opentelemetry-collector.tempo.svc.cluster.local:4317'}`);
|
|
34
|
+
|
|
35
|
+
// Graceful shutdown
|
|
36
|
+
process.on('SIGTERM', () => {
|
|
37
|
+
sdk.shutdown()
|
|
38
|
+
.then(() => console.log('OpenTelemetry SDK shut down successfully'))
|
|
39
|
+
.catch((error) => console.error('Error shutting down OpenTelemetry SDK', error))
|
|
40
|
+
.finally(() => process.exit(0));
|
|
41
|
+
});
|