Skip to content

Commit e1a9446

Browse files
committed
fix(openinference-mastra): Do not depend on opentelemetry/core
This fixes transient tracing issues with Mastra due to duplicate dependencies
1 parent e346e46 commit e1a9446

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

js/packages/openinference-mastra/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@
4545
"@arizeai/openinference-core": "workspace:*",
4646
"@arizeai/openinference-semantic-conventions": "workspace:*",
4747
"@arizeai/openinference-vercel": "workspace:*",
48-
"@opentelemetry/core": "^1.25.1",
4948
"@opentelemetry/exporter-trace-otlp-proto": "^0.50.0",
5049
"@opentelemetry/semantic-conventions": "^1.33.0"
5150
},
5251
"devDependencies": {
5352
"@opentelemetry/api": ">=1.0.0 <1.9.0",
53+
"@opentelemetry/core": "^1.25.1",
5454
"@opentelemetry/sdk-trace-base": "^1.19.0",
5555
"vitest": "^3.1.3"
5656
}

js/packages/openinference-mastra/src/attributes.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,6 @@ const detectOpenInferenceSpanKindFromMastraSpan = (
7878
* @param span - The Mastra span to enrich.
7979
*/
8080
export const enrichBySpanKind = (span: ReadableSpan) => {
81-
if (getOpenInferenceSpanKind(span)) {
82-
// span has been processed already, skip
83-
return;
84-
}
8581
const kind = detectOpenInferenceSpanKindFromMastraSpan(span);
8682
if (kind) {
8783
addOpenInferenceSpanKind(span, kind);
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export type Mutable<T> = {
2+
-readonly [P in keyof T]: T[P];
3+
};
4+
5+
export type DeeplyMutable<T> = {
6+
-readonly [P in keyof T]: T[P] extends object ? DeeplyMutable<T[P]> : T[P];
7+
};

js/packages/openinference-mastra/src/utils.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,7 @@ export const addOpenInferenceResourceAttributesToMastraSpan = (
2727
*
2828
* @param span - The Mastra span to augment.
2929
*/
30-
export const addOpenInferenceAttributesToMastraSpan = (
31-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
32-
span: ReadableSpan,
33-
) => {
30+
export const addOpenInferenceAttributesToMastraSpan = (span: ReadableSpan) => {
3431
enrichBySpanKind(span);
3532
};
3633

js/pnpm-lock.yaml

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)