Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions source/common/config/well_known_names.cc
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ TagNameValues::TagNameValues() {

// mongo.(<stat_prefix>.)*
addRegex(MONGO_PREFIX, "^mongo\\.((.*?)\\.)");

// http.[<stat_prefix>.]rds.(<route_config_name>.)<base_stat>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have any dot path stats under the route config today? Should we allow freedom to do this in the future?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't currently afaict - https://www.envoyproxy.io/docs/envoy/latest/configuration/http_conn_man/rds.html.

FWIW, I basically just copied the regex for HTTP_USER_AGENT just replacing "user_agent" with "rds"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you can file a followup issue related to the . in identifiers and these regexes, LGTM.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filed #6622

addRegex(RDS_ROUTE_CONFIG, "^http(?=\\.).*?\\.rds\\.((.*?)\\.)\\w+?$", ".rds.");
}

void TagNameValues::addRegex(const std::string& name, const std::string& regex,
Expand Down
2 changes: 2 additions & 0 deletions source/common/config/well_known_names.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ class TagNameValues {
const std::string RESPONSE_CODE = "envoy.response_code";
// Request response code class
const std::string RESPONSE_CODE_CLASS = "envoy.response_code_class";
// Route config name for RDS updates
const std::string RDS_ROUTE_CONFIG = "envoy.rds_route_config";

// Mapping from the names above to their respective regex strings.
const std::vector<std::pair<std::string, std::string>> name_regex_pairs_;
Expand Down
11 changes: 11 additions & 0 deletions test/common/stats/tag_extractor_impl_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,17 @@ TEST(TagExtractorTest, DefaultTagExtractors) {
regex_tester.testRegex("http.fault_connection_manager.fault.fault_cluster.aborts_injected",
"http.fault.aborts_injected",
{fault_connection_manager, fault_downstream_cluster});

Tag rds_hcm;
rds_hcm.name_ = tag_names.HTTP_CONN_MANAGER_PREFIX;
rds_hcm.value_ = "rds_connection_manager";

Tag rds_route_config;
rds_route_config.name_ = tag_names.RDS_ROUTE_CONFIG;
rds_route_config.value_ = "route_config.123";

regex_tester.testRegex("http.rds_connection_manager.rds.route_config.123.update_success",
"http.rds.update_success", {rds_hcm, rds_route_config});
}

TEST(TagExtractorTest, ExtractRegexPrefix) {
Expand Down