Remove MoreAttributes (#1417)
This commit is contained in:
parent
57301e3fe7
commit
9e37231662
|
@ -1,13 +0,0 @@
|
|||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package io.opentelemetry.instrumentation.api;
|
||||
|
||||
public class MoreAttributes {
|
||||
public static final String HTTP_QUERY = "http.query.string";
|
||||
public static final String HTTP_FRAGMENT = "http.fragment.string";
|
||||
|
||||
public static final String USER_NAME = "user.principal";
|
||||
}
|
|
@ -7,9 +7,9 @@ package io.opentelemetry.instrumentation.servlet;
|
|||
|
||||
import io.grpc.Context;
|
||||
import io.opentelemetry.context.propagation.TextMapPropagator.Getter;
|
||||
import io.opentelemetry.instrumentation.api.MoreAttributes;
|
||||
import io.opentelemetry.instrumentation.api.tracer.HttpServerTracer;
|
||||
import io.opentelemetry.trace.Span;
|
||||
import io.opentelemetry.trace.attributes.SemanticAttributes;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.security.Principal;
|
||||
|
@ -94,7 +94,7 @@ public abstract class ServletHttpServerTracer<RESPONSE>
|
|||
public void setPrincipal(Span span, HttpServletRequest request) {
|
||||
Principal principal = request.getUserPrincipal();
|
||||
if (principal != null) {
|
||||
span.setAttribute(MoreAttributes.USER_NAME, principal.getName());
|
||||
span.setAttribute(SemanticAttributes.ENDUSER_ID, principal.getName());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue