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

How to filter processes for java version?

mdouds
Helper

I'm looking for a way to find all of the process groups with java version 11. 

 

The Infrastructure > Technologies & processes screen does not let you specify versions in the filter.


We thought about creating an auto tag as there is a "Technology Version" condition. 

Using this as an example:

mdouds_0-1634835305161.png

We cannot use Technology version contains "OpenJDK 11", because the word "OpenJDK" is not present in the "version" field:

 

"type": "JAVA",
"edition": "OpenJDK",
"version": "11.0.11"

 

Sure enough, Technology Version contains "OpenJDK 11" returns 0 matches.

 

If I move the OpenJDK to its own condition:

 Technology Edition equals "OpenJDK" 

 Technology Version begins with "11"

 

then we could see version matches coming from other technologies, like this hypothetical:

 

Garden, Java (OpenJDK 10), SomeOtherClient (11.0.6), reactor-core (3.3.17.RELEASE)

 

Is there any way to find an exact match where a specific technology edition has to match a specific version?

11 REPLIES 11

r_weber
DynaMight Champion
DynaMight Champion

Hi @mdouds ,

 

you could do that via the API and an entitySelector on a attribute of a process group instance like so:

/api/v2/entities?entitySelector=type(PROCESS_GROUP_INSTANCE),processType("JAVA"),jvmClrVersion("1.8.0_261")

Unfortunately the attribute selector doesn't have any contains but only exact matches.

But what you could do is maybe create an entityselector based tagging rule and then based on this tag perform the next tagging with "begins", "contains".

 

kr,

Reinhard
  

Certified Dynatrace Master, Dynatrace Partner - 360Performance.net

No luck using this approach. The processes using OpenJDK are not reporting a jvmClrVersion property. 

  • Works: Java (IBM 1.8.0_271 SR6 FP20)
  • Does not work: Java (OpenJDK 1.8.0_292)

r_weber
DynaMight Champion
DynaMight Champion

I quickly fired up an API request here, with this selector:

type(PROCESS_GROUP_INSTANCE),jvmVendor("OpenJDK")
"properties": {
            "awsNameTag": "SAP Hybris",
            "bitness": "64",
            "detectedName": "tomcat",
            "installerVersion": "1.225.146.20210929-151104",
            "jvmClrVersion": "11.0.12",
            "jvmVendor": "OpenJDK",
            "listenPorts": [
                9001
            ],
            ...
}

 

Certified Dynatrace Master, Dynatrace Partner - 360Performance.net

Hello,

 

Maybe java included with springboot does not include jvmVendor or clr version. I get zero results for that entitySelector, and when viewing a specific java process, see no jvm* property.

 

{
  "entityId": "xxxxxxxxx",
  "displayName": "xxxxxxxx",
  "firstSeenTms": 1634709420000,
  "lastSeenTms": 1635173340000,
  "properties": {
    "bitness": "64",
    "detectedName": "xxxxxxxx",
    "metadata": [
      xxxxxx
    ],
    "installerVersion": "1.219.156.20210713-151838",
    "awsNameTag": "xxxxxxxx",
    "softwareTechnologies": [
      {
        "type": "GARDEN"
      },
      {
        "type": "JAVA"
      },
      {
        "type": "SPRING",
        "edition": "WebFlux HTTP client",
        "version": "5.2.15.RELEASE"
      },
      {
        "type": "NETTY",
        "edition": "HTTP Server",
        "version": "4.1.65.Final"
      },
      {
        "type": "REACTOR_CORE",
        "version": "3.3.17.RELEASE"
      },
      {
        "type": "JAVA",
        "edition": "OpenJDK",
        "version": "11.0.11"
      }
    ],
    "processType": "JAVA",

 

Hello,

 

I ran the same entity selector command for our environment and got 0 results. If I call /v2/entities/<process instance id> on one of these PI's, there is no property starting with jvm. 

 

The only place that mentions the java version is in the softwareTechnologies array:

 

...
    "awsNameTag": "xxxxxxxx",
    "softwareTechnologies": [
      {
        "type": "GARDEN"
      },
      {
        "type": "JAVA"
      },
      {
        "type": "SPRING",
        "edition": "WebFlux HTTP client",
        "version": "5.2.15.RELEASE"
      },
      {
        "type": "NETTY",
        "edition": "HTTP Server",
        "version": "4.1.65.Final"
      },
      {
        "type": "REACTOR_CORE",
        "version": "3.3.17.RELEASE"
      },
      {
        "type": "JAVA",
        "edition": "OpenJDK",
        "version": "11.0.11"
      }
    ],
    "processType": "JAVA",
...

 

ct_27
DynaMight Pro
DynaMight Pro

Dear Dynatrace: This is another instance where it would be useful to allow us to use Properties as Tags. This information is available in the Process Group Instance properties.

 

This is the 4th or 5th time I'm writing tagging rules to extract properties information.  This shouldn't even be necessary.

 

This is just the draft but we have a tagging rule that gets the EXEpath data for a process group then extracts the version "{ProcessGroup:ExePath/openjdk-(\d+?\.*?\d+\.*?\d+\.*?\d+)}".   I need to make the Regex more robust and add additional conditions for non openjdk and java11 etc. but it works.  Also, Dynatrace auto tags the Process Group Instance even though your rule is applied to Process Groups (undocumented but that's what it does)

HigherEd

Babar_Qayyum
DynaMight Guru
DynaMight Guru

Hello @r_weber 

How to identify the processes utilizing Java 19?

Babar_Qayyum_0-1727943073200.png

Regards,

Babar

Hi @Babar_Qayyum ,
You can refer to the process I just posted on this thread.
It should probably help.

Maheedhar

Maheedhar_T
Advisor

Hi @mdouds ,
Not sure if you have tried this already but this can be achieved using DQL.
If you are on the latest version of Dynatrace SaaS and you have Grail enabled, just go to Notebooks, Create new Notebook, add DQL query and try this.

fetch dt.entity.process_group
| fieldsAdd softwareTechnologies
| expand softwareTechnologies
| filterOut isNull(softwareTechnologies)
| filter matchesPhrase(softwareTechnologies,"JAVA")
| parse softwareTechnologies,"\"type:JAVA,edition:\"LD:edition\",version:\"LD:version"

Now you'll have a filed called version and using that you can filter out required version of JAVA.
for example,

fetch dt.entity.process_group
| fieldsAdd softwareTechnologies
| expand softwareTechnologies
| filterOut isNull(softwareTechnologies)
| filter matchesPhrase(softwareTechnologies,"JAVA")
| parse softwareTechnologies,"\"type:JAVA,edition:\"LD:edition\",version:\"LD:version"
| filter version == "11"

filters and displays only process groups that are on version 11.

Note: This version field is a string and if you use contains like this

fetch dt.entity.process_group
| fieldsAdd softwareTechnologies
| expand softwareTechnologies
| filterOut isNull(softwareTechnologies)
| filter matchesPhrase(softwareTechnologies,"JAVA")
| parse softwareTechnologies,"\"type:JAVA,edition:\"LD:edition\",version:\"LD:version"
| filter matchesPhrase(version,"11")

It does list out all the version strings with 11 as part of which means all 11.xx versions are covered but also if a version is 17.0.11 that is also covered so play around with caution.
Regards,
@Maheedhar_T 

Maheedhar

Babar_Qayyum
DynaMight Guru
DynaMight Guru

Hello @Maheedhar_T 

Thank you for your reply. We have a managed setup.

Regards,

Babar

 

Featured Posts