Hi @mkf1,
Thanks for reaching out!
We don't have an endpoint to remove all sourcemaps at once.
You will need to do it programmatically. For example (node.js script):
const fs = require('fs')
const { request } = require('undici')
const auth = "ApiKey YOUR_API_KEY_HERE"
function getAllSourceMaps() {
return request('http://localhost:5601/api/apm/sourcemaps', {
headers: {
"kbn-xsrf": true,
Authorization: auth
}
})
.then(( { body }) => body.json())
}
async function removeAllSourceMaps() {
const { artifacts: sourceMaps } = await getAllSourceMaps()
for (const sourceMap of sourceMaps) {
await request(`http://localhost:5601/api/apm/sourcemaps/${sourceMap.id}`, {
method: 'DELETE',
headers: {
Authorization: auth,
"kbn-xsrf": true,
"content-type": "application/json"
}
})
}
}
removeAllSourceMaps()
.then(() => {
console.log("All sourcemaps have been removed")
})
.catch((err) => {
console.log("Something went wrong while removing sourcemaps", err)
})
Make sure you use your own API Key and that the endpoint points to your Kibana.
Let me know if this helps you.
Thanks,
Alberto