Hi phoenix team, I want to update the project that collects the traces from a specific instance of a typescript server I set up using Manual Instrumentation. I tried out different variations but it always seems to send it to default project. Any pointers here that I can try to send the traces to a named project? Thanks in advance!
To send traces to a named project from a TypeScript server using manual instrumentation, you need to set the project name in the Resource attributes for the trace provider. Here's how you can do it:
1. Set Resource Attributes: Define the project name in the Resource attributes.
2. Configure Tracer Provider: Use the TracerProvider to set up the trace provider with the specified resource attributes.
3. Add Span Processor: Add a span processor to handle the spans.
Here's a code snippet to illustrate this:
```
// Define the project name in the Resource attributes const resource = new Resource({ 'openinference.project.name': '<your-project-name> ', });
// Configure the tracer provider const provider = new NodeTracerProvider({ resource: resource, });
// Set up the span exporter const exporter = new CollectorTraceExporter({ url: '[http://phoenix::6006/v1/traces](http:://phoenix:6006/v1/traces)', });
// Add the span processor provider.addSpanProcessor(new SimpleSpanProcessor(exporter));
// Register the tracer provider provider.register();
LBKSThis setup ensures that all traces are sent to the specified project instead of the default project.
Would you like more details on any specific part of this setup?
Sources:
- [Customize Traces](https://docs.arize.com/phoenix/tracing/how-to-tracing/customize-traces#aoYulGx9VhDW)
- [GitHub Issue #3375](https://github.com/Arize-ai/phoenix/issues/3375)
馃挕聽Hint: Mention RunLLM in the thread for followups.
