shotover/shotover-proxy

Allow disabling metrics reporting

Closed this issue · 0 comments

The main benefit is allowing us to determine the performance cost of collecting metrics is costing us.
Not to evaluate removing it, but to see if optimizing it could be useful.
But it also makes sense to allow disabling for potential users who dont make use of metrics.

Shotover has two config files:

  • topology.yaml - the main config file, determines where to listen, where to connect and what rewriting our routing of messages needs to occur in between.
  • config.yaml - a secondary config file, defines side concerns such as metrics and logging.

The default config.yaml is quite simple and only has two fields:

main_log_level: "info, shotover=info, shotover::connection_span=info"
observability_interface: "0.0.0.0:9001"

This issue proposes that we make the observability_interface field optional.
When its not provided, the observability interface aka metrics is disabled.
To ensure that users get observability enabled by default, the example config.yaml shipped with shotover will retain the field.

To make the field optional the type of the config field should be changed from String to Option<String>.
The function that enables metrics is start_observability_interface.

Testing

An integration test should be added to observability_int_tests.rs to test that shotover still works when metrics is disabled.
Use passthrough_standard from redis_int_tests as a base.
But instead of running the whole test suite, just check that a single message can pass through as a smoke test.
This smoke test will be similar to redis::cmds in test_metrics but we should assert that they succeed instead of fail since we will have an actual redis instance running and we only need to send one message.