-
Notifications
You must be signed in to change notification settings - Fork 707
otelhttp: export Event type for WithMessageEvents #8153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Hello @dmathieu , OpenTelemetry Go enums usually prefix constants with the type name (e.g. SpanKindServer, SpanKindClient). So shall I change |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8153 +/- ##
=====================================
Coverage 81.8% 81.8%
=====================================
Files 194 194
Lines 13362 13377 +15
=====================================
+ Hits 10936 10952 +16
+ Misses 2029 2027 -2
- Partials 397 398 +1
🚀 New features to boost your workflow:
|
33a327d to
ae43cdd
Compare
|
@sonalgaud12 Please fix the lint; we can use |
| // Different types of events that can be recorded, see WithMessageEvents. | ||
| const ( | ||
| ReadEvents event = iota | ||
| unspecifiedEvent Event = iota |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit:
| unspecifiedEvent Event = iota | |
| unspecifiedEvents Event = iota |
|
|
||
| func TestEvent(t *testing.T) { | ||
| t.Run("constant values", func(t *testing.T) { | ||
| assert.Equal(t, otelhttp.ReadEvents, otelhttp.Event(1), "ReadEvents should be 1") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact, the modified expected and actual positions are incorrect; the pre-modified ones are accurate.
Of course, we could do it this way: assert.Equal(t, 1, int(otelhttp.ReadEvents), "ReadEvents should be 1")
It is worth noting that we still lack validation for unspecifiedEvents.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only remaining issues
This PR fixes issue #8132
The WithMessageEvents option previously accepted an unexported type (event).
This change exports the type as Event.