@mastra/deployer 0.15.2 → 0.15.3-alpha.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.
|
@@ -15,6 +15,19 @@ import { telemetry } from './telemetry-config.mjs';
|
|
|
15
15
|
|
|
16
16
|
globalThis.___MASTRA_TELEMETRY___ = true;
|
|
17
17
|
|
|
18
|
+
function parseHeaders(headerString) {
|
|
19
|
+
const headers = {}
|
|
20
|
+
if (!headerString) return headers;
|
|
21
|
+
|
|
22
|
+
const headersStringPairs = headerString.split(',');
|
|
23
|
+
for (const pair of headersStringPairs) {
|
|
24
|
+
const [key, value] = pair.split('=').map(s => s.trim());
|
|
25
|
+
if (key && value) headers[key] = value;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return headers;
|
|
29
|
+
}
|
|
30
|
+
|
|
18
31
|
class CompositeExporter {
|
|
19
32
|
constructor(exporters) {
|
|
20
33
|
this.exporters = exporters;
|
|
@@ -27,7 +40,7 @@ class CompositeExporter {
|
|
|
27
40
|
return httpTarget === "/api/telemetry";
|
|
28
41
|
}).map((span) => span.spanContext().traceId)
|
|
29
42
|
);
|
|
30
|
-
const filteredSpans = spans.filter((span) => !telemetryTraceIds.has(span.spanContext().traceId));
|
|
43
|
+
const filteredSpans = spans.filter((span) => !telemetryTraceIds.has(span.spanContext().traceId) && !span.instrumentationScope?.name?.startsWith('@opentelemetry'));
|
|
31
44
|
if (filteredSpans.length === 0) {
|
|
32
45
|
resultCallback({ code: ExportResultCode.SUCCESS });
|
|
33
46
|
return;
|
|
@@ -104,9 +117,15 @@ async function getExporters(config) {
|
|
|
104
117
|
headers: config.export.headers,
|
|
105
118
|
}));
|
|
106
119
|
} else {
|
|
120
|
+
const exporterEndpoint = config.export.endpoint ?? process.env.OTEL_EXPORTER_OTLP_ENDPOINT
|
|
121
|
+
let exporterHeaders = config.export.headers
|
|
122
|
+
if (!exporterHeaders) {
|
|
123
|
+
exporterHeaders = parseHeaders(process.env.OTEL_EXPORTER_OTLP_HEADERS)
|
|
124
|
+
}
|
|
125
|
+
|
|
107
126
|
exporters.push(new OTLPHttpExporter({
|
|
108
|
-
url:
|
|
109
|
-
headers:
|
|
127
|
+
url: exporterEndpoint,
|
|
128
|
+
headers: exporterHeaders,
|
|
110
129
|
}));
|
|
111
130
|
}
|
|
112
131
|
} else if (config.export?.type === 'custom') {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/deployer",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.3-alpha.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
"rollup-plugin-esbuild": "^6.2.1",
|
|
112
112
|
"rollup-plugin-node-externals": "^8.0.1",
|
|
113
113
|
"typescript-paths": "^1.5.1",
|
|
114
|
-
"@mastra/server": "^0.15.
|
|
114
|
+
"@mastra/server": "^0.15.3-alpha.0"
|
|
115
115
|
},
|
|
116
116
|
"devDependencies": {
|
|
117
117
|
"@hono/node-server": "^1.17.1",
|
|
@@ -132,9 +132,9 @@
|
|
|
132
132
|
"vitest": "^3.2.4",
|
|
133
133
|
"zod": "^3.25.67",
|
|
134
134
|
"@internal/lint": "0.0.34",
|
|
135
|
-
"@
|
|
136
|
-
"@mastra/
|
|
137
|
-
"@
|
|
135
|
+
"@internal/types-builder": "0.0.9",
|
|
136
|
+
"@mastra/mcp": "^0.11.3-alpha.0",
|
|
137
|
+
"@mastra/core": "0.15.3-alpha.0"
|
|
138
138
|
},
|
|
139
139
|
"peerDependencies": {
|
|
140
140
|
"@mastra/core": ">=0.15.2-0 <0.16.0-0",
|