我想application_name-result
根据这些数据生成一个包含唯一值的 grafana 变量:
{app="abc-api", application_name="abc-processor", application_type="processor", stream_name="test-stream", result="success"}
{app="abc-api", application_name="abc-processor", application_type="processor", stream_name="test-stream", result="failure"}
{app="abc-api", application_name="abc-processor", application_type="processor", stream_name="test-stream", result="duplicate"}
{app="xyz-api", application_name="xyz-processor", application_type="processor", stream_name="test-stream", result="duplicate"}
{app="xyz-api", application_name="xyz-processor", application_type="processor", stream_name="test-stream", result="success"}
{app="xyz-api", application_name="xyz-processor", application_type="processor", stream_name="test-stream", result="failure"}
我可以单独创建它们,但无法将它们组合在一起,例如:
stream_name :: label_values(stream_name)
application_name :: label_values({stream_name="$stream_name"},application_name)
results :: label_values(document_index_total{stream_name="$stream_name",application_name=~"$application_name"},result)
请指导我的步骤。
我希望变量输出为:
abc-processor-success
abc-processor-failure
abc-processor-duplicate
xyz-processor-success
xyz-processor-failure
xyz-processor-duplicate