-
Notifications
You must be signed in to change notification settings - Fork 1
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
Bump sentry-ruby from 5.14.0 to 5.15.0 #550
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem compare sentry-ruby 5.14.0 5.15.0 Compared versions: ["5.14.0", "5.15.0"]
DIFFERENT date:
5.14.0: 2023-11-27 00:00:00 UTC
5.15.0: 2023-12-05 00:00:00 UTC
DIFFERENT version:
5.14.0: 5.14.0
5.15.0: 5.15.0
DIFFERENT files:
5.14.0->5.15.0:
* Added:
lib/sentry/transport/spotlight_transport.rb +50/-0
* Changed:
lib/sentry/client.rb +7/-0
lib/sentry/configuration.rb +10/-1
lib/sentry/cron/monitor_check_ins.rb +1/-1
lib/sentry/transport.rb +1/-12
lib/sentry/transport/http_transport.rb +61/-32
lib/sentry/version.rb +1/-1 |
gem compare --diff sentry-ruby 5.14.0 5.15.0 Compared versions: ["5.14.0", "5.15.0"]
DIFFERENT files:
5.14.0->5.15.0:
* Added:
lib/sentry/transport/spotlight_transport.rb
--- /tmp/20231206-1998-s6fsvk 2023-12-06 03:55:15.538008937 +0000
+++ /tmp/d20231206-1998-zl0k43/sentry-ruby-5.15.0/lib/sentry/transport/spotlight_transport.rb 2023-12-06 03:55:15.534008977 +0000
@@ -0,0 +1,50 @@
+# frozen_string_literal: true
+
+require "net/http"
+require "zlib"
+
+module Sentry
+ # Designed to just report events to Spotlight in development.
+ class SpotlightTransport < HTTPTransport
+ DEFAULT_SIDECAR_URL = "http://localhost:8969/stream"
+ MAX_FAILED_REQUESTS = 3
+
+ def initialize(configuration)
+ super
+ @sidecar_url = configuration.spotlight.is_a?(String) ? configuration.spotlight : DEFAULT_SIDECAR_URL
+ @failed = 0
+ @logged = false
+
+ log_debug("[Spotlight] initialized for url #{@sidecar_url}")
+ end
+
+ def endpoint
+ "/stream"
+ end
+
+ def send_data(data)
+ if @failed >= MAX_FAILED_REQUESTS
+ unless @logged
+ log_debug("[Spotlight] disabling because of too many request failures")
+ @logged = true
+ end
+
+ return
+ end
+
+ super
+ end
+
+ def on_error
+ @failed += 1
+ end
+
+ # Similar to HTTPTransport connection, but does not support Proxy and SSL
+ def conn
+ sidecar = URI(@sidecar_url)
+ connection = ::Net::HTTP.new(sidecar.hostname, sidecar.port, nil)
+ connection.use_ssl = false
+ connection
+ end
+ end
+end
* Changed:
lib/sentry/client.rb
--- /tmp/d20231206-1998-zl0k43/sentry-ruby-5.14.0/lib/sentry/client.rb 2023-12-06 03:55:15.518009135 +0000
+++ /tmp/d20231206-1998-zl0k43/sentry-ruby-5.15.0/lib/sentry/client.rb 2023-12-06 03:55:15.530009016 +0000
@@ -12,0 +13,4 @@
+ # The Transport object that'll send events for the client.
+ # @return [SpotlightTransport, nil]
+ attr_reader :spotlight_transport
+
@@ -34,0 +39,2 @@
+
+ @spotlight_transport = SpotlightTransport.new(configuration) if configuration.spotlight
@@ -169,0 +176 @@
+ spotlight_transport&.send_event(event)
lib/sentry/configuration.rb
--- /tmp/d20231206-1998-zl0k43/sentry-ruby-5.14.0/lib/sentry/configuration.rb 2023-12-06 03:55:15.518009135 +0000
+++ /tmp/d20231206-1998-zl0k43/sentry-ruby-5.15.0/lib/sentry/configuration.rb 2023-12-06 03:55:15.530009016 +0000
@@ -144,0 +145,8 @@
+ # Whether to capture events and traces into Spotlight. Default is false.
+ # If you set this to true, Sentry will send events and traces to the local
+ # Sidecar proxy at http://localhost:8969/stream.
+ # If you want to use a different Sidecar proxy address, set this to String
+ # with the proxy URL.
+ # @return [Boolean, String]
+ attr_accessor :spotlight
+
@@ -346,0 +355 @@
+ self.spotlight = false
@@ -454 +463 @@
- valid? && capture_in_environment?
+ spotlight || (valid? && capture_in_environment?)
lib/sentry/cron/monitor_check_ins.rb
--- /tmp/d20231206-1998-zl0k43/sentry-ruby-5.14.0/lib/sentry/cron/monitor_check_ins.rb 2023-12-06 03:55:15.522009096 +0000
+++ /tmp/d20231206-1998-zl0k43/sentry-ruby-5.15.0/lib/sentry/cron/monitor_check_ins.rb 2023-12-06 03:55:15.530009016 +0000
@@ -47 +47 @@
- def sentry_monitor_slug
+ def sentry_monitor_slug(name: self.name)
lib/sentry/transport.rb
--- /tmp/d20231206-1998-zl0k43/sentry-ruby-5.14.0/lib/sentry/transport.rb 2023-12-06 03:55:15.526009056 +0000
+++ /tmp/d20231206-1998-zl0k43/sentry-ruby-5.15.0/lib/sentry/transport.rb 2023-12-06 03:55:15.534008977 +0000
@@ -122,12 +121,0 @@
- def generate_auth_header
- now = Sentry.utc_now.to_i
- fields = {
- 'sentry_version' => PROTOCOL_VERSION,
- 'sentry_client' => USER_AGENT,
- 'sentry_timestamp' => now,
- 'sentry_key' => @dsn.public_key
- }
- fields['sentry_secret'] = @dsn.secret_key if @dsn.secret_key
- 'Sentry ' + fields.map { |key, value| "#{key}=#{value}" }.join(', ')
- end
-
@@ -222,0 +211 @@
+require "sentry/transport/spotlight_transport"
lib/sentry/transport/http_transport.rb
--- /tmp/d20231206-1998-zl0k43/sentry-ruby-5.14.0/lib/sentry/transport/http_transport.rb 2023-12-06 03:55:15.526009056 +0000
+++ /tmp/d20231206-1998-zl0k43/sentry-ruby-5.15.0/lib/sentry/transport/http_transport.rb 2023-12-06 03:55:15.534008977 +0000
@@ -16,0 +17,10 @@
+ # The list of errors ::Net::HTTP is known to raise
+ # See https://github.com/ruby/ruby/blob/b0c639f249165d759596f9579fa985cb30533de6/lib/bundler/fetcher.rb#L281-L286
+ HTTP_ERRORS = [
+ Timeout::Error, EOFError, SocketError, Errno::ENETDOWN, Errno::ENETUNREACH,
+ Errno::EINVAL, Errno::ECONNRESET, Errno::ETIMEDOUT, Errno::EAGAIN,
+ Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError,
+ Zlib::BufError, Errno::EHOSTUNREACH, Errno::ECONNREFUSED
+ ].freeze
+
+
@@ -19,3 +29 @@
- @endpoint = @dsn.envelope_endpoint
-
- log_debug("Sentry HTTP Transport will connect to #{@dsn.server}")
+ log_debug("Sentry HTTP Transport will connect to #{@dsn.server}") if @dsn
@@ -35 +42,0 @@
- 'X-Sentry-Auth' => generate_auth_header,
@@ -38,0 +46,3 @@
+ auth_header = generate_auth_header
+ headers['X-Sentry-Auth'] = auth_header if auth_header
+
@@ -40 +50 @@
- request = ::Net::HTTP::Post.new(@endpoint, headers)
+ request = ::Net::HTTP::Post.new(endpoint, headers)
@@ -61,2 +71,46 @@
- rescue SocketError => e
- raise Sentry::ExternalError.new(e.message)
+ rescue SocketError, *HTTP_ERRORS => e
+ on_error if respond_to?(:on_error)
+ raise Sentry::ExternalError.new(e&.message)
+ end
+
+ def endpoint
+ @dsn.envelope_endpoint
+ end
+
+ def generate_auth_header
+ return nil unless @dsn
+
+ now = Sentry.utc_now.to_i
+ fields = {
+ 'sentry_version' => PROTOCOL_VERSION,
+ 'sentry_client' => USER_AGENT,
+ 'sentry_timestamp' => now,
+ 'sentry_key' => @dsn.public_key
+ }
+ fields['sentry_secret'] = @dsn.secret_key if @dsn.secret_key
+ 'Sentry ' + fields.map { |key, value| "#{key}=#{value}" }.join(', ')
+ end
+
+ def conn
+ server = URI(@dsn.server)
+
+ # connection respects proxy setting from @transport_configuration, or environment variables (HTTP_PROXY, HTTPS_PROXY, NO_PROXY)
+ # Net::HTTP will automatically read the env vars.
+ # See https://ruby-doc.org/3.2.2/stdlibs/net/Net/HTTP.html#class-Net::HTTP-label-Proxies
+ connection =
+ if proxy = normalize_proxy(@transport_configuration.proxy)
+ ::Net::HTTP.new(server.hostname, server.port, proxy[:uri].hostname, proxy[:uri].port, proxy[:user], proxy[:password])
+ else
+ ::Net::HTTP.new(server.hostname, server.port)
+ end
+
+ connection.use_ssl = server.scheme == "https"
+ connection.read_timeout = @transport_configuration.timeout
+ connection.write_timeout = @transport_configuration.timeout if connection.respond_to?(:write_timeout)
+ connection.open_timeout = @transport_configuration.open_timeout
+
+ ssl_configuration.each do |key, value|
+ connection.send("#{key}=", value)
+ end
+
+ connection
@@ -127,25 +180,0 @@
- end
-
- def conn
- server = URI(@dsn.server)
-
- # connection respects proxy setting from @transport_configuration, or environment variables (HTTP_PROXY, HTTPS_PROXY, NO_PROXY)
- # Net::HTTP will automatically read the env vars.
- # See https://ruby-doc.org/3.2.2/stdlibs/net/Net/HTTP.html#class-Net::HTTP-label-Proxies
- connection =
- if proxy = normalize_proxy(@transport_configuration.proxy)
- ::Net::HTTP.new(server.hostname, server.port, proxy[:uri].hostname, proxy[:uri].port, proxy[:user], proxy[:password])
- else
- ::Net::HTTP.new(server.hostname, server.port)
- end
-
- connection.use_ssl = server.scheme == "https"
- connection.read_timeout = @transport_configuration.timeout
- connection.write_timeout = @transport_configuration.timeout if connection.respond_to?(:write_timeout)
- connection.open_timeout = @transport_configuration.open_timeout
-
- ssl_configuration.each do |key, value|
- connection.send("#{key}=", value)
- end
-
- connection
lib/sentry/version.rb
--- /tmp/d20231206-1998-zl0k43/sentry-ruby-5.14.0/lib/sentry/version.rb 2023-12-06 03:55:15.526009056 +0000
+++ /tmp/d20231206-1998-zl0k43/sentry-ruby-5.15.0/lib/sentry/version.rb 2023-12-06 03:55:15.538008937 +0000
@@ -4 +4 @@
- VERSION = "5.14.0"
+ VERSION = "5.15.0" |
Bumps [sentry-ruby](https://github.com/getsentry/sentry-ruby) from 5.14.0 to 5.15.0. - [Release notes](https://github.com/getsentry/sentry-ruby/releases) - [Changelog](https://github.com/getsentry/sentry-ruby/blob/master/CHANGELOG.md) - [Commits](getsentry/sentry-ruby@5.14.0...5.15.0) --- updated-dependencies: - dependency-name: sentry-ruby dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]>
dependabot
bot
force-pushed
the
dependabot/bundler/sentry-ruby-5.15.0
branch
from
December 8, 2023 22:36
40bade3
to
23964e1
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bumps sentry-ruby from 5.14.0 to 5.15.0.
Changelog
Sourced from sentry-ruby's changelog.
Commits
f15f58e
release: 5.15.09832182
changelog for 5.15.0 (#2188)a4063d1
Spotlight Sidecar support in Sentry-Ruby (#2175)9a22f26
Add accidentally removed a test for a one-off job (#2186)b2111be
Improve default slug generation forsidekiq-scheduler
(#2184)4c8110c
Don't report network errors to Sentry (#2178)c92b0c8
Merge branch 'release/5.14.0'Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase
will rebase this PR@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it@dependabot merge
will merge this PR after your CI passes on it@dependabot squash and merge
will squash and merge this PR after your CI passes on it@dependabot cancel merge
will cancel a previously requested merge and block automerging@dependabot reopen
will reopen this PR if it is closed@dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot show <dependency name> ignore conditions
will show all of the ignore conditions of the specified dependency@dependabot ignore this major version
will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor version
will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependency
will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)