Support Gauge in Stats AccessLogger#42226
Conversation
|
CC @envoyproxy/api-shepherds: Your approval is needed for changes made to |
Signed-off-by: Xuyang Tao <taoxuy@google.com>
Signed-off-by: Xuyang Tao <taoxuy@google.com>
Signed-off-by: Xuyang Tao <taoxuy@google.com>
|
All comments are resolved. PTAL |
Change-Id: Ib8485b0d970f05dc9e4f93b01f8dfd81c54662dd Commit Message: Add ability to log connection starts in TCP proxy. This coupled with envoyproxy#42226 should provide "almost" exact active connection gauge. (The problematic edge case is when a prior filter stops iteration in `onNewConnection` or a disconnect happens prior to reaching `tcp_proxy` - that requires unusual config). Risk Level: low Testing: added Docs Changes: yes Release Notes: yes --------- Signed-off-by: Kuat Yessenov <kuat@google.com>
|
All comments are resolved. PTAL |
| Stats::Gauge::ImportMode) -> Stats::Gauge& { | ||
| EXPECT_TRUE(tags.has_value()); | ||
| if (tags) { | ||
| EXPECT_EQ(tags->get().size(), saved_tags.size()); |
There was a problem hiding this comment.
Please check that both the name, and the values of the tags, are identical. They need to be in the same order. If any of the parameters are different, you'll get a different stat, and that means this code didn't work.
|
|
||
| private: | ||
| absl::flat_hash_set<Stats::Gauge*> inflight_gauges_; | ||
| absl::flat_hash_map<Stats::Gauge*, uint64_t> inflight_gauges_; |
There was a problem hiding this comment.
Though refcount can help with gauge liveness, we don't want eviction as we want the previous value be kept.
| // stat sinks by sending too many unique metrics. | ||
|
|
||
| // | ||
| // It is required to use a delta stat sink (e.g. OpenTelemetry) because this |
There was a problem hiding this comment.
Allow ScopeStatsLimitSettings make sense
Let's make the default as: delta counter/histogram and accumulated gauge
And we can extend in the following PR to support : accumulated counter/histogram
I will add TODO and update the comment if that sounds good to u.
| // iv). If the PAIRED_ADD operation was executed, the | ||
| // PAIRED_SUBTRACT will happen when the stream/connection is closed, even | ||
| // if the configured log type didn't happen. | ||
| enum OperationType { |
There was a problem hiding this comment.
I am fine with either. One thing is maybe PAIRED_ADD and PAIRD_SUBTRACT is more open to be evolved to support non-paired one.
@wbpcode WDYT?
| // iv). If the PAIRED_ADD operation was executed, the | ||
| // PAIRED_SUBTRACT will happen when the stream/connection is closed, even | ||
| // if the configured log type didn't happen. | ||
| enum OperationType { |
| void initialize(const envoy::extensions::access_loggers::stats::v3::Config& config) { | ||
| // The gauge is a member of store_, so we need to increment the ref count to prevent it from | ||
| // being deleted when the shared_ptr in AccessLogState is destroyed. | ||
| store_.gauge_.incRefCount(); |
|
@ggreenway all comments are resolved |
|
/retest |
|
@wbpcode can you do a final API signoff? |
| message PairedAddSubtract { | ||
| // The access log type to trigger the add operation. | ||
| data.accesslog.v3.AccessLogType add_log_type = 1 | ||
| [(validate.rules).enum = {defined_only: true}]; | ||
|
|
||
| // The access log type to trigger the subtract operation. | ||
| data.accesslog.v3.AccessLogType sub_log_type = 2 | ||
| [(validate.rules).enum = {defined_only: true}]; |
There was a problem hiding this comment.
is that possible in the future that multiple log type will map to single operation?
There was a problem hiding this comment.
I think it is feasible.
For Gauge PairedAddSubtract, you can still defined multiple gauges with the same config except log type pairs.
Dismiss request change from Matt because the context is out of time.
**Description** This PR adds support for Gauges in the Stats AccessLogger. **Changes** Gauge Operations: Added support for three operations: SET, PAIRED_ADD, and PAIRED_SUBTRACT. Configuration: Updated the [stats.proto](https://www.google.com/search?q=https://github.com/envoyproxy/envoy/pull/42226/files%23diff-4581f1e9c20a6e6259d646736480c54178308378619379854721789781878345) to include the new Gauge configuration options. **Risk Level** Low. The changes are focused on extending the Stats AccessLogger functionality and include specific handling to maintain backward compatibility for existing counter/histogram eviction logic. **Testing** Unit Tests: Added to verify the new gauge operations and eviction logic. Integration Tests: Added to ensure end-to-end functionality within the access logging pipeline. **Documentation & Release Notes** Docs: Updated Protobuf comments to reflect new operations and memory overhead considerations. **Release Notes**: Updated to include this new feature. --------- Signed-off-by: Xuyang Tao <taoxuy@google.com> Signed-off-by: nick <nickshokri@google.com>
**Description** This PR adds support for Gauges in the Stats AccessLogger. **Changes** Gauge Operations: Added support for three operations: SET, PAIRED_ADD, and PAIRED_SUBTRACT. Configuration: Updated the [stats.proto](https://www.google.com/search?q=https://github.com/envoyproxy/envoy/pull/42226/files%23diff-4581f1e9c20a6e6259d646736480c54178308378619379854721789781878345) to include the new Gauge configuration options. **Risk Level** Low. The changes are focused on extending the Stats AccessLogger functionality and include specific handling to maintain backward compatibility for existing counter/histogram eviction logic. **Testing** Unit Tests: Added to verify the new gauge operations and eviction logic. Integration Tests: Added to ensure end-to-end functionality within the access logging pipeline. **Documentation & Release Notes** Docs: Updated Protobuf comments to reflect new operations and memory overhead considerations. **Release Notes**: Updated to include this new feature. --------- Signed-off-by: Xuyang Tao <taoxuy@google.com> Signed-off-by: nick <nickshokri@google.com>
Change-Id: Ib8485b0d970f05dc9e4f93b01f8dfd81c54662dd Commit Message: Add ability to log connection starts in TCP proxy. This coupled with envoyproxy#42226 should provide "almost" exact active connection gauge. (The problematic edge case is when a prior filter stops iteration in `onNewConnection` or a disconnect happens prior to reaching `tcp_proxy` - that requires unusual config). Risk Level: low Testing: added Docs Changes: yes Release Notes: yes --------- Signed-off-by: Kuat Yessenov <kuat@google.com> Signed-off-by: Gustavo <grnmeira@gmail.com>
**Description** This PR adds support for Gauges in the Stats AccessLogger. **Changes** Gauge Operations: Added support for three operations: SET, PAIRED_ADD, and PAIRED_SUBTRACT. Configuration: Updated the [stats.proto](https://www.google.com/search?q=https://github.com/envoyproxy/envoy/pull/42226/files%23diff-4581f1e9c20a6e6259d646736480c54178308378619379854721789781878345) to include the new Gauge configuration options. **Risk Level** Low. The changes are focused on extending the Stats AccessLogger functionality and include specific handling to maintain backward compatibility for existing counter/histogram eviction logic. **Testing** Unit Tests: Added to verify the new gauge operations and eviction logic. Integration Tests: Added to ensure end-to-end functionality within the access logging pipeline. **Documentation & Release Notes** Docs: Updated Protobuf comments to reflect new operations and memory overhead considerations. **Release Notes**: Updated to include this new feature. --------- Signed-off-by: Xuyang Tao <taoxuy@google.com>
**Description** This PR adds support for Gauges in the Stats AccessLogger. **Changes** Gauge Operations: Added support for three operations: SET, PAIRED_ADD, and PAIRED_SUBTRACT. Configuration: Updated the [stats.proto](https://www.google.com/search?q=https://github.com/envoyproxy/envoy/pull/42226/files%23diff-4581f1e9c20a6e6259d646736480c54178308378619379854721789781878345) to include the new Gauge configuration options. **Risk Level** Low. The changes are focused on extending the Stats AccessLogger functionality and include specific handling to maintain backward compatibility for existing counter/histogram eviction logic. **Testing** Unit Tests: Added to verify the new gauge operations and eviction logic. Integration Tests: Added to ensure end-to-end functionality within the access logging pipeline. **Documentation & Release Notes** Docs: Updated Protobuf comments to reflect new operations and memory overhead considerations. **Release Notes**: Updated to include this new feature. --------- Signed-off-by: Xuyang Tao <taoxuy@google.com>
Description
This PR adds support for Gauges in the Stats AccessLogger.
Changes
Gauge Operations: Added support for three operations: SET, PAIRED_ADD, and PAIRED_SUBTRACT.
Configuration: Updated the stats.proto to include the new Gauge configuration options.
Risk Level
Low. The changes are focused on extending the Stats AccessLogger functionality and include specific handling to maintain backward compatibility for existing counter/histogram eviction logic.
Testing
Unit Tests: Added to verify the new gauge operations and eviction logic.
Integration Tests: Added to ensure end-to-end functionality within the access logging pipeline.
Documentation & Release Notes
Docs: Updated Protobuf comments to reflect new operations and memory overhead considerations.
Release Notes: Updated to include this new feature.