Conditional Trace is a service located on a service context, and the output generated from a trace is sent to that service context.
If you want to enable conditional trace, you are required to take the following steps.
Use the
mzsh topo
command to add the akka service as shown below. You must specify a name for the akka service, e gakka-trace-cluster
, and a value forstartup-natures
. Thestartup-natures
must have the same value as thestartup-natures
in the SC on which you are running Conditional Trace.mzsh topo set -l services:custom/obj:akka '{ <akka service name> { template: "1/standard/basic" config { startup-natures: [<startup-nature>] } } }'
See the example below, where the akka service is named
akka-trace-cluster
.Example - Adding the akka service
mzsh topo set -l services:custom/obj:akka '{ akka-trace-cluster { template: "1/standard/basic" config { startup-natures: [ct_cluster] } } }'
Use the
mzsh topo
command to create a new Service Context, which will be attached toct_cluster
. You must use the samestartup-natures
name that you enter for the akka service in step 1.mzsh topo set -l pico:sc-ct '{ template:mz.standard-sc config.properties { mz.servicehost.port.range:"<port range>" mz.servicehost.natures:"<startup-natures>" } }'
See the example below, where the service context is named
sc-ct
.Example - Creating the Service Context
mzsh topo set -l pico:sc-ct '{ template:mz.standard-sc config.properties { mz.servicehost.port.range:"7001-7050" mz.servicehost.natures:"ct_cluster" } }'
Use the
mzsh topo
command to add the conditional trace service, which must be namedtrace
. You must use the same akka service name that you enter for the akka configuration in step 2, which you must also enter as the value for theakka-cluster
, shown below as<akka service name>
.mzsh topo set -l services:custom/obj:conditional-trace '{ trace { start-after=["akka/<akka service name>"] template: "1/standard/basic" config { akka-cluster: "<akka service name>" } } }'
See the example below, where the akka service name is
akka-trace-cluster
, which is also entered as the value for theakka-cluster
.Example - Adding the conditional trace service
mzsh topo set -l services:custom/obj:conditional-trace '{ trace { start-after=["akka/akka-trace-cluster"] template: "1/standard/basic" config { akka-cluster: "akka-trace-cluster" } } }'
Startup the SCs and startup the conditional trace service:
$ mzsh startup platform sc-ct $ mzsh system start $ mzsh service start