knuu icon indicating copy to clipboard operation
knuu copied to clipboard

Refactor ObsyConfig to Support Composable Structs for Different Stack Types

Open smuu opened this issue 2 years ago • 1 comments

Originally posted by @Bidon15 in https://github.com/celestiaorg/knuu/pull/174#discussion_r1301300961

Description: Refactor the ObsyConfig struct to make it more composable and aligned with the different types of stacks we use for metrics and traces, including otlp, prom, jaeger, pyro, etc.

Current Structure:

type ObsyConfig struct {
    // existing fields
}

Proposed Change: Create distinct structs for each stack type, ensuring a cleaner and more maintainable configuration.

Why This Change: This refactoring will allow us to handle configurations more effectively and adapt to changes in different stacks.

Tasks:

  • [ ] Define new structs for each stack type.
  • [ ] Modify existing references to the ObsyConfig.
  • [ ] Test to ensure compatibility and correctness.

Feel free to adjust it according to the specifics of your project!

smuu avatar Aug 22 '23 12:08 smuu

I suggest to extract the obsy config sidecar into a separate package. Define it as an interface and the have separate implementation per metric type that is needed. This allows us to add any kind of metric collection method in future.

mojtaba-esk avatar Apr 30 '24 11:04 mojtaba-esk