Persistent Actor configuration

Persistent actors need to be selected for telemetry.

Note

Persistent actors are not instrumented automatically. They must have instrumentation explicitly enabled - see sections below for how to.

Below is an example of instrumenting entities according to their path or class:

Path
cinnamon.akka {
  persistence.entities {
    // sharded:EntityFooName will expand to /system/sharding/EntityFooName/*
    "sharded:EntityFooName" {
      report-by = group
    }
  }
}
Class
cinnamon.akka {
  persistence.entities {
    "/user/a/*" {
      report-by = class
    }
  }
}

The path example above includes use of the sharded:EntityFooName shortcut to select all paths for the EntityFooName entity in your system.

Note

You can specify full entity path names (e.g., /system/sharding/EntityFooName/* instead of using sharded:EntityFooName) if desired.

The additional command and event type dimensions can be enabled via the opt-in command/event type dimensions.

All the existing actors selections and groupings can be used for persistent actor selections such as by-class, by-path as well as wildcards and template groups. See the actor configuration for more details on how to use actor selections and the report-by option. The important difference from the actor configuration is that the configuration is specified in the different configuration namespace cinnamon.akka.persistence.entities and Cinnamon Agent will only instrument persistent actors and ignore all the other actors for the selection. The latter is useful for example for sharded actors (see the by-path example above) because some other actors (e.g. Shard or ShardRegion) will share the same actor path with the persistent actors.

Instrumenting all entities via templating

It is possible to configure all entities to report by using sharded:? as the selector:

Entities
cinnamon.akka {
  persistence.entities {
    // sharded:? will expand to /system/sharding/?/*
    "sharded:?" {
      report-by = group
    }
  }
}

This will use templating to create one reporting group of metrics per unique entity name (e.g., EntityFooName) at runtime.

Note

Reporting all entities this way may have an impact on performance, apply with care.

Dimensions

Opt-in dimensions are available that enable collecting metrics by command or event type. By default, these dimensions are off but can be enabled for each selection separately:

command-type
cinnamon.akka {
  persistence.entities {
    "/user/*" {
      report-by = class
      command-type = on
    }
  }
}
event-type
cinnamon.akka {
  persistence.entities {
    "/user/*" {
      report-by = class
      event-type = on
    }
  }
}