Class: GraphQL::Tracing::NewRelicTrace::NewrelicMonitor
Defined Under Namespace
Classes: Event
Constant Summary
collapse
- PARSE_NAME =
"GraphQL/parse"
- LEX_NAME =
"GraphQL/lex"
- VALIDATE_NAME =
"GraphQL/validate"
- EXECUTE_NAME =
"GraphQL/execute"
- ANALYZE_NAME =
"GraphQL/analyze"
Instance Method Summary
collapse
#fallback_transaction_name, #initialize, #name_for, #start_event, #transaction_name
Instance Method Details
#instrument(keyword, payload, &block) ⇒ Object
28
29
30
31
32
33
34
35
36
37
|
# File 'lib/graphql/tracing/new_relic_trace.rb', line 28
def instrument(keyword, payload, &block)
if keyword == :execute
query = payload.queries.first
set_this_txn_name = query.context[:set_new_relic_transaction_name]
if set_this_txn_name || (set_this_txn_name.nil? && @set_transaction_name)
NewRelic::Agent.set_transaction_name(transaction_name(query))
end
end
::NewRelic::Agent::MethodTracerHelpers.trace_execution_scoped(name_for(keyword, payload), &block)
end
|
47
48
49
|
# File 'lib/graphql/tracing/new_relic_trace.rb', line 47
def platform_authorized_key(type)
"GraphQL/Authorized/#{type.graphql_name}"
end
|
43
44
45
|
# File 'lib/graphql/tracing/new_relic_trace.rb', line 43
def platform_field_key(field)
"GraphQL/#{field.owner.graphql_name}/#{field.graphql_name}"
end
|
51
52
53
|
# File 'lib/graphql/tracing/new_relic_trace.rb', line 51
def platform_resolve_type_key(type)
"GraphQL/ResolveType/#{type.graphql_name}"
end
|
39
40
41
|
# File 'lib/graphql/tracing/new_relic_trace.rb', line 39
def platform_source_class_key(source_class)
"GraphQL/Source/#{source_class.name}"
end
|