Unable to Set Project Name in Instrumentation Code
Hi Team. I am unable to set the project name before instrumenting. I am facing "Projects are a work in progress go to your default project". Below is the code I am using for instrumenting.
import os
from openinference.instrumentation.llama_index import LlamaIndexInstrumentor
from opentelemetry import trace as trace_api
from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
from opentelemetry.sdk import trace as trace_sdk
from opentelemetry.sdk.resources import Resource
from opentelemetry.sdk.trace.export import SimpleSpanProcessor
from openinference.semconv.resource import ResourceAttributes
resource = Resource(attributes={
ResourceAttributes.PROJECT_NAME: 'genai-assistant'
})
def instrument():
# resource = Resource(attributes={})
tracer_provider = trace_sdk.TracerProvider(resource=resource)
span_exporter = OTLPSpanExporter(endpoint=os.getenv("COLLECTOR_ENDPOINT","http://phoenix:6006/v1/traces"))
span_processor = SimpleSpanProcessor(span_exporter=span_exporter)
tracer_provider.add_span_processor(span_processor=span_processor)
trace_api.set_tracer_provider(tracer_provider=tracer_provider)
LlamaIndexInstrumentor().instrument()
