binaryseed / new_relic_absinthe

Absinthe Instrumentation for the New Relic Elixir Agent
https://hex.pm/packages/new_relic_absinthe
Apache License 2.0
19 stars 13 forks source link

Telemetry transform logic #12

Closed binaryseed closed 4 years ago

binaryseed commented 5 years ago

Metadata extracted out of the main Absinthe structs...

Blueprint

operation = Absinthe.Blueprint.current_operation(blueprint)

%{
  query: blueprint.source[:body] || blueprint.source,
  schema: blueprint.schema,
  variables: options[:variables],
  operation_complexity: operation.complexity,
  operation_type: operation.type,
  operation_name: operation.name
}

Resolution

%{
  schema: res.schema,
  arguments: res.arguments,
  path: Absinthe.Resolution.path(res),
  field_name: res.definition.name,
  field_type: Absinthe.Type.name(res.definition.schema_node.type, res.schema),
  parent_type: res.parent_type.name
}