Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a command to delete data #104

Open
IvanMerrill opened this issue Jul 21, 2023 · 5 comments
Open

Provide a command to delete data #104

IvanMerrill opened this issue Jul 21, 2023 · 5 comments

Comments

@IvanMerrill
Copy link

I was playing around with some SLOs and experimenting with a test app and I was confused by the stale data I had. I hadn't realised that the data is being stored in a local data folder located in the fold I ran the am command from.

I do wonder if this location should be made more obvious or made consistent so you don't end up with lots of data folders all around the place. More than that though, it feels like there should be a command to clear this data, like an am refresh command or something similar that will wipe the data so you can start again cleanly.

For me this is particularly important in local development where you might be changing function names, SLO names, the SLOs you have etc.

@hatchan
Copy link
Contributor

hatchan commented Jul 24, 2023

I was playing around with some SLOs and experimenting with a test app and I was confused by the stale data I had. I hadn't realised that the data is being stored in a local data folder located in the fold I ran the am command from.

Please update to the latest version if you haven't done so already. You can delete the data directory, that is now stored in the .autometrics directory.

For me this is particularly important in local development where you might be changing function names, SLO names, the SLOs you have etc.

I think in the case where you are changing things it is more useful to actually see the change reflected in Prometheus/explorer. But it should also be possible to clear all the data once you verified it.

For now you can just delete the .autometrics directory. You can also startup am start with --ephemeral, which will make sure that all the prometheus data is deleted once you stop am.

We should also expose this behavior through the am api. This will allow the explorer to invoke it and thus the user will be able to simply click a button in the UI.

@brettimus
Copy link
Contributor

i'd +1 for a command in the help menu that tells you how to clear data

@Nlea
Copy link

Nlea commented Aug 15, 2023

+1
just run into the same issue
It would be good to let people know that the directory .autometrics is created from where you start AM. It can be confusing, especially if you consider it as a separate tool that you don't start from the same directory than your application.

Maybe also am system prune can look if the folder .autometrics exist from where you run the prune command and ask you if you like to delete the data as well. And if it can't find the .autometrics directory from the place you run the prune command it can notify you that it is not there but you might still have it somewhere...

@jimvdl
Copy link

jimvdl commented Aug 15, 2023

There is also the option to place the .autometrics directory in the home/local/cache directory with the help of the dirs crate to give it a centralized location. Although I'm not sure how applicable this might be, I still wanted to make a note of it in case it might be useful.

@hatchan
Copy link
Contributor

hatchan commented Aug 15, 2023

There is also the option to place the .autometrics directory in the home/local/cache directory with the help of the dirs crate to give it a centralized location. Although I'm not sure how applicable this might be, I still wanted to make a note of it in case it might be useful.

Thanks for the suggestion. We are already using that crate for determining where to download the prometheus/pushgateway binary. The reason we are using the local directory for Prometheus' storage is that each project (most likely organized as separate directories) will get it own unique data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants