Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

JavaAppResource.WithOtelAgent

Method
📦 Aspire.Hosting.Java v17.0.0-preview.1.26565.2
type JavaAppResource interface {
// ... 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

A reference to the IResourceBuilder.

Returns a handle; failures surface later via Err().

Defined on

This method is defined on the following type: