Skip to content

v0.3.0

Choose a tag to compare

@mostafa mostafa released this 20 Jan 00:25
· 1437 commits to main since this release
69b995b

This release contains a very useful feature: exposing metrics from GatewayD and collecting, merging, relabeling and exposing metrics from plugins along with it. The plugins can expose their metrics on HTTP via a Unix domain socket, like /tmp/gatewayd-plugin-test.sock. Upon start GatewayD loads the plugins and registers their UDS path by retrieving their compile-time configuration, which happens on plugin registration by calling the plugin's GetPluginConfig method. Later in the initialization process, an async scheduler runs to periodically scrap metrics from plugins that expose metrics.
Upon each round of scraping metrics, GatewayD will merge and relabel the plugins' metrics with the name of the plugin. That is, gatewayd_test_metric_total becomes gatewayd_test_metric_total{plugin="test"}. Also, for the ease of access and the uniformity of metrics, the namespace must be set to "gatewayd". This is not a requirement, and it isn't enforced anywhere, but if not set, it makes metrics hard to find on Prometheus UI and other visualization platforms, especially if they have non-uniform names.
The scheduler runs periodically and the interval between each runs can be set using the metricsMergerPeriod parameter in the plugins' configuration file, gatewayd_plugins.yaml. It is set to 5s by default, but can be adjusted based on demand. Don't try to set it to a very low value unless you absolutely have to. Note that the scheduler runs in singleton mode, and prevents new jobs to be run, if the previous hasn't finished processing, which might be caused by setting the parameter very low.

What's Changed

Full Changelog: v0.2.5...v0.3.0