Create Custom Metric
POST
/alerts/v1/metric/alias/create
const url = 'http://localhost:3000/alerts/v1/metric/alias/create';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"alias":"Druid","component":"MyTest","metric":"sum(druid_supervisors{state=\'SUSPENDED\'})"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:3000/alerts/v1/metric/alias/create \ --header 'Content-Type: application/json' \ --data '{ "alias": "Druid", "component": "MyTest", "metric": "sum(druid_supervisors{state='\''SUSPENDED'\''})" }'Request Body
Section titled “Request Body ” Media type application/json
object
Example
{ "alias": "Druid", "component": "MyTest", "metric": "sum(druid_supervisors{state='SUSPENDED'})"}Responses
Section titled “ Responses ”Successful response
Media type application/json