[id='enabling-statistics_{context}']
= Enabling {brandname} Statistics
Configure {brandname} to export statistics for Cache Managers and caches.

//Server Guide
ifdef::remote_caches[]
{brandname} Server enables Cache Manager statistics by default.
You must explicitly enable statistics for your caches.
endif::remote_caches[]

.Procedure

Modify your configuration to enable {brandname} statistics in one of the following ways:

* Declarative: Add the `statistics="true"` attribute.
* Programmatic: Call the `.statistics()` method.

.Declarative
[source,xml,options="nowrap",subs=attributes+,role="primary"]
----
include::config_examples/statistics.xml[]
----

.Programmatic
[source,java,options="nowrap",subs=attributes+,role="secondary"]
----
include::code_examples/StatisticsGlobalConfigurationBuilder.java[]
----
