Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bulk Distribution Metric #2312

Open
mu4farooqi opened this issue May 16, 2024 · 1 comment
Open

Bulk Distribution Metric #2312

mu4farooqi opened this issue May 16, 2024 · 1 comment

Comments

@mu4farooqi
Copy link

I want to capture metrics in a Sidekiq job where I'm doing batch processing. I'm doing something like following:

  time_now = Time.now.utc.to_f
  messages.each do |message|
    Sentry::Metrics.distribution(
      'message_dispatch_latency', time_now - message.created_at.to_f, unit: 'millisecond'
    )
  end

Is there a better way to do this. Because here if we have 10 messages, we'll make 10 network calls right? Do we have any option to send bulk metrics.

@sl0thentr0py
Copy link
Member

@mu4farooqi that will not send 10 network calls, we locally collect the metrics in a thread and flush them out every 5 seconds. The aggregation / batching is already handled by the SDK. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Waiting for: Community
Development

No branches or pull requests

2 participants