doc/development/graphql_guide/monitoring.md
We use Kibana to filter GraphQL query logs. Sign in to Kibana
with a @gitlab.com email address.
In Kibana we can inspect two kinds of GraphQL logs:
In a multiplex query, each individual query is logged separately. We can use subcomponent filtering to inspect these logs. Visit Kibana with this filter enabled or set up the subcomponent filter using these steps:
json.subcomponentisgraphql_jsonYou can select Kibana fields from the Available fields section of the sidebar to add columns to the log table, or visit this view, which already has a set of Kibana fields selected.
Some relevant Kibana fields include:
| Kibana field | Description |
|---|---|
json.operation_name | The operation name used by the client. |
json.operation_fingerprint | The fingerprint of the query, used to recognize repeated queries over time. |
json.meta.caller_id | Appears as graphql:<operation_name> for queries that came from the GitLab frontend, otherwise as graphql:unknown. Can be used to identify internal versus external queries. |
json.graphql_errors.message | Top-level error message returned in response. |
json.graphql_errors.extensions.fieldName | Name of field that caused a top-level error. |
json.graphql_errors.extensions.argumentName | Name of argument that caused a top-level error. |
json.query_string | The query string itself. |
json.is_mutation | true when a mutation, false when not. |
json.query_analysis.used_fields | List of GraphQL fields selected by the query. |
json.query_analysis.used_deprecated_fields | List of deprecated GraphQL fields selected by the query. |
json.query_analysis.used_deprecated_arguments | List of deprecated GraphQL arguments selected by the query. |
json.query_analysis.duration_s | Duration of query execution in seconds. |
json.query_analysis.complexity | The complexity score of the query. |
Below are some examples of common Kibana filters.
json.query_analysis.used_fieldsisType.myField, where Type.myField is the type name and field name as it
appears in our GraphQL API resources documentation.json.query_analysis.used_deprecated_fieldsisType.myField, where Type.myField is the type name and field name as it
appears in our GraphQL API resources documentation.As mentioned above, json.meta.caller_id appears as graphql:<operation_name> for queries that
came from the GitLab frontend, otherwise as graphql:unknown. This filter be used to identify internal versus external queries.
json.meta.caller_idisgraphql:unknownYou can see logs of the top-level errors returned by mutations and queries.
json.graphql_errors.messageexistsThe full request logs encompass log data for all multiplexed queries
in the request, as well as data from time spent outside of GraphQLController#execute.
To see the full request logs, do not apply the json.subcomponent filter, and instead:
json.meta.caller_idisGraphqlController#executeSome differences from the query logs described above:
json.query_analysis.used_fields you select json.graphql.used_fields.