假设我有3个应用程序一起工作,并使用pub-sub为“管理”发送消息。假设在开始时创建了一个“事务ID”,并通过应用程序传递,并写入日志中。
我将有如下日志:
app1 - transactionIdX - started - timestamp01
app1 - transactionIdX - ended - timestamp02
app2 - transactionIdX - started - timestamp03
app1 - transactionIdY - started - timestamp04
app1 - transactionIdY - ended - timestamp05
app2 - transactionIdX - ended - timestamp06
app3 - transactionIdX - started - timestamp07
app2 - transactionIdY - started - timestamp08
app2 - transactionIdY - ended - timestamp09
app3 - transactionIdX - ended - timestamp10
app3 - transactionIdY - started - timestamp11
app3 - transactionIdY - ended - timestamp12
我希望有一个公开此类信息的指标:
有没有办法构建提供此类信息的基于日志的指标?
目前,仅使用基于日志的指标API无法做到这一点。基于日志的度量标准管道不会在两个日志条目之间维护状态,因此您无法捕获两个值并制定查询以捕获两者之间的差异。
我看到两种可能的解决方法:
免责声明:我是Google Stackdriver的工程师。