Hi, I鈥檓 integrating OpenTelemetry with Phoenix in my Java Spring Boot app using the OpenTelemetry Java SDK (OTLP HTTP exporter). I added a project attribute in the resource configuration like this:
Resource resource = Resource.getDefault()
.merge(Resource.create(Attributes.of(
AttributeKey.stringKey("service.name"), "demoapp",
AttributeKey.stringKey("project"), "my-project"
)));However, traces are still going to the default project. Could you confirm the correct way to configure the project attribute so that traces route properly? Thanks!
You need to set the project attribute using the semantic key openinference.project.name (or SEMRESATTRS_PROJECT_NAME), not just "project". For Java, use: LBKSResource resource = Resource.getDefault() .merge(Resource.create(Attributes.of( AttributeKey.stringKey("service.name"), "demoapp", AttributeKey.stringKey("openinference.project.name"), "my-project" )));LBKSor, if using the OpenInference semantic conventions: LBKSResource resource = Resource.getDefault() .merge(Resource.create(Attributes.of( AttributeKey.stringKey("service.name"), "demoapp", AttributeKey.stringKey(SEMRESATTRS_PROJECT_NAME), "my-project" )));LBKSThis ensures Phoenix groups traces under "my-project" instead of the default project, as documented in the official examples and SDK references.Would you like more detail or a full example?Sources:
- openinference-java.md (see Resource config)
- SpringAI.java example
- SDK API Reference
馃挕聽Hint: Mention RunLLM in the thread for followups.
Thanks! The bot's reply resolved my issue.
