Skip to content

Commit e72c59a

Browse files
committed
Fix MetricEvent timestamp serialization to float
1 parent 299d0a3 commit e72c59a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

sentry-ruby/lib/sentry/metric_event.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def to_h
3333
type: @type,
3434
value: @value,
3535
unit: @unit,
36-
timestamp: @timestamp,
36+
timestamp: @timestamp.to_f,
3737
trace_id: @trace_id,
3838
span_id: @span_id,
3939
attributes: serialize_attributes

sentry-ruby/spec/sentry/metric_event_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
expect(hash[:type]).to eq(:distribution)
6060
expect(hash[:value]).to eq(5.0)
6161
expect(hash[:unit]).to eq("seconds")
62-
expect(hash[:timestamp]).to be_a(Time)
62+
expect(hash[:timestamp]).to be_a(Float)
6363
end
6464

6565
it "includes trace info if provided" do

0 commit comments

Comments
 (0)