-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stats: add new TextReadout stat type #10639
Conversation
6773a4e
to
9ec2e88
Compare
Based on envoyproxy#5844 by @fredlas. Signed-off-by: Misha Efimov <mef@google.com>
Signed-off-by: Misha Efimov <mef@google.com>
Signed-off-by: Misha Efimov <mef@google.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great; left a few minor comments.
One larger question: what do we want the hot-restart behavior to be? Do we transfer text-readout values from parent to child?
We might need to have an ImportMode like Gauge, because if parent and child have conflicting text-readout values it won't be obvious how to combine them.
More thoughts:
|
Please merge master to pick up #10672. We no longer accept changes to v2 (without explicit exception), so any API modifications should happen in v3. If this PR is adding a new proto, please follow the updated instructions in https://github.com/envoyproxy/envoy/blob/master/api/STYLE.md#adding-an-extension-configuration-to-the-api. |
Signed-off-by: Misha Efimov <mef@google.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jmarantz thanks a lot for your comments!
I don't have a good answer for an excellent question about hot-restart behavior. I guess it would depend on the use case.
I don't think any value preservation is needed for my current use case, which IIUIC also avoids the question about conflicting values.
WDYT?
Signed-off-by: Misha Efimov <mef@google.com>
Simply not importing them during hot restart is fine for now. You could leave a comment staying that if importing text-readout is desired in the future that could be a mode-bit like gauge, and that could be added later. |
Signed-off-by: Misha Efimov <mef@google.com>
FYI, I think "efimki requested review from alyssawilk, htuch, lizan, PiotrSikora and snowp as code owners yesterday" was auto-requested by repokitteh bot that noticed some spurious commits pulled from upstream and unintentionally included into this PR due to my github workflow clumsiness. |
Looks good to me generally, but:
|
Signed-off-by: Misha Efimov <mef@google.com>
@jmarantz - thanks for your review and suggestions. With regards to escaping text readout values is there a common pattern that I could follow? I'm wondering whether it makes sense to replace .value() getter with safeHtmlEscapedValue() and unsafeRawStringValue() getters to make it clear that stored value is not escaped. I think admin /stats will NOT be affected by this PR as they have to explicitly iterate TextReadout stats. I'll be happy to modify admin/stats in this PR, but I'm not sure whether it is the right thing to do. WDYT? |
I'm OK with a follow-up to add visibility to the stats. But would like to definitely have a follow-up, as generally developers in Envoy that see an option for a new stat would expect to be able to get at the value through the UI or their favorite stats monitoring system (e.g. prometheus). Not sure what support those systems would have for a text-readout type. But at the minimum it should be an admin /stats endpoint. It's a fair argument that you don't need to become an expert in every stats sink to add a new stats type, but you should definitely sprinkle some TODOs around for others to note that there is data that is collected and not exposed. I don't think it's necessary for you to handle the HTML escaping or rename the methods in the stats type. HTML is just one of many possible output formats that might need some kind of escaping, another being JSON. You don't need to comment about all possible outputs in the value() method here. |
Signed-off-by: Misha Efimov <mef@google.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Hrm, the circleci failure seems unrelated and in-actionable.
|
The clang-tidy errors are legit. Can you fix them? Coverage is a flake and we can rerun if needed. There are known issues there that are being worked on. /wait |
Signed-off-by: Misha Efimov <mef@google.com>
Signed-off-by: Misha Efimov <mef@google.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Hrm, "macOS was canceled" after 6 hours. |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s), but failed to run 2 pipeline(s). |
/retest |
🐴 hold your horses - no failures detected, yet. |
Please push and empty commit to kick Circle CI, I don't know what is broken there. |
Sigh CircleCI. I dont know what is broken. I will try closing and reopening. If that doesn't work you will probably need to make a fresh PR and we can get this merged. I just want to make sure API/docs/etc. are all passing. |
Looks like MacOS pipeline has timed out after 6 hours, but AFAICT the executed tests have passed: /azp run |
/azp run |
Commenter does not have sufficient privileges for PR 10639 in repo envoyproxy/envoy |
Woo-hoo, thanks Joshua! |
* stats: add new TextReadout stat type Based on envoyproxy#5844 by @fredlas. Signed-off-by: Misha Efimov <mef@google.com> Signed-off-by: pengg <pengg@google.com>
Description: Add the TextReadout stat type, for holding strings.
Currently ignored (not preserved) during hot restart.
If importing text readout is desired in the future that could be a mode-bit like gauge.
Risk Level: low
Testing: roughly duplicated every bit of test logic involving the word "gauge".
Fixes #5790 @fredlas @jmarantz