Define Resource Dimension
After the APM Java agent is deployed, you can define the resource dimension in 2 different ways:
Simplified Resource Definition
The simplified resource dimension can be defined with key/value pair properties.
The key of property must be starting with
com.oracle.apm.agent.resource.tag
.
The following table shows different ways to define resource dimension in the simplified way:
Properties Type and Description | Supported by | Property | Example |
---|---|---|---|
AgentConfig.properties Update the |
APM Agent | com.oracle.apm.agent.resource.tag.<ResourceName> |
com.oracle.apm.agent.resource.tag.MyDepartment=Sales
|
System Properties Update the system properties. |
APM Agent and APM Tracer | com.oracle.apm.agent.resource.tag.<ResourceName> |
|
Environment Variables Update the environment variables. |
APM Agent and APM Tracer | com_oracle_apm_agent_resource.tag_<ResourceName> |
For Windows:
For Linux:
|
Trace Builder |
APM Tracer | com.oracle.apm.agent.resource.tag.<ResourceName> |
|
The value of the resource property can be a static text and/or a variable
enclosed by ${
and }
symbols.
- Any text.
- Key of the Java system properties enclosed by
${
and}
symbols. - Key of the environment variables enclosed by
${
and}
symbols. For example:${USERNAME}
Comprehensive Resource Definition
Custom application server resource dimension can be defined to meet specific requirements.
oracle-apm-agent/config/<version>
directory.
The ResourceCollection.acml file is not created by APM Agent deployment and it must be created manually.
The format of
ResourceCollection.acml
is a custom ACML format (subset of
YAML).
ACML Tag | Data Type | Required | Description |
---|---|---|---|
RESOURCE: | yes | Resource collection header. | |
<resource_entry_name>: | string | yes | Reporting resource name. |
property: <property key> | string | yes | APM property key of the resource.
This is the property key of this resource value. It is also used by other resources for variable resolution. |
type: <resource type> | string | yes | Type of this property. |
scalar: <resource scalar> | string | yes | Resource value type.
Supported values are string, long, or double. |
identity: <resource as identity> | boolean | No | Flag indicates if this resource is used for
appserver identity calculation.
Any resource with non-null value is used for appserverId dimension calculation. |
priority: <collection priority> | unsigned integer | No | Positive integer to indicate the resource collection priority. 0 (zero) is the highest priority. Custom resource should always set this value to 0 . |
default: <default value> | string | No | Default value of the resource when none of the specified sources returns a non-null value. |
source: | Not applicable | yes | Array node of the sources of this resource.
One or more child element can be defined for this source array. Each element is evaluated in order as defined, and the first one with non-null value is used. If none of the element evaluation returned non-null value, then this resource is ignored. |
- type: mbean | string | No | Collect resource metadata from JMX mbean. Multiple can be defined for each resource. |
mbean_name: <mbean object name> | string | No | The mbean_name is the ObjectName of
mbean.
|
value_path: <value selection path> | string | No |
The The first path node is the attribute of the mbean, then the value of the attribute is evaluated with each successive path node. Evaluation supports the following
|
<regex parsing> | string | No |
The resource value selected can be further processed by using regex parsing tags. See Regex Parsing for more information. |
type: property | string | No | Resource value of system property or environment variable. Multiple can be defined for each resource. |
key: <property key> | string | No | The key name of system property or environment variable. |
- type: value | string | No | The static value. At most one should be defined in each resource because this value is never null. |
value: <static value and/or variable> | string | No | The value can be one or more of the following:
The properties keys contains the
|
<regex parsing> | string | No | The resource value selected can be further processed by using regex parsing tags. See Regex Parsing for more information. |
Regex Parsing
Regex parsing are additional tags of the source node to extract specific value of resource value with regular expression. For syntax details, see below:
Tag | Base Type | Description |
---|---|---|
regex: <regex:: | string | A regular expression against resource value with group construction. |
<regex parsing> | unsigned integer | A group number of regex. The value of specified group is the final resource value. |