Hello All, 

I am new to prometheus space, and am currently using it do some poc's and 
understand its concepts. I have a use case where from the source 
application I am receiving metrics in the json string format and the source 
is a third party library. 

Below is the sample metric output from source: - 

{
    "status": "success",
    "data": {
        "resultType": "vector",
        "result": [
            {
                "metric": {
                    "__name__": "workflow_executions",
                    "instance": "localhost:9920",
                    "job": "exporter-application",
                    "result": "[{'_index': 'abc', '_type': 'workflow', 
'_id': '4b01fe28-3c80-4595-a1be-3861b037f9ba', '_score': 1.0, '_source': 
{'type': '512156fd-e18f-4563-981b-2a1e1d24ecdf', 'version': 2, 'startTime': 
'2020-10-01T12:20:03.629Z', 'status': 'COMPLETED', 'input': 
'{executionId=c134e4e0-62e2-4190-9d9e-755fef48faed, 
orgId=7e04226a-1a82-4844-ba36-357a35f6677e}', 'output': 
'{result={\"version\":1,\"priority\":0,\"status\":\"COMPLETED\"}}', 
'executionTime': 4284, 'failedReferenceTaskNames': '', 'priority': 0, 
'inputSize': 1115, 'outputSize': 6944, 'updateTime': 
'2020-10-01T12:20:07.913Z', 'endTime': '2020-10-01T12:20:07.913Z'}}, 
{'_index': 'abc', '_type': 'workflow', '_id': 
'28ddb129-97ea-49c3-a074-a61a739905a7', '_score': 1.0, '_source': {'type': 
'a6212938-7de8-42e9-a9c5-8b5b97b4a284', 'version': 1, 'workflowId': 
'28ddb129-97ea-49c3-a074-a61a739905a7', 'startTime': 
'2020-09-24T21:20:17.362Z', 'status': 'COMPLETED', 'input': 
'{executionId=2e81bdcb-d369-4892-84fc-4a5d33a8fb0b, 
orgId=7e04226a-1a82-4844-ba36-357a35f6677e}', 'output': '{result=success}', 
'executionTime': 3021, 'failedReferenceTaskNames': '', 'priority': 0, 
'outputSize': 16, 'inputSize': 1115, 'updateTime': 
'2020-09-24T21:20:20.383Z', 'endTime': '2020-09-24T21:20:20.383Z'}}, 
{'_index': 'xyz', '_type': 'workflow', '_id': 
'4e6c257e-04a7-4377-a072-1b8df9658f2f', '_score': 1.0, '_source': {'type': 
'4b10a1d4-47b8-419e-842c-694fbe3a9985', 'version': 1, 'workflowId': 
'4e6c257e-04a7-4377-a072-1b8df9658f2f', 'startTime': 
'2020-09-30T20:51:10.590Z', 'status': 'COMPLETED', 'input': 
'{executionId=a22c16ef-b1b2-4049-a095-5cc088275625,orgId=7e04226a-1a82-4844-ba36-357a35f6677e}',
 
'output': '{result=success}', 'executionTime': 3601, 
'failedReferenceTaskNames': '', 'priority': 0, 'inputSize': 1115, 
'outputSize': 16, 'updateTime': '2020-09-30T20:51:14.191Z', 'endTime': 
'2020-09-30T20:51:14.191Z'}}]"
                },
                "value": [
                    1602027104.962,
                    "1"
                ]
            }
        ]
    }
}

Here, I would like to read and count number of workflows with "status: 
COMPLETED" ? 

I have tried few things using promQL but no luck. e.g. 
workflow_executions{result=~"'status': 'COMPLETED'"} 
workflow_executions{result=~"result=success"}

I am using grafana for visualization, and tried above queries but didn't 
work. 

Can anyone advise or guide me where i am going wrong?     

Thanks in advance, Ketan!

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/5a964c20-86b7-4999-b0aa-85bb8fc06a6fn%40googlegroups.com.

Reply via email to