Update README.

This commit is contained in:
2023-10-09 17:46:50 +01:00
parent 16f29488c5
commit b89053c015
4 changed files with 12 additions and 5 deletions
+4 -2
View File
@@ -4,9 +4,11 @@ on:
workflow_dispatch: workflow_dispatch:
push: push:
paths-ignore: paths-ignore:
- '**.md' - '**/**.md'
- '**/**.yaml'
- 'static/**'
branches: branches:
- "*" - 'main'
jobs: jobs:
shared: shared:
+6 -1
View File
@@ -33,11 +33,16 @@ I wanted to monitor the queries and responses of our graphql endpoint, but we di
* `PORT_GRAPHQL` - the port to expose the graphql endpoint on (default: 8080) * `PORT_GRAPHQL` - the port to expose the graphql endpoint on (default: 8080)
* `HOST_GRAPHQL` - the host to proxy the graphql endpoint to (default: `http://localhost/v1/graphql`) * `HOST_GRAPHQL` - the host to proxy the graphql endpoint to (default: `http://localhost/v1/graphql`)
* `JWT_USER_CLAIM_PATH` - the path to the user claim in the JWT token (default: ``) * `JWT_USER_CLAIM_PATH` - the path to the user claim in the JWT token (default: ``)
* `ENABLE_CACHE` - enable the cache (default: `false`) * `ENABLE_GLOBAL_CACHE` - enable the cache (default: `false`)
* `CACHE_TTL` - the cache TTL (default: `60s`) * `CACHE_TTL` - the cache TTL (default: `60s`)
* `LOG_LEVEL` - the log level (default: `info`) * `LOG_LEVEL` - the log level (default: `info`)
* `BLOCK_SCHEMA_INTROSPECTION` - blocks the schema introspection (default: `false`) * `BLOCK_SCHEMA_INTROSPECTION` - blocks the schema introspection (default: `false`)
### Caching
Cache engine is enabled in background as it does not use any additional resources.
You can then start using the cache by setting the `ENABLE_GLOBAL_CACHE` environment variable to `true` - which will enable the cache for all queries, without introspection of the query. You can leave the global cache disabled and enable the cache for specific queries by adding the `@cache` directive to the query.
### Monitoring endpoint ### Monitoring endpoint
Example metrics produced by the proxy: Example metrics produced by the proxy:
+1 -1
View File
@@ -22,7 +22,7 @@ func parseConfig() {
c.Server.PortMonitoring = envutil.GetInt("MONITORING_PORT", 9393) c.Server.PortMonitoring = envutil.GetInt("MONITORING_PORT", 9393)
c.Server.HostGraphQL = envutil.Getenv("HOST_GRAPHQL", "http://localhost/v1/graphql") c.Server.HostGraphQL = envutil.Getenv("HOST_GRAPHQL", "http://localhost/v1/graphql")
c.Client.JWTUserClaimPath = envutil.Getenv("JWT_USER_CLAIM_PATH", "") c.Client.JWTUserClaimPath = envutil.Getenv("JWT_USER_CLAIM_PATH", "")
c.Cache.CacheEnable = envutil.GetBool("CACHE_ENABLE", false) c.Cache.CacheEnable = envutil.GetBool("ENABLE_GLOBAL_CACHE", false)
c.Cache.CacheTTL = envutil.GetInt("CACHE_TTL", 60) c.Cache.CacheTTL = envutil.GetInt("CACHE_TTL", 60)
c.Security.BlockIntrospection = envutil.GetBool("BLOCK_SCHEMA_INTROSPECTION", false) c.Security.BlockIntrospection = envutil.GetBool("BLOCK_SCHEMA_INTROSPECTION", false)
c.Logger = libpack_logging.NewLogger() c.Logger = libpack_logging.NewLogger()
+1 -1
View File
@@ -59,7 +59,7 @@ spec:
value: "9393" value: "9393"
- name: HOST_GRAPHQL - name: HOST_GRAPHQL
value: http://hasura-internal:8080/v1/graphql value: http://hasura-internal:8080/v1/graphql
- name: ENABLE_CACHE - name: ENABLE_GLOBAL_CACHE
value: "true" value: "true"
- name: CACHE_TTL - name: CACHE_TTL
value: "10" value: "10"