ReadWriteLogRecord default getEventName() always returns null
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 90/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- java
- Domain
- observability-sre
Research direction
Start with sdk/logs/src/main/java/io/opentelemetry/sdk/logs/ReadWriteLogRecord.java at getEventName() on line 61, and compare it with the other default getters that delegate to toLogRecordData(). Done means an implementation using only the two abstract methods receives the event name returned by its LogRecordData; run the relevant sdk/logs tests and add coverage for that case.
Written by the indexing model from the issue text.
Description
Describe the bug
ReadWriteLogRecord.getEventName() has a default implementation that always returns null, even when toLogRecordData().getEventName() returns a value. Every other default getter on the interface (getAttributes(), getSeverity(), getObservedTimestampEpochNanos(), ...) delegates to toLogRecordData().
Steps to reproduce
Implement ReadWriteLogRecord with only the two abstract methods (setAttribute() and toLogRecordData()), return a LogRecordData whose getEventName() is "my.event", then call getEventName() on the record.
What did you expect to see?
"my.event", consistent with the Javadoc ("Returns the log record event name, or null if none is set") and with the other default getters on the same interface.
What did you see instead?
null. ReadWriteLogRecord.getEventName() (sdk/logs/src/main/java/io/opentelemetry/sdk/logs/ReadWriteLogRecord.java line 61) returns null unconditionally. The SDK's own SdkReadWriteLogRecord is unaffected because it overrides the method.
Same shape as #8501, where the default getObservedTimestampEpochNanos() returned the wrong field and was fixed in #8504.
What version and what artifacts are you using?
Artifacts: opentelemetry-sdk-logs
Version: main @ 509182e4b (present since 1.50.0, #7277)
How did you reference these artifacts? N/A
Environment
Compiler: Temurin 21
OS: N/A
Additional context
N/A
- Dominant language
- Java
- Stars
- 2.5k
- Forks
- 1k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 53
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from open-telemetry/opentelemetry-java
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
open-telemetry/opentelemetry-java#8836 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
open-telemetry/opentelemetry-java#8688 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
open-telemetry/opentelemetry-java#8642 · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
open-telemetry/opentelemetry-java#8842 · 2 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 76/100
open-telemetry/opentelemetry-java#8832 ·
All issues in open-telemetry/opentelemetry-java
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100