Module: GraphQL::Tracing::NewRelicTrace
- Includes:
- PlatformTrace
- Defined in:
- lib/graphql/tracing/new_relic_trace.rb
Instance Method Summary
collapse
#platform_authorized_lazy, #platform_execute_field_lazy, #platform_resolve_type_lazy
Instance Method Details
#execute_query(query:) ⇒ Object
18
19
20
21
22
23
24
25
26
|
# File 'lib/graphql/tracing/new_relic_trace.rb', line 18
def execute_query(query:)
set_this_txn_name = query.context[:set_new_relic_transaction_name]
if set_this_txn_name == true || (set_this_txn_name.nil? && @set_transaction_name)
NewRelic::Agent.set_transaction_name(transaction_name(query))
end
NewRelic::Agent::MethodTracerHelpers.trace_execution_scoped("GraphQL/execute") do
super
end
end
|
#initialize(set_transaction_name: false, **_rest) ⇒ Object
13
14
15
16
|
# File 'lib/graphql/tracing/new_relic_trace.rb', line 13
def initialize(set_transaction_name: false, **_rest)
@set_transaction_name = set_transaction_name
super
end
|
52
53
54
55
56
|
# File 'lib/graphql/tracing/new_relic_trace.rb', line 52
def platform_authorized(platform_key)
NewRelic::Agent::MethodTracerHelpers.trace_execution_scoped(platform_key) do
yield
end
end
|
68
69
70
|
# File 'lib/graphql/tracing/new_relic_trace.rb', line 68
def platform_authorized_key(type)
"GraphQL/Authorize/#{type.graphql_name}"
end
|
46
47
48
49
50
|
# File 'lib/graphql/tracing/new_relic_trace.rb', line 46
def platform_execute_field(platform_key)
NewRelic::Agent::MethodTracerHelpers.trace_execution_scoped(platform_key) do
yield
end
end
|
64
65
66
|
# File 'lib/graphql/tracing/new_relic_trace.rb', line 64
def platform_field_key(field)
"GraphQL/#{field.owner.graphql_name}/#{field.graphql_name}"
end
|
58
59
60
61
62
|
# File 'lib/graphql/tracing/new_relic_trace.rb', line 58
def platform_resolve_type(platform_key)
NewRelic::Agent::MethodTracerHelpers.trace_execution_scoped(platform_key) do
yield
end
end
|
72
73
74
|
# File 'lib/graphql/tracing/new_relic_trace.rb', line 72
def platform_resolve_type_key(type)
"GraphQL/ResolveType/#{type.graphql_name}"
end
|