Skip to content
Snippets Groups Projects
Commit c55ef075 authored by Malte Finsterwalder's avatar Malte Finsterwalder
Browse files

log reported errors

parent c5e082a5
No related branches found
No related tags found
No related merge requests found
import { MetricServiceClient } from '@google-cloud/monitoring'
const client = new MetricServiceClient()
const projectId = 'holi-shared'
const metricTypePrefix = 'custom.googleapis.com/performance/graphql'
async function deleteMetricDescriptor(name) {
const request = {
name: client.projectMetricDescriptorPath(projectId, `${metricTypePrefix}/${name}`),
}
// Deletes a metric descriptor
const [result] = await client.deleteMetricDescriptor(request)
console.log(`Deleted ${`${metricTypePrefix}/${name}`}`, result)
}
deleteMetricDescriptor('XYZ')
......@@ -22,6 +22,7 @@ process.argv.slice(2).forEach((arg, index, array) => {
if (result['errors']) {
await createErrorMetric()
await sendMetric(timestamp, 'errors', `${test}`, { int64Value: result['errors'] })
console.info(`reported ${result['errors']} errors for ${test} and time ${timestamp}`)
}
}
})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment