Skip to content
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

Add simplified emitEvent API for custom event logging in OpenTelemetryRum #650

Closed
wants to merge 3 commits into from

Conversation

RichardChukwu
Copy link

Addresses the issue #573 requesting a simplified mechanism for logging custom events in the OpenTelemetryRum interface.

Previously, developers had to go through multiple steps to log an event. The new emitEvent API provides a much simpler and more concise method for emitting custom events.

Changes Introduced:

  • New method: emitEvent(eventName, body, attributes) added to the OpenTelemetryRum interface and implemented in OpenTelemetryRumImpl.

  • The method allows developers to quickly log custom events by providing the event name, body content, and additional attributes.

  • Logging provider: The method uses SdkEventLoggerProvider from the OpenTelemetry SDK for logging events.

Usage Example:

Developers can now log custom events using:

rum.emitEvent("UserLoggedIn", "LoginSuccessBody", attributes);

Instead of the multi-step process of setting up event builders, this simplified API should significantly reduce the complexity of custom event logging.

@RichardChukwu RichardChukwu requested a review from a team as a code owner October 21, 2024 19:20
@RichardChukwu RichardChukwu marked this pull request as draft October 21, 2024 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant