我有一个带有 10 个端点(合同)的 API。我正在将日志发送到 IIS 以从 API 发送到数据狗。我还在服务器上安装了数据狗代理。
现在我正在尝试为每秒所有端点命中创建图表。只有一个图表,所有端点 TPS 都将显示在图表上。我怎样才能做到这一点?有什么建议么?
我试图创建不同的矩阵但无法实现这一点。
我读过需要创建解析器文件。
import time
from datetime import datetime
...
def my_log_parser(logger, test):
metric_name, date, metric_value, extras = line.split('|')
# Convert the iso8601 date into a unix timestamp, assuming the timestamp
# string is in the same timezone as the machine that's parsing it.
date = datetime.strptime(date, "%Y-%m-%d %H:%M:%S.%f")
tags = extras.split(',')
date = time.mktime(date.timetuple())
metric_attributes = {
'tags': tags,
'metric_type': 'gauge',
}
return (metric_name, date, metric_value, metric_attributes)