Akka Typed configuration

Lightbend Telemetry supports instrumenting Akka Typed.

All Akka Typed actors share the same Actor class with custom functionality defined in the Behavior. For that reason, reporting metrics aggregated by class for typed actors is not supported and reporting by instance, group or tag should be used.

The untyped actor configuration documentation provides detailed examples how to select and report by instance, group and tag.

Actor configuration

A typed ActorSystem has a top level guardian behavior passed in when creating the ActorSystem. To monitor it use the /user path:

cinnamon.akka.actors {
  "/user" {
     report-by = instance
  }
}

Other actors they can be configured either by group, instance or by tag. For example if the guardian actor creates two children under /user/a and /user/b their child actors can be monitored as follows:

cinnamon.akka.actors {
  "/user/a/*" {
     report-by = group
  }
}
cinnamon.akka.actors {
  "/user/b/*" {
     report-by = instance
  }
}

The child actors of a will get reported per instance. The child actors of b will be reported together as a group.

Actor tags

Actor tags can also be used to group actors together for reporting.

For example all children of /user/t/ will be reported by tag if they have any.

cinnamon.akka.actors {
  "/user/t/*" {
     report-by = tag
     excludes = ["tag:exclude-me"]
  }
}

To give an actor a tag create it with an ActorTags props:

val includedTagProps = ActorTags("tag1", "tag2") // actors under /user/t/* with these tags would be included
val excludedTagProps = ActorTags("tag1", "exclude-me") // actors under /user/t/* with these tags would be excluded

Sharding configuration

Sharded actors are created under /system/sharding/<entity key name>/<shard-id>/<entity-id> and can be monitored as a group or per instance.

To configure all sharded actors for the shard type name type-name-1 to be reported together:

cinnamon.akka.actors {
    "sharded-group" {
      report-by = group
      includes = ["/system/sharding/type-name-1/*"]
      excludes = ["akka.cluster.sharding.Shard"]
  }
}

Or via instance for a shard type type-name-2:

cinnamon.akka.actors {
    "sharded-instance" {
      report-by = instance
      includes = ["/system/sharding/type-name-2/*"]
      excludes = ["akka.cluster.sharding.Shard"]
  }
}

The akka.cluster.sharding.Shard is parent of the entity actors when using sharding so is excluded.