Skip to content

Sidekiq timestamp incompatibility results in NoMethodError #1795

@xathien

Description

@xathien

If the created_at field is missing on a Sidekiq message (for example, if the message was created via Exq in Elixir), this library will raise undefined method '/' for nil and a stack that ends with:

 /.../vendor/bundle/ruby/3.3.0/gems/opentelemetry-instrumentation-sidekiq-0.26.1/lib/opentelemetry/instrumentation/sidekiq/middlewares/server/tracer_middleware.rb:78:in `time_from_timestamp'
       /.../vendor/bundle/ruby/3.3.0/gems/opentelemetry-instrumentation-sidekiq-0.26.1/lib/opentelemetry/instrumentation/sidekiq/middlewares/server/tracer_middleware.rb:34:in `call'
       /.../vendor/bundle/ruby/3.3.0/gems/sidekiq-7.1.6/lib/sidekiq/middleware/chain.rb:182:in `traverse'

Broken by this commit, as it tries to convert a nonexistent created_at

Simplified Reproduction:

  1. With a Sidekiq server that's using opentelemetry-instrumentation-sidekiq
  2. Add a Sidekiq-compatible job to Redis that doesn't include created_at via manual enqueue or Exq or some other method

Tip: React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more in our end user docs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions