honeycomb-beeline 2.5.0 → 2.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8dfad7bddebd49b8645b61389e74035626a0cc817d5fc7ea9e51ab17cb571584
4
- data.tar.gz: eadf7a28b41ddb6437e0e5a2c0824c2a2cf67fbf36a95bc18f77ad03b4f74306
3
+ metadata.gz: fa203ac2df453da5a0e29891b24e4a29e354fb903f7cd5dcc9ad628412675955
4
+ data.tar.gz: 36d850c39cd38114abc078ac433afd8e1ec7f3e7bc6f6b2d58500e6c75cb09a9
5
5
  SHA512:
6
- metadata.gz: 7c6204f46a27e4a3af3bf5d2d173fdb4d06f820ecf76dd2ed84d0de52aca83fb155190075b244ee6ab7e811c93927874ae51d36cc117b018de995ad5aeb76f40
7
- data.tar.gz: 175c355b5a5833bfd68b17a281fc2d71f0321f7c708e339b03090b367d64d7a6c9294ed8afcc84d5f538b6c80644f9c26488475962903a2364bb6ab0e7ee93f8
6
+ metadata.gz: '0820b6a9fc82ab51d583184eb34a4abdfff98f61d8d1c2807c3dffe884c3cc815499c718f90920c79e92e20d6166b990a39c47bb4e0eb17ff4da161e4f802f38'
7
+ data.tar.gz: 8a17134f59e43879990446dc9ec53a07fdf49567c77b04c2339586eb35c472924e6d36743ee2515adfaffd88db05835f28a5f1cdf7b2776bbdd2fc169ba660cb
data/.circleci/config.yml CHANGED
@@ -13,7 +13,7 @@ commands:
13
13
  - checkout
14
14
  - restore_cache:
15
15
  keys:
16
- - gems-v1-<< parameters.ruby-version >>-<< parameters.gemfile >>-{{ checksum "Gemfile.lock" }}
16
+ - gems-v1-<< parameters.ruby-version >>-<< parameters.gemfile >>-{{ checksum "honeycomb-beeline.gemspec" }}
17
17
  - gems-v1-<< parameters.ruby-version >>-<< parameters.gemfile >>
18
18
  - gems-v1-<< parameters.ruby-version >>
19
19
  - run: .circleci/bundler_version.sh
@@ -24,7 +24,7 @@ commands:
24
24
  - save_cache:
25
25
  paths:
26
26
  - ./vendor/bundle
27
- key: gems-v1-<< parameters.ruby-version >>-<< parameters.gemfile >>-{{ checksum "Gemfile.lock" }}
27
+ key: gems-v1-<< parameters.ruby-version >>-<< parameters.gemfile >>-{{ checksum "honeycomb-beeline.gemspec" }}
28
28
  - run: << parameters.command >>
29
29
 
30
30
  jobs:
@@ -106,6 +106,30 @@ jobs:
106
106
  command: bundle exec rake test
107
107
  - store_test_results:
108
108
  path: test/reports
109
+ - persist_to_workspace:
110
+ root: ./
111
+ paths:
112
+ - coverage
113
+ coverage_report:
114
+ parameters:
115
+ ruby-version:
116
+ type: string
117
+ default: "2.6"
118
+ docker:
119
+ - image: circleci/ruby:<< parameters.ruby-version >>
120
+ environment:
121
+ BUNDLE_GEMFILE: ./Gemfile
122
+ steps:
123
+ - ruby:
124
+ ruby-version: << parameters.ruby-version >>
125
+ gemfile: root
126
+ command: echo "Get the project environment and cached dependencies prior to retrieving the coverage results."
127
+ - attach_workspace:
128
+ at: ./
129
+ - run: ls -l ./coverage
130
+ - run: bundle exec rake coverage:report
131
+ - store_artifacts:
132
+ path: coverage
109
133
 
110
134
  workflows:
111
135
  nightly:
@@ -124,7 +148,7 @@ workflows:
124
148
  - lint
125
149
  matrix:
126
150
  parameters:
127
- ruby-version: ["2.2", "2.3", "2.4", "2.5", "2.6", "2.7"]
151
+ ruby-version: ["2.2", "2.3", "2.4", "2.5", "2.6", "2.7", "3.0"]
128
152
  gemfile:
129
153
  - aws_2
130
154
  - aws_3
@@ -170,6 +194,19 @@ workflows:
170
194
  gemfile: rails_41
171
195
  - ruby-version: "2.7"
172
196
  gemfile: rails_42
197
+ - ruby-version: "3.0"
198
+ gemfile: rails_41
199
+ - ruby-version: "3.0"
200
+ gemfile: rails_42
201
+ - ruby-version: "3.0"
202
+ gemfile: rails_5
203
+ - ruby-version: "3.0"
204
+ gemfile: rails_51
205
+ - ruby-version: "3.0"
206
+ gemfile: rails_52
207
+ - ruby-version: "3.0"
208
+ gemfile: sequel4
209
+
173
210
  beeline:
174
211
  jobs:
175
212
  - lint:
@@ -179,6 +216,10 @@ workflows:
179
216
  - test:
180
217
  <<: *test
181
218
  filters: *regular_filters
219
+ - coverage_report:
220
+ filters: *regular_filters
221
+ requires:
222
+ - test
182
223
  - build_artifacts:
183
224
  filters: &tag_filters
184
225
  tags:
@@ -0,0 +1,27 @@
1
+ ---
2
+ name: Bug report
3
+ about: Let us know if something is not working as expected
4
+ title: ''
5
+ labels: 'type: bug'
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ <!---
11
+ Thank you for taking the time to report bugs!
12
+
13
+ We love code snippets and links to repositories that reproduce the issue, but understand if you don't have the time to add them. We'll do our best with the info you provide, and might ask follow-up questions.
14
+
15
+ Please see our [OSS process document](https://github.com/honeycombio/home/blob/main/honeycomb-oss-lifecycle-and-practices.md#) to get an idea of how we operate.
16
+ --->
17
+
18
+ **Versions**
19
+
20
+ - Ruby:
21
+ - Beeline:
22
+
23
+ **Steps to reproduce**
24
+
25
+ 1.
26
+
27
+ **Additional context**
@@ -0,0 +1,25 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an idea for this project
4
+ title: ''
5
+ labels: 'type: enhancement'
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ <!---
11
+ Thank you for contributing an idea to this project!
12
+
13
+ Please see our [OSS process document](https://github.com/honeycombio/home/blob/main/honeycomb-oss-lifecycle-and-practices.md#) to get an idea of how we operate.
14
+ --->
15
+
16
+ **Is your feature request related to a problem? Please describe.**
17
+
18
+
19
+ **Describe the solution you'd like**
20
+
21
+
22
+ **Describe alternatives you've considered**
23
+
24
+
25
+ **Additional context**
@@ -0,0 +1,14 @@
1
+ ---
2
+ name: Question/Discussion
3
+ about: General question about how things work or a discussion
4
+ title: ''
5
+ labels: 'type: discussion'
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ <!---
11
+ Thank you for taking the time to say hello!
12
+
13
+ Please see our [OSS process document](https://github.com/honeycombio/home/blob/main/honeycomb-oss-lifecycle-and-practices.md#) to get an idea of how we operate.
14
+ --->
@@ -0,0 +1,22 @@
1
+ ---
2
+ name: Security vulnerability report
3
+ about: Let us know if you discover a security vulnerability
4
+ title: ''
5
+ labels: 'type: security'
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ <!---
11
+ Thank you for taking the time to report security vulnerabilities!
12
+
13
+ Please see our [OSS process document](https://github.com/honeycombio/home/blob/main/honeycomb-oss-lifecycle-and-practices.md#) to get an idea of how we operate.
14
+ --->
15
+ **Versions**
16
+
17
+ - Ruby:
18
+ - Beeline:
19
+
20
+ **Description**
21
+
22
+ (Please include any relevant CVE advisory links)
@@ -0,0 +1,20 @@
1
+ <!--
2
+ Thank you for contributing to the project! 💜
3
+ Please make sure to:
4
+ - Chat with us first if this is a big change
5
+ - Open a new issue (or comment on an existing one)
6
+ - We want to make sure you don't spend time implementing something we might have to say No to
7
+ - Add unit tests
8
+ - Mention any relevant issues in the PR description (e.g. "Fixes #123")
9
+
10
+ Please see our [OSS process document](https://github.com/honeycombio/home/blob/main/honeycomb-oss-lifecycle-and-practices.md#) to get an idea of how we operate.
11
+ -->
12
+
13
+ ## Which problem is this PR solving?
14
+
15
+ -
16
+
17
+ ## Short description of the changes
18
+
19
+ -
20
+
@@ -8,7 +8,7 @@ updates:
8
8
  - package-ecosystem: "bundler" # See documentation for possible values
9
9
  directory: "/gemfiles/" # Location of package manifests
10
10
  schedule:
11
- interval: "weekly"
11
+ interval: "monthly"
12
12
  labels:
13
13
  - "type: dependencies"
14
14
  reviewers:
@@ -1,5 +1,5 @@
1
1
  name: Apply project labels
2
- on: [issues, pull_request, label]
2
+ on: [issues, pull_request_target, label]
3
3
  jobs:
4
4
  apply-labels:
5
5
  runs-on: ubuntu-latest
@@ -0,0 +1,26 @@
1
+ name: 'Close stale issues and PRs'
2
+ on:
3
+ schedule:
4
+ - cron: '30 1 * * *'
5
+
6
+ jobs:
7
+ stale:
8
+ name: 'Close stale issues and PRs'
9
+ runs-on: ubuntu-latest
10
+ permissions:
11
+ issues: write
12
+ pull-requests: write
13
+
14
+ steps:
15
+ - uses: actions/stale@v4
16
+ with:
17
+ start-date: '2021-09-01T00:00:00Z'
18
+ stale-issue-message: 'Marking this issue as stale because it has been open 14 days with no activity. Please add a comment if this is still an ongoing issue; otherwise this issue will be automatically closed in 7 days.'
19
+ stale-pr-message: 'Marking this PR as stale because it has been open 30 days with no activity. Please add a comment if this PR is still relevant; otherwise this PR will be automatically closed in 7 days.'
20
+ close-issue-message: 'Closing this issue due to inactivity. Please see our [Honeycomb OSS Lifecyle and Practices](https://github.com/honeycombio/home/blob/main/honeycomb-oss-lifecycle-and-practices.md).'
21
+ close-pr-message: 'Closing this PR due to inactivity. Please see our [Honeycomb OSS Lifecyle and Practices](https://github.com/honeycombio/home/blob/main/honeycomb-oss-lifecycle-and-practices.md).'
22
+ days-before-issue-stale: 14
23
+ days-before-pr-stale: 30
24
+ days-before-issue-close: 7
25
+ days-before-pr-close: 7
26
+ any-of-labels: 'status: info needed,status: revision needed'
data/.rubocop.yml CHANGED
@@ -27,6 +27,7 @@ Metrics/MethodLength:
27
27
 
28
28
  Metrics/LineLength:
29
29
  Exclude:
30
+ - spec/honeycomb/integrations/active_support_spec.rb
30
31
  - spec/support/event_data_shared_examples.rb
31
32
 
32
33
  Metrics/ParameterLists:
@@ -37,6 +38,7 @@ Style/AccessModifierDeclarations:
37
38
  - lib/honeycomb/propagation/aws.rb
38
39
  - lib/honeycomb/propagation/w3c.rb
39
40
  - lib/honeycomb/propagation/honeycomb.rb
41
+ - lib/honeycomb/propagation/default.rb
40
42
 
41
43
  Style/FrozenStringLiteralComment:
42
44
  EnforcedStyle: always
data/Appraisals CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  appraise "aws-2" do
4
4
  gem "aws-sdk", "~> 2"
5
+ gem "webrick"
5
6
  end
6
7
 
7
8
  appraise "aws-3" do
data/CHANGELOG.md CHANGED
@@ -1,5 +1,45 @@
1
1
  # beeline-ruby changelog
2
2
 
3
+ ## 2.8.0 2021-12-22
4
+
5
+ ### Improvements
6
+
7
+ - feat: accept both w3c and honeycomb propagation headers by default (#183) | [@robbkidd](https://github.com/robbkidd)
8
+
9
+ ### Maintenance
10
+
11
+ - Update dependabot to monthly (#181) | [@vreynolds](https://github.com/vreynolds)
12
+ - empower apply-labels action to apply labels (#179) | [@robbkidd](https://github.com/robbkidd)
13
+
14
+ ## 2.7.1 2021-10-22
15
+
16
+ ### Maintenance
17
+
18
+ - Change maintenance badge to maintained (#174) | [@JamieDanielson](https://github.com/JamieDanielson)
19
+ - Adds Stalebot (#175) | [@JamieDanielson](https://github.com/JamieDanielson)
20
+ - gather up the matrix'd code coverage and save a report (#173) | [@robbkidd](https://github.com/robbkidd)
21
+ - add Ruby 3.0 to CI matrix (#171) | [@robbkidd](https://github.com/robbkidd)
22
+ - remove CodeCov from test suite (#172) | [@robbkidd](https://github.com/robbkidd)
23
+ - Add NOTICE (#169) | [@cartermp](https://github.com/cartermp)
24
+
25
+ ## 2.7.0 2021-09-03
26
+
27
+ ### Improvements
28
+
29
+ - add `error` and `error_detail` fields to spans from `ActiveSupport::Notification` events that contain an exception (#166) | [@leviwilson](https://github.com/leviwilson)
30
+
31
+ ### Maintenance
32
+
33
+ - Add issue and PR templates (#165) | [@vreynolds](https://github.com/vreynolds)
34
+ - Add OSS lifecycle badge (#164) | [@vreynolds](https://github.com/vreynolds)
35
+ - Add community health files (#163) | [@vreynolds](https://github.com/vreynolds)
36
+
37
+ ## 2.6.0 2021-07-23
38
+
39
+ ### Added
40
+
41
+ - Allow setting different notification handling logic for specific events (#152) | [@lirossarvet](https://github.com/lirossarvet)
42
+
3
43
  ## 2.5.0 2021-07-16
4
44
 
5
45
  ### Added
data/CODE_OF_CONDUCT.md CHANGED
@@ -1,74 +1,5 @@
1
- # Contributor Covenant Code of Conduct
1
+ # Code of Conduct
2
2
 
3
- ## Our Pledge
3
+ This project has adopted the Honeycomb User Community Code of Conduct to clarify expected behavior in our community.
4
4
 
5
- In the interest of fostering an open and welcoming environment, we as
6
- contributors and maintainers pledge to making participation in our project and
7
- our community a harassment-free experience for everyone, regardless of age, body
8
- size, disability, ethnicity, gender identity and expression, level of experience,
9
- nationality, personal appearance, race, religion, or sexual identity and
10
- orientation.
11
-
12
- ## Our Standards
13
-
14
- Examples of behavior that contributes to creating a positive environment
15
- include:
16
-
17
- * Using welcoming and inclusive language
18
- * Being respectful of differing viewpoints and experiences
19
- * Gracefully accepting constructive criticism
20
- * Focusing on what is best for the community
21
- * Showing empathy towards other community members
22
-
23
- Examples of unacceptable behavior by participants include:
24
-
25
- * The use of sexualized language or imagery and unwelcome sexual attention or
26
- advances
27
- * Trolling, insulting/derogatory comments, and personal or political attacks
28
- * Public or private harassment
29
- * Publishing others' private information, such as a physical or electronic
30
- address, without explicit permission
31
- * Other conduct which could reasonably be considered inappropriate in a
32
- professional setting
33
-
34
- ## Our Responsibilities
35
-
36
- Project maintainers are responsible for clarifying the standards of acceptable
37
- behavior and are expected to take appropriate and fair corrective action in
38
- response to any instances of unacceptable behavior.
39
-
40
- Project maintainers have the right and responsibility to remove, edit, or
41
- reject comments, commits, code, wiki edits, issues, and other contributions
42
- that are not aligned to this Code of Conduct, or to ban temporarily or
43
- permanently any contributor for other behaviors that they deem inappropriate,
44
- threatening, offensive, or harmful.
45
-
46
- ## Scope
47
-
48
- This Code of Conduct applies both within project spaces and in public spaces
49
- when an individual is representing the project or its community. Examples of
50
- representing a project or community include using an official project e-mail
51
- address, posting via an official social media account, or acting as an appointed
52
- representative at an online or offline event. Representation of a project may be
53
- further defined and clarified by project maintainers.
54
-
55
- ## Enforcement
56
-
57
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
- reported by contacting the project team at me@martinholman.co.nz. All
59
- complaints will be reviewed and investigated and will result in a response that
60
- is deemed necessary and appropriate to the circumstances. The project team is
61
- obligated to maintain confidentiality with regard to the reporter of an incident.
62
- Further details of specific enforcement policies may be posted separately.
63
-
64
- Project maintainers who do not follow or enforce the Code of Conduct in good
65
- faith may face temporary or permanent repercussions as determined by other
66
- members of the project's leadership.
67
-
68
- ## Attribution
69
-
70
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
- available at [http://contributor-covenant.org/version/1/4][version]
72
-
73
- [homepage]: http://contributor-covenant.org
74
- [version]: http://contributor-covenant.org/version/1/4/
5
+ https://www.honeycomb.io/honeycomb-user-community-code-of-conduct/
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,3 @@
1
+ # Contributing Guide
2
+
3
+ Please see our [general guide for OSS lifecycle and practices.](https://github.com/honeycombio/home/blob/main/honeycomb-oss-lifecycle-and-practices.md)
data/NOTICE ADDED
@@ -0,0 +1,13 @@
1
+ Copyright (c) 2016-Present Honeycomb, Hound Technology, Inc. All Rights Reserved.
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
data/OSSMETADATA ADDED
@@ -0,0 +1 @@
1
+ osslifecycle=maintained
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Honeycomb Beeline for Ruby
2
2
 
3
+ [![OSS Lifecycle](https://img.shields.io/osslifecycle/honeycombio/beeline-ruby?color=success)](https://github.com/honeycombio/home/blob/main/honeycomb-oss-lifecycle-and-practices.md)
3
4
  [![Build Status](https://circleci.com/gh/honeycombio/beeline-ruby.svg?style=svg)](https://circleci.com/gh/honeycombio/beeline-ruby)
4
5
  [![Gem Version](https://badge.fury.io/rb/honeycomb-beeline.svg)](https://badge.fury.io/rb/honeycomb-beeline)
5
- [![codecov](https://codecov.io/gh/honeycombio/beeline-ruby/branch/main/graph/badge.svg)](https://codecov.io/gh/honeycombio/beeline-ruby)
6
6
 
7
7
  This package makes it easy to instrument your Ruby web app to send useful events to [Honeycomb](https://www.honeycomb.io), a service for debugging your software in production.
8
8
  - [Usage and Examples](https://docs.honeycomb.io/getting-data-in/beelines/ruby-beeline/)
data/RELEASING.md ADDED
@@ -0,0 +1,9 @@
1
+ # Releasing
2
+
3
+ - Update the version number in `lib/honeycomb/beeline/version`.
4
+ - Update `CHANGELOG.md` with the changes since the last release.
5
+ - Commit changes, push, and open a release preparation pull request for review.
6
+ - Once the pull request is merged, fetch the updated `main` branch.
7
+ - Apply a tag for the new version on the merged commit: vX.Y.Z, for example v1.1.2.
8
+ - Push the new version tag up to the project repository to kick off build and artifact publishing to GitHub and the Gems registry.
9
+ - Publish the draft release in GitHub.
data/Rakefile CHANGED
@@ -14,3 +14,15 @@ task test: :spec
14
14
  task default: %i[rubocop test]
15
15
 
16
16
  !ENV["APPRAISAL_INITIALIZED"] && !ENV["TRAVIS"] && task(default: :appraisal)
17
+
18
+ namespace :coverage do
19
+ desc "Collates all result sets generated by the different test runners"
20
+ task :report do
21
+ require "simplecov"
22
+
23
+ SimpleCov.collate Dir["coverage/**/.resultset.json"] do
24
+ add_group "Integrations", "lib/honeycomb/integrations"
25
+ add_group "Propagation", "lib/honeycomb/propagation"
26
+ end
27
+ end
28
+ end
data/SECURITY.md ADDED
@@ -0,0 +1,3 @@
1
+ # Reporting Security Issues
2
+
3
+ If you discover a security vulnerability, please open an issue with label `type: security`.
data/SUPPORT.md ADDED
@@ -0,0 +1,3 @@
1
+ # How to Get Help
2
+
3
+ This project uses GitHub issues to track bugs, feature requests, and questions about using the project. Please search for existing issues before filing a new one.
@@ -42,7 +42,6 @@ Gem::Specification.new do |spec|
42
42
  spec.add_development_dependency "appraisal"
43
43
  spec.add_development_dependency "bump"
44
44
  spec.add_development_dependency "bundler"
45
- spec.add_development_dependency "codecov"
46
45
  spec.add_development_dependency "overcommit", "~> 0.46.0"
47
46
  spec.add_development_dependency "pry", "< 0.13.0"
48
47
  spec.add_development_dependency "pry-byebug", "~> 3.6.0"
@@ -3,7 +3,7 @@
3
3
  module Honeycomb
4
4
  module Beeline
5
5
  NAME = "honeycomb-beeline".freeze
6
- VERSION = "2.5.0".freeze
6
+ VERSION = "2.8.0".freeze
7
7
  USER_AGENT_SUFFIX = "#{NAME}/#{VERSION}".freeze
8
8
  end
9
9
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "socket"
4
- require "honeycomb/propagation/honeycomb"
4
+ require "honeycomb/propagation/default"
5
5
 
6
6
  module Honeycomb
7
7
  # Used to configure the Honeycomb client
@@ -75,7 +75,7 @@ module Honeycomb
75
75
  @http_trace_parser_hook
76
76
  else
77
77
  # by default we try to parse incoming honeycomb traces
78
- HoneycombPropagation::UnmarshalTraceContext.method(:parse_rack_env)
78
+ DefaultPropagation::UnmarshalTraceContext.method(:parse_rack_env)
79
79
  end
80
80
  end
81
81
 
@@ -8,12 +8,13 @@ module Honeycomb
8
8
  # Included in the configuration object to specify events that should be
9
9
  # subscribed to
10
10
  module Configuration
11
- attr_accessor :notification_events
11
+ attr_writer :notification_events
12
12
 
13
13
  def after_initialize(client)
14
14
  super(client) if defined?(super)
15
15
 
16
- events = notification_events || []
16
+ events = notification_events | active_support_handlers.keys
17
+
17
18
  ActiveSupport::Subscriber.new(client: client).tap do |sub|
18
19
  events.each do |event|
19
20
  sub.subscribe(event, &method(:handle_notification_event))
@@ -21,23 +22,44 @@ module Honeycomb
21
22
  end
22
23
  end
23
24
 
24
- def on_notification_event(&hook)
25
- if block_given?
26
- @on_notification_event = hook
25
+ def on_notification_event(event_name = nil, &hook)
26
+ if event_name
27
+ active_support_handlers[event_name] = hook
27
28
  else
28
- @on_notification_event
29
+ @default_handler = hook
29
30
  end
30
31
  end
31
32
 
32
33
  def handle_notification_event(name, span, payload)
33
- if on_notification_event
34
- on_notification_event.call(name, span, payload)
35
- else
34
+ handler = active_support_handlers.fetch(name, default_handler)
35
+
36
+ handler.call(name, span, payload)
37
+ end
38
+
39
+ def active_support_handlers
40
+ @active_support_handlers ||= {}
41
+ end
42
+
43
+ def notification_events
44
+ @notification_events ||= []
45
+ end
46
+
47
+ def default_handler
48
+ @default_handler ||= lambda do |name, span, payload|
36
49
  payload.each do |key, value|
37
50
  # Make ActionController::Parameters parseable by libhoney.
38
51
  value = value.to_unsafe_hash if value.respond_to?(:to_unsafe_hash)
39
52
  span.add_field("#{name}.#{key}", value)
40
53
  end
54
+
55
+ # If the notification event has recorded an exception, add the
56
+ # Beeline's usual error fields to the span.
57
+ # * Uses the 2-element array on :exception in the event payload
58
+ # to support Rails 4. If Rails 4 support is dropped, consider
59
+ # the :exception_object added in Rails 5.
60
+ error, error_detail = payload[:exception]
61
+ span.add_field("error", error) if error
62
+ span.add_field("error_detail", error_detail) if error_detail
41
63
  end
42
64
  end
43
65
  end
@@ -5,9 +5,9 @@ require "faraday"
5
5
  module Honeycomb
6
6
  # Faraday middleware to create spans around outgoing http requests
7
7
  class Faraday < ::Faraday::Middleware
8
- def initialize(app, client:)
8
+ def initialize(app, options)
9
9
  super(app)
10
- @client = client
10
+ @client = options[:client]
11
11
  end
12
12
 
13
13
  def call(env)
@@ -26,9 +26,9 @@ module Honeycomb
26
26
 
27
27
  attr_reader :app, :client
28
28
 
29
- def initialize(app, client:)
29
+ def initialize(app, options)
30
30
  @app = app
31
- @client = client
31
+ @client = options[:client]
32
32
  end
33
33
 
34
34
  def call(env)
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "honeycomb/propagation/honeycomb"
4
+ require "honeycomb/propagation/w3c"
5
+
6
+ module Honeycomb
7
+ # Default behavior for handling trace propagation
8
+ module DefaultPropagation
9
+ # Parse incoming trace headers.
10
+ #
11
+ # Checks for and parses Honeycomb's trace header or, if not found,
12
+ # then checks for and parses W3C trace parent header.
13
+ module UnmarshalTraceContext
14
+ def parse_rack_env(env)
15
+ if env["HTTP_X_HONEYCOMB_TRACE"]
16
+ HoneycombPropagation::UnmarshalTraceContext.parse_rack_env env
17
+ elsif env["HTTP_TRACEPARENT"]
18
+ W3CPropagation::UnmarshalTraceContext.parse_rack_env env
19
+ else
20
+ [nil, nil, nil, nil]
21
+ end
22
+ end
23
+ module_function :parse_rack_env
24
+ public :parse_rack_env
25
+ end
26
+ end
27
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: honeycomb-beeline
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.0
4
+ version: 2.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Holman
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-07-16 00:00:00.000000000 Z
11
+ date: 2021-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: libhoney
@@ -72,20 +72,6 @@ dependencies:
72
72
  - - ">="
73
73
  - !ruby/object:Gem::Version
74
74
  version: '0'
75
- - !ruby/object:Gem::Dependency
76
- name: codecov
77
- requirement: !ruby/object:Gem::Requirement
78
- requirements:
79
- - - ">="
80
- - !ruby/object:Gem::Version
81
- version: '0'
82
- type: :development
83
- prerelease: false
84
- version_requirements: !ruby/object:Gem::Requirement
85
- requirements:
86
- - - ">="
87
- - !ruby/object:Gem::Version
88
- version: '0'
89
75
  - !ruby/object:Gem::Dependency
90
76
  name: overcommit
91
77
  requirement: !ruby/object:Gem::Requirement
@@ -252,9 +238,15 @@ files:
252
238
  - ".circleci/setup-rubygems.sh"
253
239
  - ".editorconfig"
254
240
  - ".github/CODEOWNERS"
241
+ - ".github/ISSUE_TEMPLATE/bug_report.md"
242
+ - ".github/ISSUE_TEMPLATE/feature_request.md"
243
+ - ".github/ISSUE_TEMPLATE/question-discussion.md"
244
+ - ".github/ISSUE_TEMPLATE/security-vulnerability-report.md"
245
+ - ".github/PULL_REQUEST_TEMPLATE.md"
255
246
  - ".github/dependabot.yml"
256
247
  - ".github/workflows/add-to-project.yml"
257
248
  - ".github/workflows/apply-labels.yml"
249
+ - ".github/workflows/stale.yml"
258
250
  - ".gitignore"
259
251
  - ".overcommit.yml"
260
252
  - ".rspec"
@@ -264,12 +256,17 @@ files:
264
256
  - Appraisals
265
257
  - CHANGELOG.md
266
258
  - CODE_OF_CONDUCT.md
259
+ - CONTRIBUTING.md
267
260
  - CONTRIBUTORS.md
268
261
  - Gemfile
269
- - Gemfile.lock
270
262
  - LICENSE
263
+ - NOTICE
264
+ - OSSMETADATA
271
265
  - README.md
266
+ - RELEASING.md
272
267
  - Rakefile
268
+ - SECURITY.md
269
+ - SUPPORT.md
273
270
  - UPGRADING.md
274
271
  - bin/console
275
272
  - bin/setup
@@ -295,6 +292,7 @@ files:
295
292
  - lib/honeycomb/propagation.rb
296
293
  - lib/honeycomb/propagation/aws.rb
297
294
  - lib/honeycomb/propagation/context.rb
295
+ - lib/honeycomb/propagation/default.rb
298
296
  - lib/honeycomb/propagation/honeycomb.rb
299
297
  - lib/honeycomb/propagation/w3c.rb
300
298
  - lib/honeycomb/rollup_fields.rb
data/Gemfile.lock DELETED
@@ -1,139 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- honeycomb-beeline (2.5.0)
5
- libhoney (~> 1.14, >= 1.14.2)
6
-
7
- GEM
8
- remote: https://rubygems.org/
9
- specs:
10
- addressable (2.7.0)
11
- public_suffix (>= 2.0.2, < 5.0)
12
- ansi (1.5.0)
13
- appraisal (2.2.0)
14
- bundler
15
- rake
16
- thor (>= 0.14.0)
17
- ast (2.4.0)
18
- bump (0.9.0)
19
- byebug (10.0.2)
20
- childprocess (0.9.0)
21
- ffi (~> 1.0, >= 1.0.11)
22
- codecov (0.2.8)
23
- json
24
- simplecov
25
- coderay (1.1.2)
26
- crack (0.4.3)
27
- safe_yaml (~> 1.0.0)
28
- diff-lcs (1.3)
29
- docile (1.3.2)
30
- domain_name (0.5.20190701)
31
- unf (>= 0.0.5, < 1.0.0)
32
- excon (0.82.0)
33
- ffi (1.12.2)
34
- ffi-compiler (1.0.1)
35
- ffi (>= 1.0.0)
36
- rake
37
- hashdiff (1.0.1)
38
- http (4.4.1)
39
- addressable (~> 2.3)
40
- http-cookie (~> 1.0)
41
- http-form_data (~> 2.2)
42
- http-parser (~> 1.2.0)
43
- http-cookie (1.0.4)
44
- domain_name (~> 0.5)
45
- http-form_data (2.3.0)
46
- http-parser (1.2.3)
47
- ffi-compiler (>= 1.0, < 2.0)
48
- iniparse (1.5.0)
49
- jaro_winkler (1.5.4)
50
- json (2.3.1)
51
- libhoney (1.18.0)
52
- addressable (~> 2.0)
53
- excon
54
- http (>= 2.0, < 5.0)
55
- method_source (0.9.2)
56
- overcommit (0.46.0)
57
- childprocess (~> 0.6, >= 0.6.3)
58
- iniparse (~> 1.4)
59
- parallel (1.19.1)
60
- parser (2.7.1.2)
61
- ast (~> 2.4.0)
62
- pry (0.12.2)
63
- coderay (~> 1.1.0)
64
- method_source (~> 0.9.0)
65
- pry-byebug (3.6.0)
66
- byebug (~> 10.0)
67
- pry (~> 0.10)
68
- public_suffix (4.0.4)
69
- rainbow (3.0.0)
70
- rake (13.0.1)
71
- rspec (3.9.0)
72
- rspec-core (~> 3.9.0)
73
- rspec-expectations (~> 3.9.0)
74
- rspec-mocks (~> 3.9.0)
75
- rspec-core (3.9.2)
76
- rspec-support (~> 3.9.3)
77
- rspec-expectations (3.9.2)
78
- diff-lcs (>= 1.2.0, < 2.0)
79
- rspec-support (~> 3.9.0)
80
- rspec-mocks (3.9.1)
81
- diff-lcs (>= 1.2.0, < 2.0)
82
- rspec-support (~> 3.9.0)
83
- rspec-support (3.9.3)
84
- rspec_junit_formatter (0.4.1)
85
- rspec-core (>= 2, < 4, != 2.12.0)
86
- rubocop (0.68.1)
87
- jaro_winkler (~> 1.5.1)
88
- parallel (~> 1.10)
89
- parser (>= 2.5, != 2.5.1.1)
90
- rainbow (>= 2.2.2, < 4.0)
91
- ruby-progressbar (~> 1.7)
92
- unicode-display_width (>= 1.4.0, < 1.6)
93
- rubocop-performance (1.2.0)
94
- rubocop (>= 0.68.0)
95
- ruby-progressbar (1.10.1)
96
- safe_yaml (1.0.5)
97
- simplecov (0.18.5)
98
- docile (~> 1.1)
99
- simplecov-html (~> 0.11)
100
- simplecov-console (0.7.2)
101
- ansi
102
- simplecov
103
- terminal-table
104
- simplecov-html (0.12.2)
105
- terminal-table (1.8.0)
106
- unicode-display_width (~> 1.1, >= 1.1.1)
107
- thor (1.0.1)
108
- unf (0.1.4)
109
- unf_ext
110
- unf_ext (0.0.7.7)
111
- unicode-display_width (1.5.0)
112
- webmock (3.8.3)
113
- addressable (>= 2.3.6)
114
- crack (>= 0.3.2)
115
- hashdiff (>= 0.4.0, < 2.0.0)
116
-
117
- PLATFORMS
118
- ruby
119
-
120
- DEPENDENCIES
121
- appraisal
122
- bump
123
- bundler
124
- codecov
125
- honeycomb-beeline!
126
- overcommit (~> 0.46.0)
127
- pry (< 0.13.0)
128
- pry-byebug (~> 3.6.0)
129
- rake
130
- rspec (~> 3.0)
131
- rspec_junit_formatter
132
- rubocop (< 0.69)
133
- rubocop-performance (< 1.3.0)
134
- simplecov
135
- simplecov-console
136
- webmock
137
-
138
- BUNDLED WITH
139
- 2.2.21