Skip to content

Documentation around 4 -> 5 upgrade; ArgumentError: Start sender first #274

@wjessop

Description

@wjessop

I'm unsure what I need to do to make the 4 to 5 upgrade work. I see the README file has some detail:

  • Using a singleton instance of the DogStatsD client instead of creating a new instance whenever you need one; this will let the buffering mechanism flush metrics regularly
  • Or properly disposing of the DogStatsD client instance when it is not needed anymore using the method Datadog::Statsd#close

but I thought we were using a singleton instance, and I don't think we want to be sprinkling #close around the code. The current way we're creating the instance is in an initialiser:

require 'datadog/statsd'

Rails.configuration.statsd = Datadog::Statsd.new(
  tags: {
    env: Rails.env
  },
  disable_telemetry: Rails.env != 'production'
)

then we use it like so:

Rails.configuration.statsd.distribution('elasticsearch.client.response_time', duration, tags: tags)

Deployed on Heroku using Puma, we're getting an error #<ArgumentError: Start sender first> that is crashing the Rails (6.1.7.3) process on boot. Is there something else we should be doing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions