Add GraphQL operation name to caller_id for endpoint targeting

What does this MR do and why?

Add GraphQL operation name to caller_id for endpoint targeting. Currently GraphQL caller_id is always GraphqlController#execute which is not very useful. This MR will add the operation name as a suffix such as GraphqlController#execute:getProjects. This brings GraphQL in line with REST endpoints.

Benefits:

  • Enable feature flags for specific GraphQL operations
  • Opt-out problematic queries during incidents
  • Gradual rollout of GraphQL performance improvements
  • Better observability in Kibana by operation name

Example usage with endpoint actors:

  # Target specific GraphQL operation
  Feature.enable(:cache_projects, Feature.endpoint('GraphqlController#execute:getProjects'))

  # Opt-out slow query during incident
  Feature.opt_out(:expensive_feature, Feature.endpoint('GraphqlController#execute:getAllIssues'))

The operation name is extracted from the operationName parameter sent by GraphQL clients and appended to the base caller_id in a before_action.

Feature flag: This change is behind the graphql_caller_id_with_operation_name feature flag to allow safe rollout and ensure existing systems that depend on the exact caller_id format are not disrupted.

Related to !216754 (merged)

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Alex Pooley

Merge request reports

Loading
Loading