Class S2SAuthZMetrics

java.lang.Object
io.confluent.security.auth.s2s.S2SAuthZMetrics

public class S2SAuthZMetrics extends Object
Per-layer S2S AuthZ decision metric: s2s-authz-checks-rate, tagged layer (L2/L3b), outcome (allow/deny/continue/abstain), and tokenType.

Recorded in S2SConnectionLevelAuthZProvider.findRule(KafkaPrincipal, Set, String, Action) (L2) and S2SServiceLevelAuthZProvider.findRule(KafkaPrincipal, Set, String, Action) (L3b).

Kafka's Sensor carries no tags of its own -- tags live on the MetricName attached to a sensor at construction time (see IpFilteringAuthMetrics's error-type tag and EmbeddedAuthorizer.AuthorizerMetrics's per- AuthorizeResult sensor map for the precedent this follows). layer and outcome are small closed sets (5 valid combinations total), and the LAT tokenType claim is bounded in practice to the two known token types plus "none"/"other" fallbacks, so this class pre-builds one tagged sensor per valid (layer, outcome, tokenType-bucket) combination up front rather than forking sensor names per layer.

  • Field Details

  • Constructor Details

    • S2SAuthZMetrics

      public S2SAuthZMetrics(org.apache.kafka.common.metrics.Metrics metrics)
  • Method Details

    • record

      public void record(String layer, String outcome, String tokenType)
      Records one S2S AuthZ decision. layer is LAYER_L2 or LAYER_L3B; outcome must be one of the values valid for that layer (see VALID_OUTCOMES_BY_LAYER); tokenType is the raw MultiTenantPrincipal#tokenType() claim (may be null) and is bucketed internally to keep the tag cardinality bounded.