Watch Aspire live streamsDocsTry Aspire

JavaAppResource.withOtelAgent

Method
📦 Aspire.Hosting.Java v13.6.5-preview.1.26559.7
interface JavaAppResource {
// ... omitted for brevity
withOtelAgent(agentPath: string): JavaAppResource;
}

Signature

methodwithOtelAgentbuilder
Runs the application with the OpenTelemetry Java agent so it exports traces, metrics, and logs to Aspire.
withOtelAgent(agentPath: string): JavaAppResource
agentPathstringThe path to the `opentelemetry-javaagent.jar` file.
JavaAppResource

Defined on

This method is defined on the following type: