Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document configuration options for java agent enduser attribute collection #3982

Merged
55 changes: 54 additions & 1 deletion content/en/docs/languages/java/automatic/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ linkTitle: Configuration
weight: 10
aliases: [agent-config]
# prettier-ignore
cSpell:ignore: akka armeria classloaders couchbase Customizer datasource dbcp Dotel dropwizard dubbo finatra hikari hikaricp HSET httpasyncclient httpclient hystrix jaxrs jaxws jedis jodd kotlinx logback logmanager mojarra myfaces okhttp oshi pekko rabbitmq ratpack rediscala redisson restlet rocketmq serverlessapis spymemcached twilio vaadin vertx vibur webflux webmvc
cSpell:ignore: akka armeria classloaders couchbase Customizer datasource dbcp Dotel dropwizard dubbo enduser finatra hikari hikaricp HSET httpasyncclient httpclient hystrix jaxrs jaxws jedis jodd kotlinx logback logmanager mojarra myfaces okhttp oshi pekko rabbitmq ratpack rediscala redisson restlet rocketmq serverlessapis spymemcached twilio vaadin vertx vibur webflux webmvc
---

## SDK Autoconfiguration
Expand Down Expand Up @@ -228,6 +228,59 @@ span link connecting it to the producer trace.
> **Note**: The property/environment variable names listed in the table are
> still experimental, and thus are subject to change.

### Capturing Enduser Attributes
svrnm marked this conversation as resolved.
Show resolved Hide resolved

You can configure the agent to capture
[general identity attributes](/docs/specs/semconv/general/attributes/#general-identity-attributes)
(`enduser.id`, `enduser.role`, `enduser.scope`) from instrumentation libraries
like
[JavaEE/JakartaEE Servlet](https://github.com/open-telemetry/opentelemetry-java-instrumentation/tree/main/instrumentation/servlet)
and
[Spring Security](https://github.com/open-telemetry/opentelemetry-java-instrumentation/tree/main/instrumentation/spring/spring-security-config-6.0).

This functionality is disabled by default, with the ability to enable for
individual attributes.
jaydeluca marked this conversation as resolved.
Show resolved Hide resolved

{{% config_option
name="otel.instrumentation.common.enduser.enabled"
default=false
%}} Common flag for enabling/disabling enduser attributes. {{% /config_option %}}

{{% config_option
name="otel.instrumentation.common.enduser.id.enabled"
default=false
%}} Determines whether to capture `enduser.id` semantic attribute. {{% /config_option %}}

{{% config_option
name="otel.instrumentation.common.enduser.role.enabled"
default=false
%}} Determines whether to capture `enduser.role` semantic attribute. {{% /config_option %}}

{{% config_option
name="otel.instrumentation.common.enduser.scope.enabled"
default=false
%}} Determines whether to capture `enduser.scope` semantic attribute. {{% /config_option %}}

#### Spring Security

For users of Spring Security who use custom
[granted authority prefixes](https://docs.spring.io/spring-security/reference/servlet/authorization/architecture.html#authz-authorities),
you can use the following properties to strip those prefixes from the
`enduser.*` attribute values to better represent the actual role and scope
names:

{{% config_option
name="otel.instrumentation.spring-security.enduser.role.granted-authority-prefix"
default=ROLE_
%}} Prefix of granted authorities identifying roles to capture in the `enduser.role`
semantic attribute. {{% /config_option %}}

{{% config_option
name="otel.instrumentation.spring-security.enduser.scope.granted-authority-prefix"
default=SCOPE_
%}} Prefix of granted authorities identifying scopes to capture in the `enduser.scopes`
semantic attribute. {{% /config_option %}}

## Suppressing specific auto-instrumentation

### Disabling the agent entirely
Expand Down
4 changes: 4 additions & 0 deletions static/refcache.json
Original file line number Diff line number Diff line change
Expand Up @@ -1515,6 +1515,10 @@
"StatusCode": 200,
"LastSeen": "2024-01-30T16:14:53.797365-05:00"
},
"https://docs.spring.io/spring-security/reference/servlet/authorization/architecture.html#authz-authorities": {
"StatusCode": 206,
"LastSeen": "2024-02-12T22:02:33.483262-05:00"
},
"https://docs.spring.io/spring/docs/current/spring-framework-reference/core.html#aop": {
"StatusCode": 206,
"LastSeen": "2024-01-30T20:32:51.933581-05:00"
Expand Down
Loading