<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Dynatrace Metrics API into Jupyter Notebook in Dynatrace API</title>
    <link>https://community.dynatrace.com/t5/Dynatrace-API/Dynatrace-Metrics-API-into-Jupyter-Notebook/m-p/109893#M526</link>
    <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;Got it:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;metric = 'builtin:service.response.time'&lt;BR /&gt;entity_type = 'SERVICE'&lt;BR /&gt;entity_id = 'SERVICE-64FED8674FB7BA98'&lt;BR /&gt;from_time = 'now-1h'&lt;BR /&gt;to_time = 'now'&lt;BR /&gt;&lt;BR /&gt;url = '{0}/api/v2/metrics/query?metricSelector={1}&amp;amp;from={2}&amp;amp;to={3}&amp;amp;resolution=2m&amp;amp;entitySelector=type({4}),entityId({5})'.format(base_url,metric,from_time,to_time,entity_type,entity_id)&lt;BR /&gt;&lt;BR /&gt;result = requests.get(url, headers=headers)&lt;BR /&gt;&lt;BR /&gt;result_json = result.json()&lt;BR /&gt;&lt;BR /&gt;in_data = result_json['result'][0]['data'][0]&lt;BR /&gt;del in_data['dimensions']&lt;BR /&gt;&lt;BR /&gt;df = pd.DataFrame.from_dict(in_data)&lt;BR /&gt;&lt;BR /&gt;df.timestamps = pd.to_datetime(df.timestamps, unit='ms', utc=True)&lt;BR /&gt;df.timestamps = df.timestamps.dt.tz_convert('US/Central')&lt;BR /&gt;&lt;BR /&gt;df.plot(x='timestamps', y='values')&lt;/PRE&gt;&lt;/DIV&gt;</description>
    <pubDate>Mon, 09 Mar 2020 15:33:53 GMT</pubDate>
    <dc:creator>grogers</dc:creator>
    <dc:date>2020-03-09T15:33:53Z</dc:date>
    <item>
      <title>Dynatrace Metrics API into Jupyter Notebook</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Dynatrace-Metrics-API-into-Jupyter-Notebook/m-p/109892#M525</link>
      <description>&lt;P&gt;Has anyone used the Dynatrace Metrics API (v2) to pull data into a Jupyter notebook? I'm close, but need to pivot the default data format into something more friendly.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;url = '{0}/api/v2/metrics/query?metricSelector={1}&amp;amp;from={2}&amp;amp;to={3}&amp;amp;resolution=2m&amp;amp;entitySelector=type({4}),entityId({5})'.format(base_url,metric,from_time,to_time,entity_type,entity_id)&lt;BR /&gt;&lt;BR /&gt;result = requests.get(url, headers=headers)&lt;BR /&gt;&lt;BR /&gt;result_json = result.json()&lt;BR /&gt;&lt;BR /&gt;df = pd.DataFrame.from_dict(result_json['result'][0]['data'])&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;df&lt;/PRE&gt;
&lt;P&gt;&lt;IMG src="https://community.dynatrace.com/legacyfs/online/24048-capture.jpg" border="0" /&gt;&lt;/P&gt;
&lt;P&gt;I'm trying to gather 4-5 different metrics into a notebook to present to management.&lt;/P&gt;</description>
      <pubDate>Tue, 25 May 2021 11:14:44 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Dynatrace-Metrics-API-into-Jupyter-Notebook/m-p/109892#M525</guid>
      <dc:creator>grogers</dc:creator>
      <dc:date>2021-05-25T11:14:44Z</dc:date>
    </item>
    <item>
      <title>Re: Dynatrace Metrics API into Jupyter Notebook</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Dynatrace-Metrics-API-into-Jupyter-Notebook/m-p/109893#M526</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;Got it:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;metric = 'builtin:service.response.time'&lt;BR /&gt;entity_type = 'SERVICE'&lt;BR /&gt;entity_id = 'SERVICE-64FED8674FB7BA98'&lt;BR /&gt;from_time = 'now-1h'&lt;BR /&gt;to_time = 'now'&lt;BR /&gt;&lt;BR /&gt;url = '{0}/api/v2/metrics/query?metricSelector={1}&amp;amp;from={2}&amp;amp;to={3}&amp;amp;resolution=2m&amp;amp;entitySelector=type({4}),entityId({5})'.format(base_url,metric,from_time,to_time,entity_type,entity_id)&lt;BR /&gt;&lt;BR /&gt;result = requests.get(url, headers=headers)&lt;BR /&gt;&lt;BR /&gt;result_json = result.json()&lt;BR /&gt;&lt;BR /&gt;in_data = result_json['result'][0]['data'][0]&lt;BR /&gt;del in_data['dimensions']&lt;BR /&gt;&lt;BR /&gt;df = pd.DataFrame.from_dict(in_data)&lt;BR /&gt;&lt;BR /&gt;df.timestamps = pd.to_datetime(df.timestamps, unit='ms', utc=True)&lt;BR /&gt;df.timestamps = df.timestamps.dt.tz_convert('US/Central')&lt;BR /&gt;&lt;BR /&gt;df.plot(x='timestamps', y='values')&lt;/PRE&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 09 Mar 2020 15:33:53 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Dynatrace-Metrics-API-into-Jupyter-Notebook/m-p/109893#M526</guid>
      <dc:creator>grogers</dc:creator>
      <dc:date>2020-03-09T15:33:53Z</dc:date>
    </item>
  </channel>
</rss>

