open-telemetry / open-telemetry/opentelemetry-java

More implementation for io.opentelemetry.api.common.AttributeKey

Open
#7,175 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature Request
Dominant language
Java
Stars
2.5k
Forks
1k
Avg merge
3d 17h
Merged PRs (30d)
58

Description

Currently, we have only one implementation io.opentelemetry.api.internal.InternalAttributeKeyImpl for io.opentelemetry.api.common.AttributeKey, and we may have more implementation for that, for example:

  1. Make the all attributes in io.opentelemetry.semconv.trace.attributes.SemanticAttributes SemanticAttributeImpl
public class SemanticAttributeImpl<T> implements AttributeKey<T> {}
  1. Make the SemanticAttributes that can be recored into metrics MetricsSemanticAttributes
public class MetricsSemanticAttributes<T> extends SemanticAttributeImpl {}
  1. Make the other attributes CustomAttributeImpl

If AttributeKey is classified, we can do a lot of performance optimisation. For example, we can filter out MetricsAttributes of SemanticAttributes by just calling xx.getclass().equals(MetricsAttributes) instead of traversing it.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading io.opentelemetry.api.common.AttributeKey, io.opentelemetry.api.internal.InternalAttributeKeyImpl, and io.opentelemetry.semconv.trace.attributes.SemanticAttributes. Clarify the proposed classification of semantic, metrics, and custom attributes, then determine the expected performance behavior and validation needed for the new implementations.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.