Class: Datadog::Notifications::Plugins::GRPC

Inherits:
Base
  • Object
show all
Defined in:
lib/datadog/notifications/plugins/grpc.rb

Instance Attribute Summary

Attributes inherited from Base

#tags

Instance Method Summary collapse

Constructor Details

#initialize(metric_name: 'grpc.request', **opts) ⇒ GRPC

Options:

*:metric_name - the metric name, defaults to ‘grpc.request’ *:tags - additional tags

It expects ActiveSupport instrumented notifications named ‘process_action.grpc’. Notification payload should have :service (service name, string) and :action (service action/method name, string) keys.

Compatible instrumentation is implemented in grpcx gem: github.com/bsm/grpcx (>= 0.2.0)



12
13
14
15
16
17
18
19
# File 'lib/datadog/notifications/plugins/grpc.rb', line 12

def initialize(metric_name: 'grpc.request', **opts)
  super

  @metric_name = metric_name
  Datadog::Notifications.subscribe 'process_action.grpc' do |reporter, event|
    record reporter, event
  end
end