Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

WithOtelAgent

Method
📦 Aspire.Hosting.Java v17.0.0-preview.1.26565.2
func (JavaAppResource) 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().

Applies to

This method applies to the following types: