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 event kit API #2512

Merged
merged 5 commits into from
Jan 18, 2023
Merged

Add event kit API #2512

merged 5 commits into from
Jan 18, 2023

Conversation

lloeki
Copy link
Contributor

@lloeki lloeki commented Dec 30, 2022

What does this PR do?

Implement event sugar API for users to emit either login events or custom business events to be tracked.

Motivation

These events are a key feature that Sqreen had and enabled higher level analysis and partially to fully automated security response.

Additional Notes

Just as with Datadog::Kit::Identity#set_user this looks like convenience syntactic sugar. Nonetheless, just as with set_user, wrapping the tag keys allows for these keys to evolve, or even the transport mechanism to change.

In addition, blocking may be handled and triggered, which is probably a feature we don't want in set_tag!

How to test the change?

There are a bunch of specs added.

@lloeki lloeki requested a review from a team December 30, 2022 17:49
@lloeki lloeki force-pushed the add-event-sdk branch 3 times, most recently from d7ecfcc to e4eb66a Compare December 30, 2022 18:09
@codecov-commenter
Copy link

Codecov Report

Merging #2512 (e4eb66a) into master (1ca13b5) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #2512      +/-   ##
==========================================
- Coverage   98.32%   98.32%   -0.01%     
==========================================
  Files        1124     1126       +2     
  Lines       60660    60725      +65     
==========================================
+ Hits        59644    59707      +63     
- Misses       1016     1018       +2     
Impacted Files Coverage Δ
lib/datadog/kit/events.rb 100.00% <100.00%> (ø)
spec/datadog/kit/events_spec.rb 100.00% <100.00%> (ø)
lib/datadog/core/workers/polling.rb 96.55% <0.00%> (-3.45%) ⬇️
...dog/profiling/collectors/cpu_and_wall_time_spec.rb 97.48% <0.00%> (-0.42%) ⬇️
spec/datadog/profiling/native_extension_spec.rb 98.74% <0.00%> (+0.62%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

lib/datadog/kit/events.rb Outdated Show resolved Hide resolved
@lloeki lloeki merged commit 4730eca into master Jan 18, 2023
@lloeki lloeki deleted the add-event-sdk branch January 18, 2023 19:25
@github-actions github-actions bot added this to the 1.9.0 milestone Jan 18, 2023
@TonyCTHsu TonyCTHsu mentioned this pull request Jan 30, 2023
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.

None yet

3 participants