hasura / hasura/graphql-engine

Query operation name in logs randomly chooses between detail.operation.query.operationName and detail.query.operationName

Open
#7,551 0 comments 0 reactions 0 assignees View on GitHub
k/bug
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

### Version Information

Server Version:
2.0.9
### Environment

Docker swarm

### What is the expected behaviour?

Hasura query log json should have a single field operationName that says what the operation name of the query was. Is there a reason both of these keys in the json blob exist? it seems redundant

### Keywords

operationName
incorrect logs

### What is the current behaviour?

the operation name is randomly put between either
detail.operation.query.operationName or detail.query.operationName but never both

### How to reproduce the issue?

* read logs in column form with the two json keys
* notice that only one key is ever populated
### Screenshots or Screencast
![image](https://user-images.githubusercontent.com/7849025/133315696-a4ab1655-b3ab-4793-a95d-36ba749ab5cf.png)
Query names are censored but you can clearly see the behavior I mentioned above with it flip/flopping.
At a glance when looking through the logs it appears that each query type chooses one or the other consistently

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue from Docker Swarm logs and compare the two reported operationName paths across query types. The change is done when each query log exposes one consistent operationName field without the flip-flopping described in the report.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
observability
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.