@arizeai/openinference-instrumentation-beeai 1.5.0 → 1.5.1
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
CHANGED
|
@@ -78,3 +78,37 @@ console.log(`Agent 🤖 : `, response.result.text);
|
|
|
78
78
|
```
|
|
79
79
|
|
|
80
80
|
For more information on OpenTelemetry Node.js SDK, see the [OpenTelemetry Node.js SDK documentation](https://opentelemetry.io/docs/instrumentation/js/getting-started/nodejs/).
|
|
81
|
+
|
|
82
|
+
## Using a Custom Tracer Provider
|
|
83
|
+
|
|
84
|
+
You can specify a custom tracer provider when creating the BeeAI instrumentation. This is useful when you want to use a non-global tracer provider or have more control over the tracing configuration.
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
import { NodeTracerProvider } from "@opentelemetry/sdk-trace-node";
|
|
88
|
+
import { Resource } from "@opentelemetry/resources";
|
|
89
|
+
import { SEMRESATTRS_PROJECT_NAME } from "@arizeai/openinference-semantic-conventions";
|
|
90
|
+
import { BeeAIInstrumentation } from "@arizeai/openinference-instrumentation-beeai";
|
|
91
|
+
import * as beeaiFramework from "beeai-framework";
|
|
92
|
+
|
|
93
|
+
// Create a custom tracer provider
|
|
94
|
+
const customTracerProvider = new NodeTracerProvider({
|
|
95
|
+
resource: new Resource({
|
|
96
|
+
[SEMRESATTRS_PROJECT_NAME]: "my-beeai-project",
|
|
97
|
+
}),
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
// Pass the custom tracer provider to the instrumentation
|
|
101
|
+
const beeAIInstrumentation = new BeeAIInstrumentation({
|
|
102
|
+
tracerProvider: customTracerProvider,
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
// Manually instrument the BeeAI framework
|
|
106
|
+
beeAIInstrumentation.manuallyInstrument(beeaiFramework);
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Alternatively, you can set the tracer provider after creating the instrumentation:
|
|
110
|
+
|
|
111
|
+
```typescript
|
|
112
|
+
const beeAIInstrumentation = new BeeAIInstrumentation();
|
|
113
|
+
beeAIInstrumentation.setTracerProvider(customTracerProvider);
|
|
114
|
+
```
|