class Sentry::MetricEvent

def initialize(

def initialize(
  name:,
  type:,
  value:,
  unit: nil,
  attributes: nil
)
  @name = name
  @type = type
  @value = value
  @unit = unit
  @attributes = attributes || {}
  @timestamp = Sentry.utc_now
  @trace_id = nil
  @span_id = nil
end

def serialize_attributes

def serialize_attributes
  @attributes.transform_values { |v| attribute_hash(v) }
end

def to_h

def to_h
  {
    name: @name,
    type: @type,
    value: @value,
    unit: @unit,
    timestamp: @timestamp.to_f,
    trace_id: @trace_id,
    span_id: @span_id,
    attributes: serialize_attributes
  }.compact
end