Watchdog Extension: Profile Action (#12636)

Added a watchdog extension that triggers profiling.

Risk Level: Medium (new extension that is optional)
Testing: Unit tests
Docs Changes: Included (added a reference to the generated extension proto.rst)
Release Notes: Included

Fixes #11388

Signed-off-by: Kevin Baichoo <kbaichoo@google.com>

Mirrored from https://github.com/envoyproxy/envoy @ c88515fc0c8a291992732947671190b37949bbbd
master-ci-test
data-plane-api(CircleCI) 5 years ago
parent 380ac8143d
commit 35396f5670
  1. 1
      BUILD
  2. 9
      envoy/extensions/watchdog/profile_action/v3alpha/BUILD
  3. 35
      envoy/extensions/watchdog/profile_action/v3alpha/profile_action.proto
  4. 1
      versioning/BUILD

@ -245,6 +245,7 @@ proto_library(
"//envoy/extensions/upstreams/http/http/v3:pkg",
"//envoy/extensions/upstreams/http/tcp/v3:pkg",
"//envoy/extensions/wasm/v3:pkg",
"//envoy/extensions/watchdog/profile_action/v3alpha:pkg",
"//envoy/service/accesslog/v3:pkg",
"//envoy/service/auth/v3:pkg",
"//envoy/service/cluster/v3:pkg",

@ -0,0 +1,9 @@
# DO NOT EDIT. This file is generated by tools/proto_format/proto_sync.py.
load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package")
licenses(["notice"]) # Apache 2
api_proto_package(
deps = ["@com_github_cncf_udpa//udpa/annotations:pkg"],
)

@ -0,0 +1,35 @@
syntax = "proto3";
package envoy.extensions.watchdog.profile_action.v3alpha;
import "google/protobuf/duration.proto";
import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";
import "validate/validate.proto";
option java_package = "io.envoyproxy.envoy.extensions.watchdog.profile_action.v3alpha";
option java_outer_classname = "ProfileActionProto";
option java_multiple_files = true;
option (udpa.annotations.file_status).work_in_progress = true;
option (udpa.annotations.file_status).package_version_status = ACTIVE;
// [#protodoc-title: Watchdog Action that does CPU profiling.]
// [#extension: envoy.watchdog.profile_action]
// Configuration for the profile watchdog action.
message ProfileActionConfig {
// How long the profile should last. If not set defaults to 5 seconds.
google.protobuf.Duration profile_duration = 1;
// File path to the directory to output profiles.
string profile_path = 2 [(validate.rules).string = {min_bytes: 1}];
// Limits the max number of profiles that can be generated by a thread over
// its lifetime to avoid filling the disk. We keep a map of <tid, count>
// to track the number of profiles triggered by a particular thread. Only one
// thread is counted as triggering the profile even though multiple threads
// might have been eligible for triggering the profile.
// If not set (i.e. it's 0), a default of 10 will be used.
uint64 max_profiles_per_thread = 3;
}

@ -128,6 +128,7 @@ proto_library(
"//envoy/extensions/upstreams/http/http/v3:pkg",
"//envoy/extensions/upstreams/http/tcp/v3:pkg",
"//envoy/extensions/wasm/v3:pkg",
"//envoy/extensions/watchdog/profile_action/v3alpha:pkg",
"//envoy/service/accesslog/v3:pkg",
"//envoy/service/auth/v3:pkg",
"//envoy/service/cluster/v3:pkg",

Loading…
Cancel
Save