Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- `config.enabled_environments` now defaults to `nil` instead of `[]` for sending to all environments ([#2716](https://github.com/getsentry/sentry-ruby/pull/2716))
- Remove `:monotonic_active_support_logger` from `config.breadcrumbs_logger` ([#2717](https://github.com/getsentry/sentry-ruby/pull/2717))
- Requests which have response status codes in the inclusive ranges `[(301..303), (305..399), (401..404)]` will no longer create transactions by default. See `config.trace_ignore_status_codes` below to control what gets traced.
- Remove `Sentry::Metrics` and `config.metrics` and all metrics related code ([#2729](https://github.com/getsentry/sentry-ruby/pull/2729))

### Features

Expand Down
13 changes: 0 additions & 13 deletions sentry-ruby/lib/sentry-ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
require "sentry/session_flusher"
require "sentry/backpressure_monitor"
require "sentry/cron/monitor_check_ins"
require "sentry/metrics"
require "sentry/vernier/profiler"

[
Expand Down Expand Up @@ -59,7 +58,6 @@ module Sentry
logger
session_flusher
backpressure_monitor
metrics_aggregator
exception_locals_tp
].freeze

Expand Down Expand Up @@ -93,10 +91,6 @@ def exception_locals_tp
# @return [BackpressureMonitor, nil]
attr_reader :backpressure_monitor

# @!attribute [r] metrics_aggregator
# @return [Metrics::Aggregator, nil]
attr_reader :metrics_aggregator

##### Patch Registration #####

# @!visibility private
Expand Down Expand Up @@ -252,7 +246,6 @@ def init(&block)
@background_worker = Sentry::BackgroundWorker.new(config)
@session_flusher = config.session_tracking? ? Sentry::SessionFlusher.new(config, client) : nil
@backpressure_monitor = config.enable_backpressure_handling ? Sentry::BackpressureMonitor.new(config, client) : nil
@metrics_aggregator = config.metrics.enabled ? Sentry::Metrics::Aggregator.new(config, client) : nil
exception_locals_tp.enable if config.include_local_variables
at_exit { close }
end
Expand All @@ -273,12 +266,6 @@ def close
@backpressure_monitor = nil
end

if @metrics_aggregator
@metrics_aggregator.flush(force: true)
@metrics_aggregator.kill
@metrics_aggregator = nil
end

if client = get_current_client
client.flush

Expand Down
6 changes: 0 additions & 6 deletions sentry-ruby/lib/sentry/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
require "sentry/release_detector"
require "sentry/transport/configuration"
require "sentry/cron/configuration"
require "sentry/metrics/configuration"
require "sentry/linecache"
require "sentry/interfaces/stacktrace_builder"
require "sentry/logger"
Expand Down Expand Up @@ -276,10 +275,6 @@ def logger
# @return [Cron::Configuration]
attr_reader :cron

# Metrics related configuration.
# @return [Metrics::Configuration]
attr_reader :metrics

# Take a float between 0.0 and 1.0 as the sample rate for tracing events (transactions).
# @return [Float, nil]
attr_reader :traces_sample_rate
Expand Down Expand Up @@ -531,7 +526,6 @@ def initialize

@transport = Transport::Configuration.new
@cron = Cron::Configuration.new
@metrics = Metrics::Configuration.new(self.sdk_logger)
@structured_logging = StructuredLoggingConfiguration.new
@gem_specs = Hash[Gem::Specification.map { |spec| [spec.name, spec.version.to_s] }] if Gem::Specification.respond_to?(:map)

Expand Down
6 changes: 3 additions & 3 deletions sentry-ruby/lib/sentry/cron/monitor_check_ins.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ def perform(*args, **opts)
:in_progress,
monitor_config: monitor_config)

start = Metrics::Timing.duration_start
start = Process.clock_gettime(Process::CLOCK_MONOTONIC)

begin
# need to do this on ruby <= 2.6 sadly
ret = method(:perform).super_method.arity == 0 ? super() : super
duration = Metrics::Timing.duration_end(start)
duration = Process.clock_gettime(Process::CLOCK_MONOTONIC) - start

Sentry.capture_check_in(slug,
:ok,
Expand All @@ -29,7 +29,7 @@ def perform(*args, **opts)

ret
rescue Exception
duration = Metrics::Timing.duration_end(start)
duration = Process.clock_gettime(Process::CLOCK_MONOTONIC) - start

Sentry.capture_check_in(slug,
:error,
Expand Down
1 change: 0 additions & 1 deletion sentry-ruby/lib/sentry/envelope/item.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ def self.data_category(type)
when "session", "attachment", "transaction", "profile", "span", "log" then type
when "sessions" then "session"
when "check_in" then "monitor"
when "statsd", "metric_meta" then "metric_bucket"
when "event" then "error"
when "client_report" then "internal"
else "default"
Expand Down
8 changes: 0 additions & 8 deletions sentry-ruby/lib/sentry/interfaces/stacktrace_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,6 @@ def build(backtrace:, &frame_callback)
StacktraceInterface.new(frames: frames)
end

# Get the code location hash for a single line for where metrics where added.
# @return [Hash]
def metrics_code_location(unparsed_line)
parsed_line = Backtrace::Line.parse(unparsed_line)
frame = convert_parsed_line_into_frame(parsed_line)
frame.to_h.reject { |k, _| %i[project_root in_app].include?(k) }
end

private

def convert_parsed_line_into_frame(line)
Expand Down
68 changes: 0 additions & 68 deletions sentry-ruby/lib/sentry/metrics.rb

This file was deleted.

Loading
Loading