Repository navigation
Conversation
Adds the nighthawk.envoy_stats_sink_adapter stats sink plugin. It is configured with an Envoy stats sink configuration, creates that sink through Envoy's own factory, and forwards flushes and histogram samples to it, so Envoy's sinks can be used without a Nighthawk implementation of each. Samples of Nighthawk's latency statistics are recorded in nanoseconds with no unit declared. The adapter presents each as a Microseconds histogram named after its worker and converts the sample, so sinks that scale by unit report it correctly. Envoy's sink factories need the sink configuration and a server factory context, so NighthawkStatsSinkFactory gains a createStatsSink() overload that receives both. Its default implementation calls the existing method; existing stats sink plugins and the statistics code are unchanged. Signed-off-by: Bruno Palermo <b@palermo.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds
nighthawk.envoy_stats_sink_adapter, a Nighthawk stats sink plugin that forwards to a stats sink implemented as an Envoy extension, such asenvoy.stat_sinks.statsdorenvoy.stat_sinks.dog_statsd.What is new:
source/stats_sink/) and its config proto (api/stats_sink/), which nests an ordinary EnvoyStatsSinkconfig.createStatsSink(config, context)overload onNighthawkStatsSinkFactory. Envoy's sink factories need the sink configuration and a server factory context, and the existing method receives neither.What stays the same:
statistic_impl.ccandstatistic_test.ccare not touched.process_test, which runs a Nighthawk sink throughProcessImpl, passes unchanged.The adapter forwards flushes unchanged. Nighthawk records latency samples in nanoseconds with no unit declared; the adapter forwards them as microseconds with that unit, named
cluster.<worker>.<statistic>, so sinks that scale by unit report them correctly.This PR is related to #1616 and #1617, which it replaces.
Notes for Reviewers
//test/stats_sink:envoy_stats_sink_adapter_test(unit, with a fake Envoy sink) andtest/integration/test_stats_sinks.py, which runs Envoy's real statsd and DogStatsD sinks through the adapter and checks the datagrams received on a UDP socket.docs/root/statistics.md.