<?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: How can I assosiate some metrics collected by WMI extension with a process? in Extensions</title>
    <link>https://community.dynatrace.com/t5/Extensions/How-can-I-assosiate-some-metrics-collected-by-WMI-extension-with/m-p/199478#M2574</link>
    <description>&lt;P&gt;You've got a couple of options here. These are the two easiest ones as they are programmatic.&lt;/P&gt;
&lt;P&gt;1: If you can get the process ID through a call, you can add that as a dimension. It'd then be translated to the process instance id and process group id.&lt;/P&gt;
&lt;P&gt;For example, this metric line:&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;myMetric &lt;/SPAN&gt;&lt;SPAN&gt;dt.process.id=12345 1&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;would become&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;myMetric dt.entity.process_group_instance=PROCESS_GROUP_INSTANCE-D337020E5CAE4F0F,dt.entity.process_group=PROCESS_GROUP-D337020E5CAE4F0D 1&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;Example yaml:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE class="c-mrkdwn__pre" data-stringify-type="pre"&gt;wmi:
  - group: WMIClasses
    interval: 10~
    featureSet: basic
    subgroups:
      - subgroup: ZoomCamera
        wmiNamespace: root\cimv2
        query: SELECT Name, Status, PID FROM Win32_PnPEntity WHERE PNPClass='Camera'
        dimensions:
          - key: camera.name
            value: Name
          - key: camera.status
            value: Status
          - key: dt.process.id
            value: PID&lt;/PRE&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt;2: If you can define the process detection rule in the same yaml, you can reference that in the wmi section to automatically add the process instance id and process group id.&lt;/P&gt;
&lt;P&gt;For example:&lt;/P&gt;
&lt;PRE class="c-mrkdwn__pre" data-stringify-type="pre"&gt;processes:
  - name: ZoomTech
    detection:
      - id: zoomtech
        processGroupName: Zoom
        rules:
        - property: executable
          condition: "$prefix(Zoom)"
wmi:
  - group: WMIClasses
    interval: 10~
    featureSet: basic
    subgroups:
      - subgroup: ZoomCamera
        wmiNamespace: root\cimv2
        query: SELECT Name, Status FROM Win32_PnPEntity WHERE PNPClass='Camera'
        dimensions:
          - key: camera.name
            value: Name
          - key: camera.status
            value: Status
          - key: dt.techrule.id
            value: const:zoomtech&lt;/PRE&gt;
&lt;P&gt; &lt;/P&gt;</description>
    <pubDate>Wed, 30 Nov 2022 10:28:01 GMT</pubDate>
    <dc:creator>Mike_L</dc:creator>
    <dc:date>2022-11-30T10:28:01Z</dc:date>
    <item>
      <title>How can I assosiate some metrics collected by WMI extension with a process?</title>
      <link>https://community.dynatrace.com/t5/Extensions/How-can-I-assosiate-some-metrics-collected-by-WMI-extension-with/m-p/194325#M2396</link>
      <description>&lt;P&gt;We have a custom WMI extension working, just have a simple question: &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Generally, metrics in Dynatrace can be associated with hosts, processes, or more by assigning values to &lt;EM&gt;Dynatrace reserved dimensions&lt;/EM&gt;, as described in the doc of the metrics ingestion protocol: &lt;A href="https://www.dynatrace.com/support/help/extend-dynatrace/extend-metrics/reference/metric-ingestion-protocol#dimension" target="_blank" rel="noopener"&gt;https://www.dynatrace.com/support/help/extend-dynatrace/extend-metrics/reference/metric-ingestion-protocol#dimension&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now, metrics collected using the WMI extension seem to be associated with &lt;STRONG&gt;the host&lt;/STRONG&gt; by default. We wish to associate some metrics with &lt;STRONG&gt;a process&lt;/STRONG&gt;. This is not documented in the docs for WMI: dynatrace.com/support/help/extend-dynatrace/extensions20/data-sources/wmi-extensions/wmi-tutorial.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can we create this topology?&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2022 12:32:17 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Extensions/How-can-I-assosiate-some-metrics-collected-by-WMI-extension-with/m-p/194325#M2396</guid>
      <dc:creator>rab</dc:creator>
      <dc:date>2022-09-13T12:32:17Z</dc:date>
    </item>
    <item>
      <title>Re: How can I assosiate some metrics collected by WMI extension with a process?</title>
      <link>https://community.dynatrace.com/t5/Extensions/How-can-I-assosiate-some-metrics-collected-by-WMI-extension-with/m-p/199478#M2574</link>
      <description>&lt;P&gt;You've got a couple of options here. These are the two easiest ones as they are programmatic.&lt;/P&gt;
&lt;P&gt;1: If you can get the process ID through a call, you can add that as a dimension. It'd then be translated to the process instance id and process group id.&lt;/P&gt;
&lt;P&gt;For example, this metric line:&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;myMetric &lt;/SPAN&gt;&lt;SPAN&gt;dt.process.id=12345 1&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;would become&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;myMetric dt.entity.process_group_instance=PROCESS_GROUP_INSTANCE-D337020E5CAE4F0F,dt.entity.process_group=PROCESS_GROUP-D337020E5CAE4F0D 1&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;Example yaml:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE class="c-mrkdwn__pre" data-stringify-type="pre"&gt;wmi:
  - group: WMIClasses
    interval: 10~
    featureSet: basic
    subgroups:
      - subgroup: ZoomCamera
        wmiNamespace: root\cimv2
        query: SELECT Name, Status, PID FROM Win32_PnPEntity WHERE PNPClass='Camera'
        dimensions:
          - key: camera.name
            value: Name
          - key: camera.status
            value: Status
          - key: dt.process.id
            value: PID&lt;/PRE&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt;2: If you can define the process detection rule in the same yaml, you can reference that in the wmi section to automatically add the process instance id and process group id.&lt;/P&gt;
&lt;P&gt;For example:&lt;/P&gt;
&lt;PRE class="c-mrkdwn__pre" data-stringify-type="pre"&gt;processes:
  - name: ZoomTech
    detection:
      - id: zoomtech
        processGroupName: Zoom
        rules:
        - property: executable
          condition: "$prefix(Zoom)"
wmi:
  - group: WMIClasses
    interval: 10~
    featureSet: basic
    subgroups:
      - subgroup: ZoomCamera
        wmiNamespace: root\cimv2
        query: SELECT Name, Status FROM Win32_PnPEntity WHERE PNPClass='Camera'
        dimensions:
          - key: camera.name
            value: Name
          - key: camera.status
            value: Status
          - key: dt.techrule.id
            value: const:zoomtech&lt;/PRE&gt;
&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2022 10:28:01 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Extensions/How-can-I-assosiate-some-metrics-collected-by-WMI-extension-with/m-p/199478#M2574</guid>
      <dc:creator>Mike_L</dc:creator>
      <dc:date>2022-11-30T10:28:01Z</dc:date>
    </item>
  </channel>
</rss>

