I'm trying to capture a custom metric via a Synthetic HTTP monitor. I'm hitting a webpage with an HTTP monitor and using post-processing I can find a number in the responsebody and store it as a variable.
what's I'm wondering is, can i now make some kind of Post-Processing CURL or API call to pass that number into Dynatrace as a custom metric or maybe even a custom log event?
The ultimate goal is to be alerted when microsoft updates the version of one of its modules. Microsoft has a website for which they post and update the version number. I'm currently monitoring this page via a Selenium script that monitors the version and when it recognizes an increase it triggers a Dynatrace alert via API. I would really like to bring the full logic into Dynatrace.
Solved! Go to Solution.
As far as staying within Synthetics, I imagine that would be possible by including a step in the test that makes a call to post a metric back through our API, with variables in post processing scripts that may be possible although it would be a more 'expensive' solution to getting the metric in. I doubt you'll be able to make any calls from within the post scripts themselves as there are restrictions in there.
Another option may be to set a text match rule in your test for if the current value of that number is ever not found, which would let you know something changed. This would require updating the test after every change in the number.
What I would personally do would be to put together a simple ActiveGate extension and gather this metric separately from Synthetics. There are lots of ways out there in Python to make a request and gather this value from the body and then just report it back as a metric. This would be less costly then doing it in a Synthetic action.
Thank you for the quick reply. All fantastic options.
So, I did try the variable to API Post to Dynatrace metric ingest v2 and that worked. But as you said it's expensive...HTTP Synthetic cost + metric ingest cost + the slowest i can go is every 60 minutes.
Option two, to simply check the text and notify if different is cheaper but as you said the script would need to be updated whenever it went off. Might not actually be so bad of an option while i work on creating the ActiveGate extension.
Best solution will be to convert by Selenium script over to python and run in the ActiveGate. It's less costly and can be far more intelligent. I'm really good with Selenium but limited experience in Python. Guess it's time to go learn something new.
Thanks for all the suggestions.