lograge-datadog-error-tracking 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: c27742dc9fe6de1daefec413daff4ba14b3e46842dd983ac99d15fb30ff7702f
4
+ data.tar.gz: 515dcec9bbd901117e30dc7514a27170a9303c627fba576baaf2b5d6a7140381
5
+ SHA512:
6
+ metadata.gz: 6acee85ab54acd7992a97b0a4276dae0946f57b01cfb25357ab70bf5b0d8f80664e176a23e429d83a4503a664e10f677604a48d0a99558928bb2c47190c0feb7
7
+ data.tar.gz: c46ca1763a35c4cb12296069788f8e7b067170579b9803ebc645c7104fcb8cec49551aa857640cb3e45b5acc6d91351bf4f331099b6a1b5c1d2f4a703d15f706
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,248 @@
1
+ # The behavior of RuboCop can be controlled via the .rubocop.yml
2
+ # configuration file. It makes it possible to enable/disable
3
+ # certain cops (checks) and to alter their behavior if they accept
4
+ # any parameters. The file can be placed either in your home
5
+ # directory or in some project directory.
6
+ #
7
+ # RuboCop will start looking for the configuration file in the directory
8
+ # where the inspected file is and continue its way up to the root directory.
9
+ #
10
+ # See https://docs.rubocop.org/rubocop/configuration
11
+
12
+ inherit_mode:
13
+ merge:
14
+ - Exclude
15
+ - Include
16
+
17
+ AllCops:
18
+ # Enable new cops by default
19
+ NewCops: enable
20
+
21
+ # Excluding most directories with generated files and directories with configuration files.
22
+ Exclude:
23
+ - 'bin'
24
+ - '.github'
25
+ - '**/Gemfile'
26
+ - '**/Guardfile'
27
+ - '**/Rakefile'
28
+ - 'node_modules/**/*'
29
+ - 'spec/**/*'
30
+ - 'sig/**/*'
31
+
32
+ # Checks if String literals are using single quotes when no interpolation is required
33
+ Style/StringLiterals:
34
+ Enabled: true
35
+ EnforcedStyle: single_quotes
36
+ ConsistentQuotesInMultiline: false
37
+
38
+ # Checks if the quotes used for quoted symbols are single quotes when no interpolation is required
39
+ Style/QuotedSymbols:
40
+ Enabled: true
41
+ EnforcedStyle: same_as_string_literals
42
+
43
+ # This cop checks for uses of literal strings converted to a symbol where a literal symbol could be used instead.
44
+ Lint/SymbolConversion:
45
+ Enabled: true
46
+ EnforcedStyle: strict
47
+
48
+ # Useless cop. It checks for unnecessary safe navigations.
49
+ # Example:
50
+ # obj&.a && obj.b
51
+ # Triggers rubocop error: it requires to add safe navigation for "obj.b" call => "obj&.b".
52
+ # but it is not necessary. obj&.a will return nil if obj is nil, and it will stop
53
+ # execution of the operation because `&&` right part executes only when left part is truthy.
54
+ Lint/SafeNavigationConsistency:
55
+ Enabled: false
56
+
57
+ # Checks for places where keyword arguments can be used instead of boolean arguments when defining methods.
58
+ # Disabled because moving from default arguments to keywords is not that easy.
59
+ Style/OptionalBooleanParameter:
60
+ Enabled: false
61
+
62
+ # Checks for use of the lambda.(args) syntax.
63
+ # Disabled while the Ruby team has not voted on this.
64
+ Style/LambdaCall:
65
+ Enabled: false
66
+ EnforcedStyle: braces
67
+
68
+ # Checks for presence or absence of braces around hash literal as a last array item depending on configuration.
69
+ # Disabled because it would break a lot of permitted_params definitions
70
+ Style/HashAsLastArrayItem:
71
+ Enabled: false
72
+
73
+ # Checks for grouping of accessors in class and module bodies.
74
+ # Useless.
75
+ Style/AccessorGrouping:
76
+ Enabled: false
77
+
78
+ # Makes our lives happier: we don't need to disable it in each case/when method
79
+ # with more than 5 "when"s.
80
+ Metrics/CyclomaticComplexity:
81
+ Max: 10
82
+
83
+ # Commonly used screens these days easily fit more than 80 characters.
84
+ Layout/LineLength:
85
+ Max: 120
86
+
87
+ # Too short methods lead to extraction of single-use methods, which can make
88
+ # the code easier to read (by naming things), but can also clutter the class
89
+ Metrics/MethodLength:
90
+ Max: 25
91
+
92
+ # The guiding principle of classes is SRP, SRP can't be accurately measured by LoC
93
+ Metrics/ClassLength:
94
+ Max: 1500
95
+
96
+ # No space makes the method definition shorter and differentiates
97
+ # from a regular assignment.
98
+ Layout/SpaceAroundEqualsInParameterDefault:
99
+ EnforcedStyle: no_space
100
+
101
+ # We do not need to support Ruby 1.9, so this is good to use.
102
+ Style/SymbolArray:
103
+ Enabled: true
104
+
105
+ # Most readable form.
106
+ Layout/HashAlignment:
107
+ EnforcedHashRocketStyle: table
108
+ EnforcedColonStyle: table
109
+
110
+ # Mixing the styles looks just silly.
111
+ Style/HashSyntax:
112
+ EnforcedStyle: ruby19_no_mixed_keys
113
+
114
+ # has_key? and has_value? are far more readable than key? and value?
115
+ Style/PreferredHashMethods:
116
+ Enabled: false
117
+
118
+ # String#% is by far the least verbose and only object oriented variant.
119
+ Style/FormatString:
120
+ EnforcedStyle: percent
121
+
122
+ # Annotated or template are too verbose and rarely needed.
123
+ Style/FormatStringToken:
124
+ EnforcedStyle: unannotated
125
+
126
+ Style/CollectionMethods:
127
+ Enabled: true
128
+ PreferredMethods:
129
+ # inject seems more common in the community.
130
+ reduce: "inject"
131
+
132
+ # Either allow this style or don't. Marking it as safe with parenthesis
133
+ # is silly. Let's try to live without them for now.
134
+ Style/ParenthesesAroundCondition:
135
+ AllowSafeAssignment: false
136
+ Lint/AssignmentInCondition:
137
+ AllowSafeAssignment: false
138
+
139
+ # A specialized exception class will take one or more arguments and construct the message from it.
140
+ # So both variants make sense.
141
+ Style/RaiseArgs:
142
+ Enabled: false
143
+
144
+ # Indenting the chained dots beneath each other is not supported by this cop,
145
+ # see https://github.com/bbatsov/rubocop/issues/1633
146
+ Layout/MultilineOperationIndentation:
147
+ Enabled: false
148
+
149
+ # Fail is an alias of raise. Avoid aliases, it's more cognitive load for no gain.
150
+ # The argument that fail should be used to abort the program is wrong too,
151
+ # there's Kernel#abort for that.
152
+ Style/SignalException:
153
+ EnforcedStyle: only_raise
154
+
155
+ # Suppressing exceptions can be perfectly fine, and be it to avoid to
156
+ # explicitly type nil into the rescue since that's what you want to return,
157
+ # or suppressing LoadError for optional dependencies
158
+ Lint/SuppressedException:
159
+ Enabled: false
160
+
161
+ # { ... } for multi-line blocks is okay, follow Weirichs rule instead:
162
+ # https://web.archive.org/web/20140221124509/http://onestepback.org/index.cgi/Tech/Ruby/BraceVsDoEnd.rdoc
163
+ Style/BlockDelimiters:
164
+ Enabled: false
165
+
166
+ # do / end blocks should be used for side effects,
167
+ # methods that run a block for side effects and have
168
+ # a useful return value are rare, assign the return
169
+ # value to a local variable for those cases.
170
+ Style/MethodCalledOnDoEndBlock:
171
+ Enabled: true
172
+
173
+ # Enforcing the names of variables? To single letter ones? Just no.
174
+ Style/SingleLineBlockParams:
175
+ Enabled: false
176
+
177
+ # Shadowing outer local variables with block parameters is often useful
178
+ # to not reinvent a new name for the same thing, it highlights the relation
179
+ # between the outer variable and the parameter. The cases where it's actually
180
+ # confusing are rare, and usually bad for other reasons already, for example
181
+ # because the method is too long.
182
+ Lint/ShadowingOuterLocalVariable:
183
+ Enabled: false
184
+
185
+ # Check with yard instead.
186
+ Style/Documentation:
187
+ Enabled: false
188
+
189
+ # This is just silly. Calling the argument `other` in all cases makes no sense.
190
+ Naming/BinaryOperatorParameterName:
191
+ Enabled: false
192
+
193
+ # Disable frozen string
194
+ Style/FrozenStringLiteralComment:
195
+ Enabled: false
196
+
197
+ # Disable No ASCII char in comments
198
+ Style/AsciiComments:
199
+ Enabled: false
200
+
201
+ # Disable ordered Gems By ascii
202
+ Bundler/OrderedGems:
203
+ Enabled: false
204
+
205
+ # Change ABC max value
206
+ Metrics/AbcSize:
207
+ Max: 35
208
+
209
+ # Disable empty method in one line
210
+ Style/EmptyMethod:
211
+ EnforcedStyle: expanded
212
+
213
+ # Disable max height block
214
+ Metrics/BlockLength:
215
+ Enabled: true
216
+ Exclude:
217
+ - 'app/admin/**/*'
218
+ - 'lib/tasks/**/*'
219
+
220
+ # Checks if empty lines around the bodies of classes match the configuration.
221
+ Layout/EmptyLinesAroundClassBody:
222
+ EnforcedStyle: empty_lines
223
+ # Checks if empty lines around the bodies of modules match the configuration.
224
+ Layout/EmptyLinesAroundModuleBody:
225
+ EnforcedStyle: empty_lines
226
+
227
+ # Enforces the consistent usage of %-literal delimiters.
228
+ Style/PercentLiteralDelimiters:
229
+ PreferredDelimiters:
230
+ default: '()'
231
+ '%i': '[]'
232
+ '%I': '[]'
233
+ '%r': '{}'
234
+ '%w': '[]'
235
+ '%W': '[]'
236
+
237
+ # Unnecessary cop. In what universe "A || B && C" or "A && B || C && D" is ambiguous? looks
238
+ # like a cop for those who can't in boolean.
239
+ Lint/AmbiguousOperatorPrecedence:
240
+ Enabled: false
241
+
242
+ # Checks for simple usages of parallel assignment.
243
+ Style/ParallelAssignment:
244
+ Enabled: false
245
+
246
+ # Checks the style of children definitions at classes and modules.
247
+ Style/ClassAndModuleChildren:
248
+ Enabled: false
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2023-08-24
4
+
5
+ - Initial release
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in lograge-datadog-error-tracking.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "rspec", "~> 3.0"
11
+
12
+ gem "rubocop", "~> 1.21"
data/Gemfile.lock ADDED
@@ -0,0 +1,124 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ lograge-datadog-error-tracking (0.1.0)
5
+ activesupport (> 6.0)
6
+ lograge (~> 0.13.0)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ actionpack (7.0.7.2)
12
+ actionview (= 7.0.7.2)
13
+ activesupport (= 7.0.7.2)
14
+ rack (~> 2.0, >= 2.2.4)
15
+ rack-test (>= 0.6.3)
16
+ rails-dom-testing (~> 2.0)
17
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
18
+ actionview (7.0.7.2)
19
+ activesupport (= 7.0.7.2)
20
+ builder (~> 3.1)
21
+ erubi (~> 1.4)
22
+ rails-dom-testing (~> 2.0)
23
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
24
+ activesupport (7.0.7.2)
25
+ concurrent-ruby (~> 1.0, >= 1.0.2)
26
+ i18n (>= 1.6, < 2)
27
+ minitest (>= 5.1)
28
+ tzinfo (~> 2.0)
29
+ ast (2.4.2)
30
+ builder (3.2.4)
31
+ concurrent-ruby (1.2.2)
32
+ crass (1.0.6)
33
+ diff-lcs (1.5.0)
34
+ erubi (1.12.0)
35
+ i18n (1.14.1)
36
+ concurrent-ruby (~> 1.0)
37
+ json (2.6.2)
38
+ lograge (0.13.0)
39
+ actionpack (>= 4)
40
+ activesupport (>= 4)
41
+ railties (>= 4)
42
+ request_store (~> 1.0)
43
+ loofah (2.21.3)
44
+ crass (~> 1.0.2)
45
+ nokogiri (>= 1.12.0)
46
+ method_source (1.0.0)
47
+ minitest (5.19.0)
48
+ nokogiri (1.15.4-aarch64-linux)
49
+ racc (~> 1.4)
50
+ nokogiri (1.15.4-arm64-darwin)
51
+ racc (~> 1.4)
52
+ nokogiri (1.15.4-x86_64-darwin)
53
+ racc (~> 1.4)
54
+ parallel (1.22.1)
55
+ parser (3.1.2.1)
56
+ ast (~> 2.4.1)
57
+ racc (1.7.1)
58
+ rack (2.2.8)
59
+ rack-test (2.1.0)
60
+ rack (>= 1.3)
61
+ rails-dom-testing (2.2.0)
62
+ activesupport (>= 5.0.0)
63
+ minitest
64
+ nokogiri (>= 1.6)
65
+ rails-html-sanitizer (1.6.0)
66
+ loofah (~> 2.21)
67
+ nokogiri (~> 1.14)
68
+ railties (7.0.7.2)
69
+ actionpack (= 7.0.7.2)
70
+ activesupport (= 7.0.7.2)
71
+ method_source
72
+ rake (>= 12.2)
73
+ thor (~> 1.0)
74
+ zeitwerk (~> 2.5)
75
+ rainbow (3.1.1)
76
+ rake (13.0.6)
77
+ regexp_parser (2.6.0)
78
+ request_store (1.5.1)
79
+ rack (>= 1.4)
80
+ rexml (3.2.5)
81
+ rspec (3.11.0)
82
+ rspec-core (~> 3.11.0)
83
+ rspec-expectations (~> 3.11.0)
84
+ rspec-mocks (~> 3.11.0)
85
+ rspec-core (3.11.0)
86
+ rspec-support (~> 3.11.0)
87
+ rspec-expectations (3.11.1)
88
+ diff-lcs (>= 1.2.0, < 2.0)
89
+ rspec-support (~> 3.11.0)
90
+ rspec-mocks (3.11.1)
91
+ diff-lcs (>= 1.2.0, < 2.0)
92
+ rspec-support (~> 3.11.0)
93
+ rspec-support (3.11.1)
94
+ rubocop (1.36.0)
95
+ json (~> 2.3)
96
+ parallel (~> 1.10)
97
+ parser (>= 3.1.2.1)
98
+ rainbow (>= 2.2.2, < 4.0)
99
+ regexp_parser (>= 1.8, < 3.0)
100
+ rexml (>= 3.2.5, < 4.0)
101
+ rubocop-ast (>= 1.20.1, < 2.0)
102
+ ruby-progressbar (~> 1.7)
103
+ unicode-display_width (>= 1.4.0, < 3.0)
104
+ rubocop-ast (1.21.0)
105
+ parser (>= 3.1.1.0)
106
+ ruby-progressbar (1.11.0)
107
+ thor (1.2.2)
108
+ tzinfo (2.0.6)
109
+ concurrent-ruby (~> 1.0)
110
+ unicode-display_width (2.3.0)
111
+ zeitwerk (2.6.11)
112
+
113
+ PLATFORMS
114
+ aarch64-linux
115
+ universal-darwin-22
116
+
117
+ DEPENDENCIES
118
+ lograge-datadog-error-tracking!
119
+ rake (~> 13.0)
120
+ rspec (~> 3.0)
121
+ rubocop (~> 1.21)
122
+
123
+ BUNDLED WITH
124
+ 2.4.19
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2023 Matthieu CIAPPARA
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,55 @@
1
+ # Lograge::Datadog::Error::Tracking
2
+
3
+ Log exceptions in Datadog Error Tracking
4
+
5
+ ## Installation
6
+
7
+ Install the gem and add to the application's Gemfile by executing:
8
+
9
+ $ bundle add lograge-datadog-error-tracking
10
+
11
+ If bundler is not being used to manage dependencies, install the gem by executing:
12
+
13
+ $ gem install lograge-datadog-error-tracking
14
+
15
+ ## Usage
16
+
17
+ Set `custom_options` of [Lograge](https://github.com/roidrage/lograge#installation) as such:
18
+
19
+ ```ruby
20
+ Rails.application.configure do |config|
21
+ # Configure logging of exceptions to the correct fields
22
+ config.lograge.custom_options = Lograge::Datadog::Error::Tracking
23
+ end
24
+ ```
25
+
26
+ If you need to add more data, you can use the following configuration:
27
+
28
+ ```ruby
29
+ Rails.application.configure do |config|
30
+ # Configure logging of exceptions to the correct fields
31
+ config.lograge.custom_options = lambda do |event|
32
+ {
33
+ usefull_data: 'Very important data'
34
+ }.merge(Lograge::Datadog::Error::Tracking.call(event))
35
+ end
36
+ end
37
+ ```
38
+
39
+ ## Development
40
+
41
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
42
+
43
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
44
+
45
+ ## Contributing
46
+
47
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/lograge-datadog-error-tracking. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/lograge-datadog-error-tracking/blob/master/CODE_OF_CONDUCT.md).
48
+
49
+ ## License
50
+
51
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
52
+
53
+ ## Code of Conduct
54
+
55
+ Everyone interacting in the Lograge::Datadog::Error::Tracking project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/lograge-datadog-error-tracking/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ require "rubocop/rake_task"
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[spec rubocop]
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Lograge
4
+
5
+ module Datadog
6
+
7
+ module Error
8
+
9
+ module Tracking
10
+
11
+ VERSION = '0.1.0'
12
+
13
+ end
14
+
15
+ end
16
+
17
+ end
18
+
19
+ end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'tracking/version'
4
+
5
+ module Lograge
6
+
7
+ module Datadog
8
+
9
+ module Error
10
+
11
+ module Tracking
12
+
13
+ def self.call(event)
14
+ if event.payload[:exception].present?
15
+ {
16
+ error: {
17
+ kind: event.payload[:exception][0],
18
+ message: event.payload[:exception][1],
19
+ stack: event.payload[:exception_object].backtrace
20
+ }
21
+ }
22
+ else
23
+ {}
24
+ end
25
+ end
26
+
27
+ end
28
+
29
+ end
30
+
31
+ end
32
+
33
+ end
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'lib/lograge/datadog/error/tracking/version'
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = 'lograge-datadog-error-tracking'
7
+ spec.version = Lograge::Datadog::Error::Tracking::VERSION
8
+ spec.authors = ['Matthieu CIAPPARA']
9
+ spec.email = ['matthieu.ciappara@outlook.fr']
10
+
11
+ spec.summary = 'Log exceptions in Datadog Error Tracking'
12
+ spec.description = 'Format your exception logs to be integrated with Datadog Error Tracking'
13
+ spec.homepage = 'https://github.com/Ezveus/lograge-datadog-error-tracking'
14
+ spec.license = 'MIT'
15
+ spec.required_ruby_version = '>= 2.6.0'
16
+
17
+ spec.metadata['homepage_uri'] = spec.homepage
18
+ spec.metadata['source_code_uri'] = spec.homepage
19
+ spec.metadata['changelog_uri'] = 'https://github.com/Ezveus/lograge-datadog-error-tracking/blob/master/CHANGELOG.md'
20
+
21
+ # Specify which files should be added to the gem when it is released.
22
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
23
+ spec.files = Dir.chdir(__dir__) do
24
+ `git ls-files -z`.split("\x0").reject do |f|
25
+ (File.expand_path(f) == __FILE__) || f.start_with?(*%w[bin/ test/ spec/ features/ .git .circleci appveyor])
26
+ end
27
+ end
28
+ spec.bindir = 'exe'
29
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
30
+ spec.require_paths = ['lib']
31
+
32
+ spec.add_dependency 'activesupport', '>= 5.0'
33
+ spec.add_dependency 'lograge', '>= 0.5'
34
+
35
+ # For more information and examples about making a new gem, check out our
36
+ # guide at: https://bundler.io/guides/creating_gem.html
37
+ spec.metadata['rubygems_mfa_required'] = 'true'
38
+ end
@@ -0,0 +1,19 @@
1
+ module Lograge
2
+
3
+ module Datadog
4
+
5
+ module Error
6
+
7
+ module Tracking
8
+
9
+ VERSION: String
10
+
11
+ def self.call: (ActiveSupport::Notifications::Event) -> Hash[Symbol, untyped]
12
+
13
+ end
14
+
15
+ end
16
+
17
+ end
18
+
19
+ end
metadata ADDED
@@ -0,0 +1,88 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: lograge-datadog-error-tracking
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Matthieu CIAPPARA
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2023-08-24 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activesupport
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '5.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '5.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: lograge
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0.5'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0.5'
41
+ description: Format your exception logs to be integrated with Datadog Error Tracking
42
+ email:
43
+ - matthieu.ciappara@outlook.fr
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - ".rspec"
49
+ - ".rubocop.yml"
50
+ - CHANGELOG.md
51
+ - CODE_OF_CONDUCT.md
52
+ - Gemfile
53
+ - Gemfile.lock
54
+ - LICENSE.txt
55
+ - README.md
56
+ - Rakefile
57
+ - lib/lograge/datadog/error/tracking.rb
58
+ - lib/lograge/datadog/error/tracking/version.rb
59
+ - lograge-datadog-error-tracking.gemspec
60
+ - sig/lograge/datadog/error/tracking.rbs
61
+ homepage: https://github.com/Ezveus/lograge-datadog-error-tracking
62
+ licenses:
63
+ - MIT
64
+ metadata:
65
+ homepage_uri: https://github.com/Ezveus/lograge-datadog-error-tracking
66
+ source_code_uri: https://github.com/Ezveus/lograge-datadog-error-tracking
67
+ changelog_uri: https://github.com/Ezveus/lograge-datadog-error-tracking/blob/master/CHANGELOG.md
68
+ rubygems_mfa_required: 'true'
69
+ post_install_message:
70
+ rdoc_options: []
71
+ require_paths:
72
+ - lib
73
+ required_ruby_version: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ version: 2.6.0
78
+ required_rubygems_version: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ requirements: []
84
+ rubygems_version: 3.4.10
85
+ signing_key:
86
+ specification_version: 4
87
+ summary: Log exceptions in Datadog Error Tracking
88
+ test_files: []