ELK stack version: 8.5.2
Describe the bug
I was testing the RUM agent and I realized that some of the source maps that I uploaded are incorrect. To mitigate this, I wrote a Python script that removes all source maps that belong to my app. However, none of them are actually being removed. Even though I get responses with status code 200.
To Reproduce
Steps to reproduce the behavior:
- Use this script (or test the DELETE endpoint yourself) and set the missing variables (URL, API_KEY, APP_NAME):
import requests
AUTH_HEADER = f"ApiKey {API_KEY}"
def get_source_maps():
return requests.get(f"{URL}/api/apm/sourcemaps", headers={
"kbn-xsrf": "true",
"Authorization": AUTH_HEADER,
}).json()['artifacts']
def remove_source_maps():
for source_map in get_source_maps():
source_map_id = source_map['id']
if APP_NAME not in source_map_id:
continue
r = requests.delete(f"{URL}/api/apm/sourcemaps/${source_map_id}", headers={
"Authorization": AUTH_HEADER,
"kbn-xsrf": "true",
"Content-Type": "application/json"
})
print(r, source_map_id)
remove_source_maps()
- Upload some source maps
- Run it
- Notice that you get responses with status code 200
- Run it again and it will still find the source maps that you tried to remove
Expected behavior
Source maps should actually be deleted.
Actual behavior
Run it again and it says that it worked, but really it did not.