acelyc111 opened a new issue, #1965:
URL: https://github.com/apache/incubator-pegasus/issues/1965

   Meta server crashed if creating a backup policy with a name contains `-` 
character, the assert information is as below:
   ```
   meta_server: 
/data/jenkins/workspace/skv/prebuild_binary-multi-arch/sub-jobs/build-develop-x86_64/thirdparty/build/Source/prometheus-cpp/core/include/prometheus/family.h:142:
 prometheus::Family<T>::Family(const string&, const string&, const 
std::map<std::basic_string<char>, std::basic_string<char> >&) [with T = 
prometheus::Gauge; std::string = std::basic_string<char>]: Assertion 
`CheckMetricName(name_)' failed.
   ```
   
   The prometheus-cpp code:
   ```
   bool CheckMetricName(const std::string& name) {
     // see https://prometheus.io/docs/concepts/data_model/
     auto reserved_for_internal_purposes = name.compare(0, 2, "__") == 0;
     if (reserved_for_internal_purposes) return false;
   #ifdef STD_REGEX_IS_BROKEN
     return !name.empty();
   #else
     static const std::regex metric_name_regex("[a-zA-Z_:][a-zA-Z0-9_:]*");
     return std::regex_match(name, metric_name_regex);
   #endif
   }
   
   bool CheckLabelName(const std::string& name) {
     // see https://prometheus.io/docs/concepts/data_model/
     auto reserved_for_internal_purposes = name.compare(0, 2, "__") == 0;
     if (reserved_for_internal_purposes) return false;
   #ifdef STD_REGEX_IS_BROKEN
     return !name.empty();
   #else
     static const std::regex label_name_regex("[a-zA-Z_][a-zA-Z0-9_]*");
     return std::regex_match(name, label_name_regex);
   #endif
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to