Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(dataplanes): ignore inbound/listener with a
_
prefixed clustern…
…ame (#2420) TLDR; This PR also applies a `_` exclusion to inbounds aswell as outbounds --- We have an ignore/exclude list for cluster names that ignores internal cluster names, and we've recently started prefixing all internal cluster names with `_` and we ignore all `_` prefixed cluster names so moving forwards we can remove the exclude list. https://github.com/kumahq/kuma-gui/blob/e4d3170edd2e84ea7d6b8260bc721eecd4ab59b5/src/app/connections/sources.ts#L37-L47 Thing is, we only apply this exclude list to outbounds 🙄 😅 For reasons this wasn't as straightforward as just applying the same exclusion list. --- For listeners we use the `ip.add.re.ss_port` as a key which we take from `listener.<ip.add.re.ss_port>`. Sometimes these can have a protocol on them followed by the clustername, followed by the blob of stats: `listener.<ip.add.re.ss_port>.http.cluster-name.all-the-stats...` Previous to this PR we removed/threw away the cluster name from these lines leaving: `listener.<ip.add.re.ss_port>.http.all-the-stats...` ...because we didn't need that information and it gave us a consistent shape for the data for both inbounds and outbounds: ```javascript // `listener.` (inbounds) keyed by ip_port { '10.0.0.1_8080': { tcp: {...stats}, http: {..stats} } } // `cluster.` (used for both inbounds and outbounds) keyed by clustername { 'clusterName': { tcp: {...stats}, http: {..stats} } } ``` Because we throw away the cluster name for listeners we can't then filter for listener with a cluster name beginning with `_` from within `sources.ts` So I could either: 1. Filter out the `_` prefixed things before we throw away the cluster name (in `data.ts`) 2. Somehow keep the cluster name and then filter for `_` in the same place that we do the same filter in for outbounds (in sources.ts) Option 2 felt far better, so I added a reasonably safely named property called `$clusterName` to the stats, which is the available to filter by from within `sources.ts` Closes #2416 Signed-off-by: John Cowen <john.cowen@konghq.com>
- Loading branch information