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
stackdriver_service.py 文件源码
python
阅读 24
收藏 0
点赞 0
评论 0
评论列表
文章目录