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 integration_meta key to event #771

Merged
merged 5 commits into from
Aug 18, 2024
Merged

Conversation

savhappy
Copy link
Collaborator

@savhappy savhappy commented Aug 17, 2024

-Added an integration_meta key to store the metadata of a cron job, allowing the user to filter what events are reported based on the values.
-Alternate solution to PR #759
-Related to #757

lib/sentry/event.ex Outdated Show resolved Hide resolved
lib/sentry/event.ex Outdated Show resolved Hide resolved
Comment on lines 260 to 266
integration_meta: [
type: :map,
doc: """
A map to store metadata specific to the integration.
It allows cron integrations, such as the Oban integration,
to store job-related metadata. *Available since v10.1.0*.
"""
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now this can be doc: false instead since integrations are all internal to the Sentry SDK.

Comment on lines 352 to 353
event =
%__MODULE__{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you not change the formatting of this? Makes it harder to review 🙃

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes! My linter did this..

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Silly goose linter

@@ -41,7 +41,9 @@ defmodule Sentry.Integrations.Oban.ErrorReporter do
inspect(job.worker),
Exception.message(exception)
],
extra: Map.take(job, [:args, :attempt, :id, :max_attempts, :meta, :queue, :tags, :worker])
extra:
Map.take(job, [:args, :attempt, :id, :max_attempts, :meta, :queue, :tags, :worker]),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need tests for this 🧪

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on it!

savhappy and others added 4 commits August 17, 2024 07:49
Co-authored-by: Andrea Leopardi <an.leopardi@gmail.com>
Co-authored-by: Andrea Leopardi <an.leopardi@gmail.com>
@whatyouhide whatyouhide merged commit c1c5e97 into master Aug 18, 2024
4 checks passed
@whatyouhide whatyouhide deleted the sav/integration-cron-meta branch August 18, 2024 08:47
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.

2 participants