diff --git a/docs/graphql/manual/deployment/docker/index.rst b/docs/graphql/manual/deployment/docker/index.rst index 324fe851..8e3b5a01 100644 --- a/docs/graphql/manual/deployment/docker/index.rst +++ b/docs/graphql/manual/deployment/docker/index.rst @@ -88,8 +88,8 @@ Execute ``docker-run.sh`` & check if everything is running well: $ ./docker-run.sh $ docker ps - CONTAINER ID IMAGE ... CREATED STATUS PORTS ... - 097f58433a2b hasura/graphql-engine ... 1m ago Up 1m 8080->8080/tcp ... + CONTAINER ID IMAGE ... CREATED STATUS PORTS ... + 097f58433a2b hasura/graphql-engine.. ... 1m ago Up 1m 8080->8080/tcp ... Step 3: Open the hasura console ------------------------------- @@ -99,15 +99,13 @@ Head to http://localhost:8080/console to open the Hasura console. Step 4: Track existing tables and relationships ----------------------------------------------- -On the console page, you'll see your existing tables/view as "Untracked tables/views" in the console. Click the -``Add all`` button to enable GraphQL APIs over them. - -.. image:: ../../../../img/graphql/manual/getting-started/TrackTable.jpg +See :doc:`../../schema/using-existing-database` to enable GraphQL over the database. Advanced: --------- - :doc:`Securing your GraphQL endpoint ` +- :doc:`GraphQL engine server logs ` - :doc:`Updating GraphQL engine ` - :doc:`Setting up migrations <../../migrations/index>` @@ -116,4 +114,5 @@ Advanced: :hidden: Securing your GraphQL endpoint + GraphQL engine server logs Updating GraphQL engine diff --git a/docs/graphql/manual/deployment/docker/logging.rst b/docs/graphql/manual/deployment/docker/logging.rst new file mode 100644 index 00000000..ca7bbe53 --- /dev/null +++ b/docs/graphql/manual/deployment/docker/logging.rst @@ -0,0 +1,20 @@ +Hasura GraphQL engine server logs (Docker) +========================================== + +You can check logs of Hasura GraphQL engine deployed using Docker by checking the logs of the +GraphQL engine container: + +.. code-block:: bash + + $ docker ps + + CONTAINER ID IMAGE ... + cdfbc6b94c70 hasura/graphql-engine.. ... + + $ docker logs cdfbc6b94c70 + + {"timestamp":"2018-10-09T11:20:32.054+0000", "level":"info", "type":"http-log", "detail":{"status":200, "query_hash":"01640c6dd131826cff44308111ed40d7fbd1cbed", "http_version":"HTTP/1.1", "query_execution_time":3.0177627e-2, "request_id":null, "url":"/v1alpha1/graphql", "hasura_metadata":null, "ip":"127.0.0.1", "response_size":209329, "method":"POST", "hasura_role":null, "detail":null}} + ... + + +See https://docs.docker.com/config/containers/logging for more details on logging in Docker. \ No newline at end of file diff --git a/docs/graphql/manual/deployment/heroku/index.rst b/docs/graphql/manual/deployment/heroku/index.rst index 04e1fa9f..4aef9550 100644 --- a/docs/graphql/manual/deployment/heroku/index.rst +++ b/docs/graphql/manual/deployment/heroku/index.rst @@ -93,6 +93,7 @@ Advanced: - :doc:`Securing your GraphQL endpoint ` - :doc:`using-existing-heroku-database` +- :doc:`GraphQL engine server logs ` - :doc:`Updating GraphQL engine ` - :doc:`Setting up migrations <../../migrations/index>` @@ -102,4 +103,5 @@ Advanced: Securing your GraphQL endpoint using-existing-heroku-database + GraphQL engine server logs Updating GraphQL engine diff --git a/docs/graphql/manual/deployment/heroku/logging.rst b/docs/graphql/manual/deployment/heroku/logging.rst new file mode 100644 index 00000000..e323d39e --- /dev/null +++ b/docs/graphql/manual/deployment/heroku/logging.rst @@ -0,0 +1,14 @@ +Hasura GraphQL engine server logs (Heroku) +========================================== + +You can use the `Heroku CLI `_ to check logs +of Hasura GraphQL engine deployed on Heroku: + +.. code-block:: bash + + $ heroku logs --app + + 2018-10-09T11:18:21.306000+00:00 app[web.1]: {"timestamp":"2018-10-09T11:18:21.305+0000", "level":"info", "type":"http-log", "detail":{"status":200, "query_hash":"48c74f902b53a886f9ddc1b7dd12a4a6020d70c3", "http_version":"HTTP/1.1", "query_execution_time":9.477913e-3, "request_id":"b7bb6fb3-97b3-4c6f-a54a-1e0f71a190e9", "url":"/v1alpha1/graphql", "hasura_metadata":null, "ip":"171.61.77.16", "response_size":15290, "method":"POST", "hasura_role":null, "detail":null}} + ... + +See https://devcenter.heroku.com/articles/logging for more details on logging in Heroku. \ No newline at end of file diff --git a/docs/graphql/manual/deployment/index.rst b/docs/graphql/manual/deployment/index.rst index a1fdc4b9..e517e5f1 100644 --- a/docs/graphql/manual/deployment/index.rst +++ b/docs/graphql/manual/deployment/index.rst @@ -23,6 +23,10 @@ to configure Hasura GraphQL engine for your production environment: - :doc:`postgres-permissions` - :doc:`GraphQL engine server configuration ` +For access to Hasura GraphQL engine server logs, check the below page for details: + +- :doc:`Server logs ` + .. toctree:: :maxdepth: 1 @@ -35,4 +39,5 @@ to configure Hasura GraphQL engine for your production environment: securing-graphql-endpoint postgres-permissions GraphQL engine server configuration + GraphQL engine server logs Updating GraphQL engine diff --git a/docs/graphql/manual/deployment/kubernetes/index.rst b/docs/graphql/manual/deployment/kubernetes/index.rst index 2357ca7e..e831e5cd 100644 --- a/docs/graphql/manual/deployment/kubernetes/index.rst +++ b/docs/graphql/manual/deployment/kubernetes/index.rst @@ -50,7 +50,7 @@ Step 4: Open the hasura console The above creates a LoadBalancer type service with port 80. So you should be able to access the console at the external IP. -For example, using docker-for-desktop on mac: +For example, using Docker-for-desktop on Mac: .. code-block:: bash @@ -64,15 +64,13 @@ Head to: http://localhost and the console should load! Step 5: Track existing tables and relationships ----------------------------------------------- -On the console page, you'll see your existing tables/views as "Untracked tables/views" in the console. Click the -``Add all`` button to enable GraphQL APIs over them. - -.. image:: ../../../../img/graphql/manual/getting-started/TrackTable.jpg +See :doc:`../../schema/using-existing-database` to enable GraphQL over the database. Advanced: --------- - :doc:`Securing your GraphQL endpoint ` +- :doc:`GraphQL engine server logs ` - :doc:`Updating GraphQL engine ` - :doc:`Setting up migrations <../../migrations/index>` @@ -81,4 +79,5 @@ Advanced: :hidden: Securing your GraphQL endpoint + GraphQL engine server logs Updating GraphQL engine diff --git a/docs/graphql/manual/deployment/kubernetes/logging.rst b/docs/graphql/manual/deployment/kubernetes/logging.rst new file mode 100644 index 00000000..3214a616 --- /dev/null +++ b/docs/graphql/manual/deployment/kubernetes/logging.rst @@ -0,0 +1,12 @@ +Hasura GraphQL engine server logs (Kubernetes) +============================================== + +You can check logs of Hasura GraphQL engine deployed on Kubernetes by checking the logs of the +GraphQL engine deployment: + +.. code-block:: bash + + $ kubectl logs -f deploy/graphql-engine + + +See https://kubernetes.io/docs/concepts/cluster-administration/logging for more details on logging in Kubernetes. \ No newline at end of file diff --git a/docs/graphql/manual/deployment/logging.rst b/docs/graphql/manual/deployment/logging.rst new file mode 100644 index 00000000..85bcf379 --- /dev/null +++ b/docs/graphql/manual/deployment/logging.rst @@ -0,0 +1,21 @@ +Hasura GraphQL engine server logs +================================= + +Based on your deployment method, Hasura GraphQL engine logs can be accessed as follows: + +- :doc:`On Heroku ` +- :doc:`On Docker ` +- :doc:`On Kubernetes ` + +Monitoring frameworks +--------------------- + +You can integrate the logs emitted by Hasura GraphQL with external monitoring tools for better visibility as per +your convenience. + +For example, the following blog posts demonstrate integrating Hasura GraphQL engine logs with some external +monitoring frameworks: + +- `GraphQL Observability with Hasura GraphQL Engine and Honeycomb `_ + +- `Uptime Monitoring for Hasura GraphQL Engine with DataDog on GKE `_ diff --git a/docs/graphql/manual/deployment/updating.rst b/docs/graphql/manual/deployment/updating.rst index ae8a3527..0b0e9d3d 100644 --- a/docs/graphql/manual/deployment/updating.rst +++ b/docs/graphql/manual/deployment/updating.rst @@ -9,7 +9,8 @@ The current latest version is: hasura/graphql-engine:latest -Please follow the appropriate guide to update the GraphQL engine version you're running: +Based on your deployment method, follow the appropriate guide to update the GraphQL engine version you're running: -- :doc:`Updating on Heroku <./heroku/updating>` -- :doc:`Updating on Docker <./docker/updating>` +- :doc:`Updating on Heroku ` +- :doc:`Updating on Docker ` +- :doc:`Updating on Kubernetes ` diff --git a/docs/graphql/manual/schema/using-existing-database.rst b/docs/graphql/manual/schema/using-existing-database.rst index a86b3fe4..ee7a1bf0 100644 --- a/docs/graphql/manual/schema/using-existing-database.rst +++ b/docs/graphql/manual/schema/using-existing-database.rst @@ -1,5 +1,5 @@ -Setting up schema using an existing database -============================================ +Setting up GraphQL schema using an existing database +==================================================== When you have an existing database with a schema already present, you don't need to create tables or views or run DDL queries through the Hasura console. @@ -27,7 +27,8 @@ To track all tables and views present in the database: 2) Track foreign-keys --------------------- -Tracking a foreign-key means creating a :doc:`relationship ` between the tables involved in the foreign-key. +Tracking a foreign-key means creating a :doc:`relationship ` between the tables involved in the +foreign-key. To track a foreign-key between two tables in the database: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -59,6 +60,6 @@ To track all the foreign-keys of all tables in the database: For example, for the foreign-key ``article::author_id -> author::id``, the relationship names will be ``authorByAuthorId`` for ``article`` table and ``articlesByAuthorId`` for ``author`` table. - You can change the relationship names by heading to the ``Relationships`` tab of the concerned table/view and + You can change the relationship names by heading to the ``Relationships`` tab of the concerned table and dropping and recreating the relationship with a name of your choice.