Module: Datadog::Tracing::Contrib::Pg::Instrumentation::InstanceMethods

Defined in:
lib/datadog/tracing/contrib/pg/instrumentation.rb

Overview

PG::Connection patch methods

Instance Method Summary collapse

Instance Method Details

#async_exec(sql, *args, &block) ⇒ Object

async_exec is an alias to exec



48
49
50
51
52
53
54
# File 'lib/datadog/tracing/contrib/pg/instrumentation.rb', line 48

def async_exec(sql, *args, &block)
  return super unless enabled?

  trace(Ext::SPAN_ASYNC_EXEC, sql: sql, block: block) do |sql_statement, wrapped_block|
    super(sql_statement, *args, &wrapped_block)
  end
end

#async_exec_params(sql, params, *args, &block) ⇒ Object

async_exec_params is an alias to exec_params



57
58
59
60
61
62
63
# File 'lib/datadog/tracing/contrib/pg/instrumentation.rb', line 57

def async_exec_params(sql, params, *args, &block)
  return super unless enabled?

  trace(Ext::SPAN_ASYNC_EXEC_PARAMS, sql: sql, block: block) do |sql_statement, wrapped_block|
    super(sql_statement, params, *args, &wrapped_block)
  end
end

#async_exec_prepared(statement_name, params, *args, &block) ⇒ Object

async_exec_prepared is an alias to exec_prepared



66
67
68
69
70
71
72
# File 'lib/datadog/tracing/contrib/pg/instrumentation.rb', line 66

def async_exec_prepared(statement_name, params, *args, &block)
  return super unless enabled?

  trace(Ext::SPAN_ASYNC_EXEC_PREPARED, statement_name: statement_name, block: block) do |_, wrapped_block|
    super(statement_name, params, *args, &wrapped_block)
  end
end

#exec(sql, *args, &block) ⇒ Object



23
24
25
26
27
28
29
# File 'lib/datadog/tracing/contrib/pg/instrumentation.rb', line 23

def exec(sql, *args, &block)
  return super unless enabled?

  trace(Ext::SPAN_EXEC, sql: sql, block: block) do |sql_statement, wrapped_block|
    super(sql_statement, *args, &wrapped_block)
  end
end

#exec_params(sql, params, *args, &block) ⇒ Object



31
32
33
34
35
36
37
# File 'lib/datadog/tracing/contrib/pg/instrumentation.rb', line 31

def exec_params(sql, params, *args, &block)
  return super unless enabled?

  trace(Ext::SPAN_EXEC_PARAMS, sql: sql, block: block) do |sql_statement, wrapped_block|
    super(sql_statement, params, *args, &wrapped_block)
  end
end

#exec_prepared(statement_name, params, *args, &block) ⇒ Object



39
40
41
42
43
44
45
# File 'lib/datadog/tracing/contrib/pg/instrumentation.rb', line 39

def exec_prepared(statement_name, params, *args, &block)
  return super unless enabled?

  trace(Ext::SPAN_EXEC_PREPARED, statement_name: statement_name, block: block) do |_, wrapped_block|
    super(statement_name, params, *args, &wrapped_block)
  end
end

#sync_exec(sql, *args, &block) ⇒ Object



74
75
76
77
78
79
80
# File 'lib/datadog/tracing/contrib/pg/instrumentation.rb', line 74

def sync_exec(sql, *args, &block)
  return super unless enabled?

  trace(Ext::SPAN_SYNC_EXEC, sql: sql, block: block) do |sql_statement, wrapped_block|
    super(sql_statement, *args, &wrapped_block)
  end
end

#sync_exec_params(sql, params, *args, &block) ⇒ Object



82
83
84
85
86
87
88
# File 'lib/datadog/tracing/contrib/pg/instrumentation.rb', line 82

def sync_exec_params(sql, params, *args, &block)
  return super unless enabled?

  trace(Ext::SPAN_SYNC_EXEC_PARAMS, sql: sql, block: block) do |sql_statement, wrapped_block|
    super(sql_statement, params, *args, &wrapped_block)
  end
end

#sync_exec_prepared(statement_name, params, *args, &block) ⇒ Object



90
91
92
93
94
95
96
# File 'lib/datadog/tracing/contrib/pg/instrumentation.rb', line 90

def sync_exec_prepared(statement_name, params, *args, &block)
  return super unless enabled?

  trace(Ext::SPAN_SYNC_EXEC_PREPARED, statement_name: statement_name, block: block) do |_, wrapped_block|
    super(statement_name, params, *args, &wrapped_block)
  end
end