Declarative process grouping

OneAgent version 1.217+

Within large, dynamic environments, the number of processes running on your hosts can become overwhelming. For this reason, Dynatrace automatically monitors important process group types—process groups that are either of a known technology or that consume significant resources.

However, Dynatrace also provides the option of monitoring specific processes that fall into neither of these two categories. This means that you can monitor processes of a technology type unknown to Dynatrace that don't consume significant resources.

Declarative grouping works only for processes that aren't deep-monitored.

To create such a process group, use the declarative process-grouping feature, which enables you to add fine-grained rules to match any specific process group. Declarative process grouping is based on the Settings 2.0 framework, so you can create the rules using the Dynatrace web UI or the Settings API.

Create a process group using web UI

To create a process group using the Dynatrace web UI

  1. In the Dynatrace menu, go to Settings > Processes and containers > Declarative process grouping.
  2. Select Add technology.
    Note: The technology is a logical container to group detection rules. It will be visible as the main technology of the process group.
  3. Select Add rule.
    Note: A rule can comprise a number of individual detection rules. A process group is identified if all of the individual detection rules match.
  4. Enter Process identifier.
    Note: The process identifier is a unique string to let Dynatrace identify the process group.
  5. Under Process display name, select a process group name.
  6. Select Add detection rule.
  7. Select the object against which your detection rule will be tested: Command line argument, Executable name, or Executable path.
    Note: All rules must match to identify a process group.
  8. Enter a Condition.
    Note: Depending on what you want your rule to match, you can define a string that:
    • starts with – use $prefix qualifier, for example $prefix(/usr/sbin/keepalived)
    • ends with – use $suffix qualifier, for example $suffix(keepalived)
    • equals to – use $eq qualifier, $eq(-d)
    • contains - use $contains qualifier , for example $contains(keepalived)
  9. When you finish defining all the rules, select Save changes.

After saving your changes, Dynatrace will automatically detect and monitor the newly defined custom process group across all hosts—even on hosts that are launched following the definition of the custom process group.

Note: Dynatrace automatically assigns names to detected process groups of unrecognized process technologies that consume significant resources. You can also define a detection rule to adapt the names of such process groups based on your needs.

Create a process group using Settings API

To create a process group using Settings API

  1. Create an API token and enable the Write settings (settings.write) permission.
  2. Use the Get a schema endpoint to learn the JSON format required to post your configuration. The declarative process-grouping schema identifier is builtin:declarativegrouping. Here is an example JSON payload with the process group configuration:
    "value": {
         "name": "keepalived",
         "detection": [
           {
             "id": "keepalived",
             "processGroupName": "keepalived",
             "rules": [
               {
                 "property": "executable",
                 "condition": "$eq(keepalived)"
               },
               {
                 "property": "executablePath",
                 "condition": "$prefix(/usr/sbin/keepalived)"
               },
               {
                 "property": "commandLine",
                 "condition": "$eq(-d)"
               }
             ]
           }
    
  3. Use the Post an object endpoint to send your configuration.

Add declarative process grouping to Extensions 2.0

You can also attach your declarative process-grouping definition to your Extensions 2.0 extension so that your custom extension comes with predefined process grouping rules. Add your definition to the Extension YAML file as in this example:

---
name: custom:my-extension
version: 1.0.0
minDynatraceVersion: "1.218"
author:
  name: Joe Doe
   
processes:
  - name: keepalived
    detection:
    - id: ext.keepalived
      processGroupName: keepalived
      rules:
      - property: executable
        condition: "$eq(keepalived)"
      - property: executablePath
        condition: "$prefix(/usr/sbin/keepalived)"
      - property: commandLine
        condition: "$eq(-d)"