admin: add /stats filtering capability#4371
Conversation
Signed-off-by: James Buckland <jbuckland@google.com>
Signed-off-by: James Buckland <jbuckland@google.com>
Signed-off-by: James Buckland <jbuckland@google.com>
|
While we're adding this, should we just make it a regex so it covers more use cases and we don't need to support multiple options later? |
|
@ggreenway I'm not opposed to this at all -- but I welcome recommendations on how to a) do this "efficiently", and b) how to encode the usual complexity of a regex in a URL. Is this done elsewhere in Envoy? |
|
a) I'm assuming that really simple regex will be fast enough, but that may be incorrect But if the performance is too poor, even for a simple regex like "cluster", we can leave this as-is, and add another query-param for filtertype=regex later, or something. |
Signed-off-by: James Buckland <jbuckland@google.com>
|
@ggreenway You were right, this is pretty easy to implement. Changes performed in 280029d. |
Signed-off-by: James Buckland <jbuckland@google.com>
Signed-off-by: James Buckland <jbuckland@google.com>
Signed-off-by: James Buckland <jbuckland@google.com>
|
@ggreenway, requesting review on this PR (now that I've kicked CircleCI). |
|
Thanks. LGTM other than one minor function name change nit . |
Signed-off-by: James Buckland <jbuckland@google.com>
|
@ramaraochavali I made the change in c020e2a, thanks! |
|
Thanks. LGTM |
Signed-off-by: James Buckland <jbuckland@google.com>
ggreenway
left a comment
There was a problem hiding this comment.
Looks good. Thanks for doing the work to handle regex.
Description: Added
/statsstat name filtering. You can now hit the endpoint/stats?filter=fooand get just counters/gauges/histograms which have "foo" in their names. Compatible with json and used-only modes. Comes from an idea discussed in #4361. This doesn't support regex, just relies onabsl::StrContains()under the hood.Risk Level: Low.
Testing: Added two tests to
admin_test.cc. Now tests the full space of filtering by used-only and/or filtering by string.Docs Changes: I edited
admin.rstto reflect this.Release Notes: N/A