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

How can I assosiate some metrics collected by WMI extension with a process?

rab
Frequent Guest

We have a custom WMI extension working, just have a simple question:  

 

Generally, metrics in Dynatrace can be associated with hosts, processes, or more by assigning values to Dynatrace reserved dimensions, as described in the doc of the metrics ingestion protocol: https://www.dynatrace.com/support/help/extend-dynatrace/extend-metrics/reference/metric-ingestion-pr...

 

Now, metrics collected using the WMI extension seem to be associated with the host by default. We wish to associate some metrics with a process. This is not documented in the docs for WMI: dynatrace.com/support/help/extend-dynatrace/extensions20/data-sources/wmi-extensions/wmi-tutorial.

 

How can we create this topology?

1 REPLY 1

Mike_L
Dynatrace Guru
Dynatrace Guru

You've got a couple of options here. These are the two easiest ones as they are programmatic.

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.

For example, this metric line:

myMetric dt.process.id=12345 1

would become

myMetric dt.entity.process_group_instance=PROCESS_GROUP_INSTANCE-D337020E5CAE4F0F,dt.entity.process_group=PROCESS_GROUP-D337020E5CAE4F0D 1

Example yaml:

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

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.

For example:

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

Mike

Featured Posts