Hasura on Google Cloud Run - Monitoring

249 views Asked by At

I would like to have a monitoring on my Hasura API on Google Cloud Run. Actually I'm using the monitoring of Google Cloud but It is not really perfect. I have the count of 200 code request. But I want for example, the number of each query / mutation endpoint request.

I want :

count 123 : /graphql/user
count 234 :/graphql/profil

I have :

count 357 : /graphql

If you have an idea. Thanks

1

There are 1 answers

1
Gavin Ray On

You can't do this with GraphQL unfortunately. All queries are sent to the /v1/graphql endpoint on Hasura, and the only way to distinguish the operations is by parsing the query parameter of the HTTP request and grabbing the operation name.

If Google Cloud allows you to query properties in logs of HTTP requests, you can set up filters on the body, something like:

"Where [request params].query includes 'MyQueryName'"

Otherwise your two options are:

  1. Use Hasura Cloud (https://hasura.io/cloud), which gives you a count of all operations and detailed metrics (response time, variables, etc) on your console dashboard
  2. Write and deploy a custom middleware server or a script for a reverse proxy that handles this