Skip to content

Data argument supplied to Telemetry#record fails when it is a Hash #3

Description

@ntl
include 'telemetry'

class SomeSink
  include Telemetry::Sink
  record :some_signal
end

sink = SomeSink.new

telemetry = Telemetry.build
telemetry.register sink

# does not raise an error
data = "not a hash"
telemetry.record(:some_signal, data)

# raises error!
data = { :some_key => 'some value' }
telemetry.record(:some_signal, data)

The problem is ultimately that, if data is a hash, then ruby considers it a container of keyword arguments. This is because the sink's record method has a keyword argument, force.

Metadata

Metadata

Assignees

No one assigned

    Labels

    problemMalfunction, bug, defect, aberration, irregularity, flaw, error, fault, and the like

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions