Add Principal attributes to metricsv3.16+

Add authenticated Principal attributes to the OTEL plugin’s request count and bandwidth metrics by enabling enable_principal_attribute.

In the example:

  • enable_request_metrics adds request count metrics.
  • enable_bandwidth_metrics adds request and response size metrics.
  • enable_principal_attribute adds authenticated Principal attributes to the enabled metrics.

When a request carries an authenticated Principal managed by Kong Identity, the plugin exports http.server.request.count, http.server.request.size, and http.server.response.size with the kong.auth.principal.id and kong.auth.principal.display_name attributes.

Prerequisites

Set up the plugin

Help us make these docs great!

Kong Developer docs are open source. If you find these useful and want to make them better, contribute today!