11 Sep 2020 09:00 AM
Is there a way download data from the API that shows the monitor display name rather than the unique ID (SYNTHETIC_TEST-0000000000014ADD style ID)?
I'm using python requests:
import requests
import pandas as pd
import io
URL = "https://ABCDE.live.dynatrace.com/api/v2/metrics/query?metricSelector=builtin%3Asynthetic.browser.totalDuration&from=now-2d&to=now-1d"
headers = {"Authorization": "Api-Token " + "3qub092adsfaf3", "accept": "application/json"}
urlData = requests.get(URL, headers=headers).content
rawData = pd.read_json(io.StringIO(urlData.decode('utf-8')))
Solved! Go to Solution.
11 Sep 2020 09:37 AM
You could use the names transformator:
api/v2/metrics/query?metricSelector=builtin%3Asynthetic.browser.totalDuration:names&from=now-2d&to=now-1d
Will return:
11 Sep 2020 10:11 AM
Oh you just made my day. Thank you so much for such a quick answer!
I'd read the help page on selector transformations, but the one thing it didn't mention was how to embed them into a URL (I suppose I should/could have worked that out but I'm new to this API stuff).