Skip to content

Commit

Permalink
added class-level Javadoc + removed lowercasing
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Wert <alexander.wert@elastic.co>
  • Loading branch information
AlexanderWert committed Nov 14, 2023
1 parent 23a4dc7 commit 3d7b883
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/main/java/io/opentelemetry/semconv/AttributeKeyTemplate.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,20 @@

import io.opentelemetry.api.common.AttributeKey;
import java.util.List;
import java.util.Locale;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.function.Function;

/**
* This class provides a handle for creating and caching dynamic / template-type attributes of the
* form <b>&lt;prefix&gt;.&lt;key&gt;</b>. The &lt;prefix&gt; is fixed for a template instance while
* {@link AttributeKey}s can be created and are cached for different values of the &lt;key&gt; part.
*
* <p>An example template-type attribute is the set of attributes for HTTP headers:
* <b>http.request.header.&lt;key&gt;</b>
*
* @param <T> The type of the nested {@link AttributeKey}s.
*/
public final class AttributeKeyTemplate<T> {

private final String prefix;
Expand Down Expand Up @@ -56,7 +65,7 @@ static AttributeKeyTemplate<List<Double>> doubleArrayKeyTemplate(String prefix)
}

private AttributeKey<T> createAttributeKey(String keyName) {
String key = prefix + "." + keyName.toLowerCase(Locale.ROOT);
String key = prefix + "." + keyName;
return keyBuilder.apply(key);
}

Expand Down

0 comments on commit 3d7b883

Please sign in to comment.