APM REST API - Querying by agent attributes
search cancel

APM REST API - Querying by agent attributes

book

Article ID: 191028

calendar_today

Updated On:

Products

CA Application Performance Management Agent (APM / Wily / Introscope) CA Application Performance Management (APM / Wily / Introscope) INTROSCOPE DX Application Performance Management

Issue/Introduction

Environment

Valid for :
Application Performance Management (APM) SaaS, On-premise 10.7.x, 11.x, 19.4.x and onward releases

Resolution

Example 1: Query information using REST API, VERTEX EndPoint (apm/appmap/vertex)

https://techdocs.broadcom.com/content/broadcom/techdocs/us/en/ca-enterprise-software/it-operations-management/application-performance-management/10-7/api-reference/apm-rest-api/vertex.html

In this example, the Agent attribute extension has been configured to generate the below custom attributes:

<AGENT-HOME>\releases\<version>\extensions\<automaticattributedecoration-folder>\bundles.properties, set 

attribute.decoration.load.configuration.from.properties=true
attribute.decoration.environment.properties=TEMP,USERNAME
attribute.decoration.system.properties=os.name,os.version
attribute.decoration.static.attributes.configurations=default,default2
attribute.decoration.static.attributes.configurations.default.attributeName=appserver
attribute.decoration.static.attributes.configurations.default.value=tomcat
attribute.decoration.static.attributes.configurations.default2.attributeName=appname
attribute.decoration.static.attributes.configurations.default2.value=qatestapp

In ATC


 

Query 1: List all vertex that contains custom attribute applicationname = qatestapp

http://lvntest004382.bpc.broadcom.net:7081/apm/appmap/vertex?q=attributes.usr.appserver:tomcat

 

Query 2: Include an “AND” operator

http://lvntest004382.bpc.broadcom.net:7081/apm/appmap/vertex?q=attributes.usr.appserver:tomcat AND attributes.usr.appname:qatestapp

 

 

Example 2: Query information using REST API, Graph EndPoint (/apm/appmap/graph)

https://techdocs.broadcom.com/content/broadcom/techdocs/us/en/ca-enterprise-software/it-operations-management/application-performance-management/10-7/api-reference/apm-rest-api/graph-vertex.html


In this example, the agent attribute extension has been configured to generate the below custom attribute:

<AGENT-HOME>\releases\<version>\extensions\<automaticattributedecoration-folder>\bundles.properties, set 

attribute.decoration.load.configuration.from.properties=false

attribute.decoration.jsonFileName.configuration=D:\\Labs\\QAtestapp-package\\QAtestsapp\\startup_scripts\\wily203\\releases\\20.3\\extensions\\automaticattributedecoration-580cd422-20.3.0.15\\AttributeDecorationConfig.json

Or update appserver configuration file, in this case catalina.bat to use java system properties:
-Dattribute.decoration.jsonFileName.configuration=C:\\AttributeDecorationConfig.json

Content of AttributeDecorationConfig.json is as below:



In ATC





Query 1: List all vertex to view the above custom attribute(s),  in this example we confirm “test2-system-property” exist
http://lvntest004382.bpc.broadcom.net:7081/apm/appmap/graph





Query 2: filter vertices where custom attribute "usr.test2-system-property " is undefined OR equals to " test2-value-system-property”

http://lvntest004382.bpc.broadcom.net:7081/apm/appmap/graph/vertex?projection=full

In REST call query body include below Json content:
{
    "includeStartPoint": false,
    "orItems":[
        {
            "andItems":[
                {
                     "itemType" : "attributeFilter",
                     "attributeName": "usr.test2-system-property",
                     "attributeOperator": "IN",
                     "values": [ "test2-value-system-property" ]
                 }
            ]
        }
    ]
}

Result = correct




Query 3: Set "outputLayer":"ATC" or "layer":"ATC" 
Result = empty and correct, as per documentation, static custom attributes appear in APM Infrastructure layer only:

https://techdocs.broadcom.com/content/broadcom/techdocs/us/en/ca-enterprise-software/it-operations-management/dx-apm-saas/SaaS/implementing-agents/java-agent/java-agent-extensions/automatic-attribute-decoration-java-agent.html

“IMPORTANT: The Environment, System, Static, External, and Sentinel attributes are added to the APM Infrastructure Layer. The Application and Manifest attributes are added to the Application Layer.”




Query 4: Set "outputLayer":" APM_INFRASTRUCTURE OR" or "layer":" APM_INFRASTRUCTURE
Result = Correct




Clicking on the self link opens the right vertex 





Additional Information


- Vertex filter supports filtering in lucene syntax, the complete syntax description is available at https://lucene.apache.org/core/4_7_0/queryparser/org/apache/lucene/queryparser/classic/package-summary.html


- Attribute decoration extension documentation:
https://techdocs.broadcom.com/content/broadcom/techdocs/us/en/ca-enterprise-software/it-operations-management/dx-apm-saas/SaaS/implementing-agents/java-agent/java-agent-extensions/automatic-attribute-decoration-java-agent.html#tocusencaenterprisesoftwareitoperationsmanagementdxapmsaasSaaSapireferenceapmrestapihtmlDXAPMRESTAPI


- REST API Usage:
https://techdocs.broadcom.com/content/broadcom/techdocs/us/en/ca-enterprise-software/it-operations-management/application-performance-management/10-7/api-reference/apm-rest-api.html#tocusencaenterprisesoftwareitoperationsmanagementapplicationperformancemanagement107apireferenceapmrestapihtmlAPMRESTAPI

https://knowledge.broadcom.com/external/article?articleId=182979

Attachments