Skip to content

add example implementation of metric sink#81

Draft
alnlarsen wants to merge 1 commit into
mainfrom
add-metric-sink-implementation
Draft

add example implementation of metric sink#81
alnlarsen wants to merge 1 commit into
mainfrom
add-metric-sink-implementation

Conversation

@alnlarsen

Copy link
Copy Markdown
Contributor

This implementation contains two variants of metric sinks:

  1. A MetricSinkSettings system where sinks are configured separately. This should be a simplification for e.g. the Nats sink because we can configure the nats sink in the default session, and just leave it disabled in other sessions. Then there should be no need for the UI to activate it. This also gives sinks the opportunity to provide config options.
  2. A system that automatically instantiates all IMetricSinks at startup. This is maybe a bit simpler (all sinks are always available), but is a lot less flexible.

Todo:

  • Add support for push metrics. Sinks should automatically be subscribed to all configured push metrics

With this implementation, we have both an IMetricListener and an IMetricSink. We need to either consolidate this, or clearly delineate them.

A couple of options:

  • Break the API and simplify it to only use IMetricSink. This makes some sense to me because the previous design was when we intended for plugins to do all the heavy lifting which is now managed by the Metrics plugin
  • Make IMetricSink inherit from IMetricListener. The sink manager will then ensure that sinks are subscribed to configured metrics. This should be simple to support, but the API is getting a bit muddled.

In either case, I think we can improve overall performance of the system quite a bit by making MetricManager consider the Sink Manager as a special metric listener which is subscribed to metrics configured on the bench.

But this raises the question, does anyone need the flexibility the system was originally designed for? Or can we just say that everyone should use the MetricsSettings / Sink system, and completely scrap most of the MetricManager interfaces?

This implementation contains two variants of metric sinks:
1. A MetricSinkSettings system where sinks are configured separately.
This should be a simplification for e.g. the Nats sink because we can
configure the nats sink in the default session, and just leave it
disabled in other sessions. Then there should be no need for the UI to
activate it. This also gives sinks the opportunity to provide config
options.
2. A system that automatically instantiates all IMetricSinks at startup.
This is maybe a bit simpler (all sinks are always available), but is a
lot less flexible.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant