java.lang.Object
io.opentelemetry.instrumentation.api.incubator.config.internal.UserConfig

public class UserConfig extends Object
Configuration that controls capturing the enduser.* or user.* semantic attributes.

When the v3 preview is enabled, this configuration reads the corresponding user.* properties instead. Legacy enduser.* properties and their associated attributes are not supported when v3 preview is enabled.

The enduser.* semantic attributes are not captured by default, due to this text in the specification:

Given the sensitive nature of this information, SDKs and exporters SHOULD drop these attributes by default and then provide a configuration parameter to turn on retention for use cases where the information is required and would not violate any policies or regulations.

Capturing of the enduser.* semantic attributes can be individually enabled by configuring the following properties:

 otel.instrumentation.common.enduser.id.enabled=true
 otel.instrumentation.common.enduser.role.enabled=true
 otel.instrumentation.common.enduser.scope.enabled=true
 

When v3 preview is enabled, capturing of the user.* semantic attributes can be individually enabled by configuring the following properties:

 otel.instrumentation.common.user.name.enabled=true
 otel.instrumentation.common.user.roles.enabled=true
 

This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.

  • Method Details

    • isAnyEnabled

      public boolean isAnyEnabled()
      Returns true if capturing of any identity semantic attribute is enabled.

      This flag can be used by capturing instrumentations to bypass all identity attribute capturing. In v3 preview mode, this corresponds to the user.* attributes; otherwise it corresponds to the enduser.* attributes.

    • isNameEnabled

      public boolean isNameEnabled()
      Returns true if capturing the id semantic attribute is enabled.

      In v3 preview mode, this controls the user.name attribute; otherwise it controls the enduser.id attribute.

    • isRolesEnabled

      public boolean isRolesEnabled()
      Returns true if capturing the role(s) semantic attribute is enabled.

      In v3 preview mode, this controls the user.roles attribute; otherwise it controls the enduser.role attribute.

    • isScopeEnabled

      public boolean isScopeEnabled()
      Returns true if capturing the enduser.scope semantic attribute is enabled.

      This is always disabled in v3 preview mode, since enduser.scope has no user.* equivalent.