[id='configuring-metrics_{context}']
= Enabling {brandname} tracing

Configure OpenTelemetry tracing, to enable monitoring and tracing of cache operations.

.Procedure

* Pass the system properties to {brandname} Server at startup.
+
Use `-D<property-name>=<property-value>` arguments like in the following example:
+
[source,options="nowrap",subs=attributes+]
----
bin/server.sh -Dinfinispan.tracing.enabled=true -Dotel.traces.exporter=otlp -Dotel.service.name=my-infinispan-server -Dotel.exporter.otlp.endpoint=http://otlp-collector-host:4317
----

.Next steps
To apply any configuration changes, stop the server and repeat the procedure.

[discrete]
== Tracing configuration
{brandname} applies the tracing configuration globally to all caches.

.tracing.properties
[source,options="nowrap",subs=attributes+]
----
include::properties/tracing.properties[]
----
<1> Enables tracing for all cache operations.
<2> Sets the exporter format. The OTLP (OpenTelemetry protocol) exporter is the recommended format to export tracing data.
<3> Specifies the service name associated with the generated tracing spans. The default name is `Infinispan Server`.
<4> Specifies the endpoint URL of the OpenTelemetry collector where the tracing data is sent.

[role="_additional-resources"]
.Additional resources
* link:https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk-extensions/autoconfigure/README.md[OpenTelemetry SDK Autoconfigure]
