On this page:

You can send metrics to the Standalone Machine Agent using its HTTP listener. You can report metrics through the Standalone Machine Agent by making HTTP calls to the agent instead of piping to the agent through sysout.

Activate the HTTP listener

To activate the HTTP listener, restart the Standalone Machine Agent by setting the metric.http.listener system property to true. In addition, you can specify the host and port with system properties.

The -D system properties are as follows:

<machine_agent_home>/bin/machine-agent -Dmetric.http.listener=true -Dmetric.http.listener.port=<port_number> -Dmetric.http.listener.host=0.0.0.0

Be sure to put the options before the jar name in your start up command.

 

Send metrics

GET | POST /machineagent/metrics

Send events

GET /machineagent/event

Upload metrics

You can use GET or POST to upload metrics to the Metric Browser under Application Performance -> <Tier> where the tier is the one defined for the Standalone Machine Agent.

The format for GET is:

GET /machineagent/metrics

For example:

http://host:port/machineagent/metrics?name=Custom Metrics|Test|My Metric&value=42&type=average

The format for POST is:

POST /machineagent/metrics

with header:

Content-Type: application/xml

with body content:

<?xml version="1.0"?>
<request>
<metric name="[name of metric 1]", type="[aggregation type]", value="[value of metric 1]" />
<metric name="[name of metric 2]", type="[aggregation type]", value="[value of metric 2]" />
...
<metric name="[name of metric n]", type="[aggregation type]", value="[value of metric n]" />
</request>

Example:

http://host:port/machineagent/metrics

Example of Body Content:

<request>
<metric name="Custom Metrics|Test|My Metric 1", type="AVERAGE", value="22" />
<metric name="Custom Metrics|Test|My Metric 2", type="SUM", value="98737" />
<metric name="Custom Metrics|Test|My Metric 3", type="CURRENT", value="93" />
</request>

 

Valid values for type are:

To upload multiple metrics in one action use HTTP POST to send
the metrics in XML format. For example:

<metrics>
<metric name=”Custom Metrics|Metric1” value=”42” type=”average”/>
<metric name=Custom Metrics|Metric1” value=”7” type=”average”/>
</metrics>

The XML response:

<response>
<response-code>0</response-code>
<execution-output>Metric Upload Successful</execution-output>
</response>

Upload events

Send events using HTTP get requests to:

http://localhost:8293/machineagent/event?type=<event_type>&summary=<summary_text> 

Event_type is one of the following:

Shut down the Standalone Machine Agent

GET /machineagent/shutdown