Skip to content
GitLab
Next
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • GitLab FOSS GitLab FOSS
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1
    • Merge requests 1
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.orgGitLab.org
  • GitLab FOSSGitLab FOSS
  • Issues
  • #59587
Closed
Open
Issue created Mar 27, 2019 by Brett Walker@digitalmoksha1️⃣Developer

Add logging to GraphQL

I think it would be good to add some logging to our GraphQL api. There are a couple immediate places it can be added:

In GitlabSchema, for logging query complexity, as mentioned in Prevent complex queries

  log_query_complexity = GraphQL::Analysis::QueryComplexity.new { |query, complexity| Rails.logger.info("[GraphQL Query Complexity] #{complexity}  | admin? #{query.context[:current_user]&.admin?}")}
  query_analyzer(log_query_complexity)

Also logging timeout errors, as mentioned in Timeout

Do we create a new log file, log/graphql_json.log or use the existing log/api_json.log?

MR: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/27885

EE backport: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/13620

Edited May 30, 2019 by charlie ablett
Assignee
Assign to
Time tracking