hasura / hasura/graphql-engine

Support: configuration to control frequency of logs generated by engine

Open
#9,833 0 comments 0 reactions 0 assignees View on GitHub
k/enhancement t/product-platform
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

### Is your proposal related to a problem?

The frequency of logs can become a problem in terms of cost implication. After all, the cloud providers bill for the logs, which are generated by Hasura's graphql-engine.

We got some tickets due to which I am raising this GH issue as a feature request.
Zendesk ticket - [8376](https://hasurahelp.zendesk.com/agent/tickets/8376)
GH Discussion - [9129](https://github.com/hasura/graphql-engine/discussions/9129)

### Describe the solution you'd like

Configuration for setting interval/frequency of logs. As there are different [log-types](https://hasura.io/docs/latest/deployment/logging/#log-types), this can be tricky to manage for all the logs. A naive solution would be to control frequency of all the logs irrespective of its type by introducing interval like setting through env var.

### Describe alternatives you've considered

There's no alternative as the only way you can control logs is by disabling them in different ways such as

#### By setting log-level
Setting `log-level` accordingly such that it only emits logs of specific levels. You can set level via `HASURA_GRAPHQL_LOG_LEVEL` env var ([Doc ref](https://hasura.io/docs/latest/deployment/logging/#logging-levels)).

Example of a log structure
```json
{
"timestamp": "2019-05-30T23:40:24.654+0530",
"level": "info",
"type": "http-log",
}
```

But there are drawbacks, such as you miss out on other logs for specific log level if you are targeting to disable just one log type by changing log level as a whole.

#### Enable/disable log type
Enabling/disabling the [log type](https://hasura.io/docs/latest/deployment/logging/#configurable-log-types) by setting `HASURA_GRAPHQL_ENABLED_LOG_TYPES` env var.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.