Solved

Data Collector RESTful API - GET operation on Pipeline Metrics

  • 30 November 2021
  • 2 replies
  • 280 views

Userlevel 3
Badge +1

Hi there,

 

I am on Data Collector 3.21.x.

 

I tried issuing a RESTFul API call for one of our pipeline to get the metrics for a pipeline. But I get the following response,

 

My Request URL is,

/rest/v1/pipeline/snowflake432db0d5-22d5-4745-b7da-55bf1db2ee16/metrics?rev=0

 

My model schema is,

{
  "version": "string",
  "gauges": {},
  "counters": {},
  "histograms": {},
  "meters": {},
  "timers": {},
  "slaves": [
    "string"
  ]
}

 

Any suggestions?

icon

Best answer by Ranjith P 30 November 2021, 09:17

View original

2 replies

Userlevel 2
Badge

Hi @Srinivasan Sankar
Did you try the API → /rest/v1/pipeline/{pipelineId}/metrics?rev=0 when the pipeline is in running state?

Instead of above API, please try using → /rest/v1/pipeline/{pipelineId}/status?rev=0 you will get all the required information in metrics attribute.

Userlevel 3
Badge +1

Thanks @Ranjith P 

 

/rest/v1/pipeline/{pipelineId}/status?rev=0   works!

 

To answer to your question,

Did you try the API → /rest/v1/pipeline/{pipelineId}/metrics?rev=0 when the pipeline is in running state? NO - the pipeline was NOT in RUNNING state.

Cheers.

Reply