cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Storing Data between plugin runs

Ben_Harvey
Contributor

Hi,
As the title suggests, how are you storing data between plugin runs?

I've had a couple of instances where I could have done with the state of a variable being available next time, so far i've found ways around it.
I'm guessing i could convert my data to JSON and save to a file.

Does Dynatrace offer any functions for data storage as part of the API? The only thing ive come across is
class ruxit.api.data.PluginMeasurementStorage(topx_data: typing.Dict[] = {})

which says "Not to be used for custom plugin"

5 REPLIES 5

Mike_L
Dynatrace Champion
Dynatrace Champion

Hi,

Just store it outside of the query method in the class as a self variable. They're kept between runs.

Mike

Thanks Mike! 

motdde
Participant

Hello @Mike_L ,

 

Thanks for the insights. The persisted variables between runs, are they available to all endpoints? or encapsulated in Individual Endpoints?


Mike_L
Dynatrace Champion
Dynatrace Champion

They are per endpoint. If you want to share something between several you need to use a temp file or so.

Thanks Mike.