Reading GraphQL logs
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:
- Logs of each GraphQL query executed within the request.
- Logs of the full request, which due to query multiplexing may have executed multiple queries.
Logs of each GraphQL query
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:
- Add a filter:
- Filter:
json.subcomponent
- Operator:
is
- Value:
graphql_json
- Filter:
- Select Refresh.
You 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.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. |
Useful filters
Below are some examples of common Kibana filters.
See field usage
- Combine the subcomponent filter with the following Kibana filter:
- Filter:
json.query_analysis.used_fields
- Operator:
is
- Value:
Type.myField
, whereType.myField
is the type name and field name as it appears in our GraphQL API resources documentation.
- Filter:
- Select Refresh.
See deprecated field usage
- Combine the subcomponent filter with the following Kibana filter:
- Filter:
json.query_analysis.used_deprecated_fields
- Operator:
is
- Value:
Type.myField
, whereType.myField
is the type name and field name as it appears in our GraphQL API resources documentation.
- Filter:
- Select Refresh.
See queries that were not made by our frontend
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.
- Combine the subcomponent filter with the following Kibana filter:
- Filter:
json.meta.caller_id
- Operator:
is
- Value:
graphql:unknown
- Filter:
- Select Refresh.
Logs of the full request
The 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:
- Add a filter:
- Filter:
json.meta.caller_id
- Operator:
is
- Value:
GraphqlController#execute
- Filter:
- Select Refresh.
Some differences from the query logs described above:
- Some of the Kibana fields mentioned above are not available to the full request logs.
- The names of filters differ. For example, instead of
json.query_analysis.used_fields
you selectjson.graphql.used_fields
.
Docs
Edit this page to fix an error or add an improvement in a merge request.
Create an issue to suggest an improvement to this page.
Product
Create an issue if there's something you don't like about this feature.
Propose functionality by submitting a feature request.
Feature availability and product trials
View pricing to see all GitLab tiers and features, or to upgrade.
Try GitLab for free with access to all features for 30 days.
Get help
If you didn't find what you were looking for, search the docs.
If you want help with something specific and could use community support, post on the GitLab forum.
For problems setting up or using this feature (depending on your GitLab subscription).
Request support