-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Support Gauge in Stats AccessLogger #42226
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
Changes from all commits
764fcec
22340f5
7f3dd5a
46a9b7f
182adc7
70c18fb
c1632b0
c31a03f
f502e52
057bf57
4ba6ff1
3afc01a
b23cea5
a17f93d
5deec54
fcb774a
9ee0ade
ff83b12
8c210ed
73e3c65
d0588fd
d723049
2dcffdd
32dbcb9
927b370
5356bc9
2cc08fd
3ca0c0b
5f320de
c0c7ce0
0653ed1
96a843f
5fa6feb
545eb96
88798fc
51765d0
b840b61
1bcc420
f889b99
88a7488
377ef60
a44fad5
059f6a8
e6f7da0
8e41295
548f3b5
9d1d7d3
98dffb5
6d98895
07988d0
54c9ff5
1851f13
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,8 @@ syntax = "proto3"; | |
|
|
||
| package envoy.extensions.access_loggers.stats.v3; | ||
|
|
||
| import "envoy/data/accesslog/v3/accesslog.proto"; | ||
|
|
||
| import "google/protobuf/wrappers.proto"; | ||
|
|
||
| import "xds/annotations/v3/status.proto"; | ||
|
|
@@ -27,6 +29,7 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE; | |
| // leading to a denial of service in Envoy, or can overwhelm any configured | ||
| // stat sinks by sending too many unique metrics. | ||
|
|
||
| // [#next-free-field: 6] | ||
| message Config { | ||
| option (xds.annotations.v3.message_status).work_in_progress = true; | ||
|
|
||
|
|
@@ -91,6 +94,58 @@ message Config { | |
| google.protobuf.UInt64Value value_fixed = 3 [(validate.rules).uint64 = {gt: 0}]; | ||
| } | ||
|
|
||
| // Configuration for a gauge stat. Gauges can be used to add, subtract, or set | ||
| // values, and are useful for tracking concurrency or other mutable values | ||
| // over time. | ||
| // [#next-free-field: 6] | ||
| message Gauge { | ||
| // The Set operation config. | ||
| message Set { | ||
| // The access log type to trigger the operation. | ||
| data.accesslog.v3.AccessLogType log_type = 1 [(validate.rules).enum = {defined_only: true}]; | ||
| } | ||
|
|
||
| // The PairedAddSubtract operation config. | ||
| // Usage restrictions: | ||
| // | ||
| // 1. We only support add first then subtract logic and we rely on the symmetrical log types | ||
| // (e.g., DownstreamStart/DownstreamEnd) to increment and decrement the gauge. | ||
| // 2. During runtime, sub_log_type will execute if and only if add_log_type operation has | ||
| // been done, tracked by inflight counter in filter state. | ||
| // 3. If the add_log_type operation was executed, the sub_log_type will happen when the | ||
| // stream/connection is closed, even if the configured log type didn't happen. | ||
| 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}]; | ||
|
Comment on lines
+117
to
+124
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is that possible in the future that multiple log type will map to single operation?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it is feasible. For Gauge PairedAddSubtract, you can still defined multiple gauges with the same config except log type pairs. |
||
| } | ||
|
|
||
| // The name and tags of this gauge. | ||
| Stat stat = 1 [(validate.rules).message = {required: true}]; | ||
|
|
||
| // The format string for the value of this gauge, using :ref:`command | ||
| // operators <config_access_log_command_operators>`. This must evaluate to a | ||
| // positive number. | ||
| string value_format = 2 | ||
| [(validate.rules).string = {prefix: "%" suffix: "%" ignore_empty: true}]; | ||
|
|
||
| // A fixed value to add/subtract/set to this gauge. | ||
| // One of ``value_format`` or ``value_fixed`` must be configured. | ||
| google.protobuf.UInt64Value value_fixed = 3 [(validate.rules).uint64 = {gt: 0}]; | ||
|
|
||
| // The PairedAddSubtract operation. | ||
| // Only one of PairedAddSubtract and Set can be defined. | ||
| PairedAddSubtract add_subtract = 4; | ||
|
|
||
| // The Set operation. | ||
| // Only one of PairedAddSubtract and Set can be defined. | ||
| Set set = 5; | ||
| } | ||
|
|
||
| // The stat prefix for the generated stats. | ||
| string stat_prefix = 1 [(validate.rules).string = {min_len: 1}]; | ||
|
|
||
|
|
@@ -99,4 +154,7 @@ message Config { | |
|
|
||
| // The counters this logger will emit. | ||
| repeated Counter counters = 4; | ||
|
|
||
| // The gauges this logger will emit. | ||
| repeated Gauge gauges = 5; | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.