Remove MoreAttributes
DELETE
instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/MoreAttributes.java
-/*
- * 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";
-}

MODIFY
instrumentation-core/servlet-2.2/src/main/java/io/opentelemetry/instrumentation/servlet/ServletHttpServerTracer.java
instrumentation-core/servlet-2.2/src/main/java/io/opentelemetry/instrumentation/servlet/ServletHttpServerTracer.java
@@ -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());
}
}

Remove MoreAttributes (#1417)