stackdriver_service.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:spinnaker-monitoring 作者: spinnaker 项目源码 文件源码
def find_problematic_elements(self, error, batch):
    try:
      content = json.JSONDecoder().decode(error.content)
      message = content['error']['message']
    except KeyError:
      return []

    pattern = (r'timeSeries\[(\d+?)\]\.metric\.labels\[\d+?\]'
               r' had an invalid value of "(\w+?)"')
    found = []
    for match in re.finditer(pattern, message):
      ts_index = int(match.group(1))
      label = match.group(2)
      metric = batch[ts_index]['metric']
      metric_type = metric['type']
      found.append((self.add_label_and_retry,
                    label, metric_type, batch[ts_index]))
    return found
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号