You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2021/03/23 14:13:40 UTC

[GitHub] [skywalking] hanahmily opened a new issue #6606: [SWCK] Special characters in service selector

hanahmily opened a new issue #6606:
URL: https://github.com/apache/skywalking/issues/6606


   Please answer these questions before submitting your issue.
   
   - Why do you submit this issue?
   - [ ] Question or discussion
   - [ ] Bug
   - [x] Requirement
   - [ ] Feature or performance improvement
   
   ### Requirement or improvement
   If the following piece is appended to HPA metrics:
   
   ```yaml
     - type: External
       external:
         metric:
           name: service_cpm
           selector:
             matchLabels:
               service: "v1|productpage|bookinfo|demo|-"
         target:
           type: Value
           value: 80
   ```
   
   An error will be thrown:
   
   ```
    HPA was unable to compute the replica count: invalid label value: \"v1|productpage|bookinfo|demo\":
         a valid label must be an empty string or consist of alphanumeric characters,
         ''-'', ''_'' or ''.'', and must start and end with an alphanumeric character
         (e.g. ''MyValue'',  or ''my_value'',  or ''12345'', regex used for validation
         is ''(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?'')"}]'
   ```
   
   The reason as above error messages indicated is that k8s label key and value doesn't contain special characters except for ".",  "-" and "_", and those valid special characters must NOT be at head and tail position. 
   
   A possible solution is to leverage a composited `name` field
   
   *metric_namespace*|*metric_name*|*entity_name*
   
   >metric_namespace could be the domain name of skywalking, for example, skywalking.apache.org, which could help distinguish two same metrics from different metric servers. 
   
   Based on this new rule, the above HPA piece could be rewritten to 
   
   ```yaml
     - type: External
       external:
         metric:
           name: skywalking.apache.org|service_cpm|v1|productpage|bookinfo|demo|-
         target:
           type: Value
           value: 80
   ```
   
   @wu-sheng @kezhenxu94 @arugal any thoughts?


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] wu-sheng commented on issue #6606: [SWCK] Special characters in service selector

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #6606:
URL: https://github.com/apache/skywalking/issues/6606#issuecomment-804966544


   Recommend to keep label system, due to avoid complex metric name register.
   We could use multiple service labels to assemble the final string.
   ```
     - type: External
       external:
         metric:
           name: service_cpm
           selector:
             matchLabels:
               service_literal_0: "v1"
               service_var_1: "SW_V_VERTIAL_BAR"
               service_literal_2: "productpage"
               service_var_3: "SW_V_VERTIAL_BAR"
               service_literal_4: "bookinfo"
         target:
           type: Value
           value: 80
   ```


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] wu-sheng closed issue #6606: [SWCK] Special characters in service selector

Posted by GitBox <gi...@apache.org>.
wu-sheng closed issue #6606:
URL: https://github.com/apache/skywalking/issues/6606


   


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org