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

Machine Agent Http Listener not working

David.Machacek
Voyager

We have same problem as described in https://community.appdynamics.com/t5/Controller-SaaS-On-Premises/Machine-Agent-Http-Listener-not-wor....

We followed https://docs.appdynamics.com/appd/22.x/22.2/en/infrastructure-visibility/machine-agent/extensions-an... we send metrics, we get 204. But no data are displayed in the GUI console. Only the new metrics are registered, but no values are shown.

DavidMachacek_0-1681566052905.png

We send the data from synthetics jobs using python script. Logs from my script:

[INFO] Request sent, body=[{"metricName":"Custom Metrics|WebVitals|LCP","aggregatorType":"AVERAGE","value":9695.514}], responseStatus=204

 

11 REPLIES 11

Sunil.Agarwal
AppDynamics Team

Hi @David.Machacek ,  Is this issue occurring on SAAS or on-premises controller? If it is on-premises, you can review the controller logs to determine if there was problem with how the controller handled the Custom Metrics. In order to acquire more information to troubleshoot this problem, you might also need to activate debug logging for that machine agent. 

David.Machacek
Voyager

It is SAAS controller. But I check the machine agent logs where we find errors:

Apr 15, 2023 6:56:15 PM com.sun.jersey.spi.container.ContainerResponse mapMappableContainerException
SEVERE: The RuntimeException could not be mapped to a response, re-throwing to the HTTP container
java.lang.NullPointerException
at com.appdynamics.sim.agent.extensions.rest.AgentResource.writeMetrics(AgentResource.java:37)
at jdk.internal.reflect.GeneratedMethodAccessor159.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)

 

What are this caused by? We follow the documentation in our request (Http POST to machine agent in our OpenShift cluster/service) with body:
[{"metricName":"Custom Metrics|WebVitals|LCP","aggregatorType":"AVERAGE","value":9695.514}]

Mario.Morelli
Architect

Hi David

For your custom Metrics , please try changing your metrics by adding "value" at the end

For example, your metric field is 

Custom Metrics|WebVitals|LCP

Try using

Custom Metrics|WebVitals|LCP|value

We did extensive work in creating the custom metrics and decided on using this structure. This also will assist you when you want to dashboard a large number of metrics, where you can use a wildcard to show multiple values on the same graph, instead of adding multiple data points per metric. AppD doesn't support wildcarding the last name in the metric tree, hence adding the value at the end.

Also push some load on the endpoint initially, we also had a case where we needed to push some more load than a couple of requests, and after that it worked normally

 

Ciao

 



Found something helpful? Click the Accept as Solution button to help others find answers faster.
Liked something? Click the Thumbs Up button.

Learn more about me in the Community Member Spotlight Q & A

@Mario.Morelli thanks for your reply. I did try that but it did not help. We still do not see any metrics in GUI.

[INFO] Request sent, body=[{"metricName":"Custom Metrics|WebVitals|LCP|value","aggregatorType":"AVERAGE","value":7823.73}], responseStatus=204

DavidMachacek_0-1681651652626.png

I have sent around 100 of requests. But at least we dont have any more error logs in machine agent. Do you have any other suggestion?

Hey David

Can you do the following for the final test before troubleshooting

Send a couple of requests every 2-3 minutes and change the "number values" you provide for every request. Just remember, AppDynamics stores data in intervals, I believe the minimum values for metrics are 1 minute. So it can only store 1 value per minute, it's not on a millisecond level.

Provide feedback around the above if the graph starts displaying:)

 

Ciao



Found something helpful? Click the Accept as Solution button to help others find answers faster.
Liked something? Click the Thumbs Up button.

Learn more about me in the Community Member Spotlight Q & A

David.Machacek
Voyager

We continue testing. But since we use this feature to collect additional metrics for synthetic testing, which cannot more frequently then once in 5 minute (limitation given by synthetic monitoring jobs). But ill use some curl-based script to try it out more often.

Also currently we suspect, the floating points in our values might be to blame. AppDynamics might expect only whole numbers.

I will give update in couple of hours.

David.Machacek
Voyager

So I ran following script for an hour, but without any success. 


while $true; do curl -XPOST 'http://ma-agent.namespace.svc.cluster.local:8293/api/v1/metrics' -H 'Content-Type: application/json;charset=UTF-8' --data-raw '[{"metricName":"Custom Metrics|WebVitals|David|value","aggregatorType":"AVERAGE","value":'"$((RANDOM % 10 + 1))"'}]' -k -v ; sleep 1; done

I still dont know what is wrong. Can you help us please?

Hey David

I used your example, just manually tested and it works, I am just running locally with port 8082 instead of default port but doesn't make a difference

curl -v -X POST 'http://localhost:8082/api/v1/metrics' -H 'Content-Type: application/json;charset=UTF-8' --data-raw '[{"metricName":"Custom Metrics|WebVitals|David|value","aggregatorType":"AVERAGE","value":104}]'

And it works

Just make sure the value is not in single quotes, integer values should not be enclosed in single quotes. Think that might be your problem

 

Ciao

 



Found something helpful? Click the Accept as Solution button to help others find answers faster.
Liked something? Click the Thumbs Up button.

Learn more about me in the Community Member Spotlight Q & A

Hi David

I have tested myself with single and double quotes and both seem to work, so doesn't appear to be that.

Can you test 5 values to replicate my testing, sending one vlaue every 1-2 minutes

50,80, 104, 500, 800

Also just to confirm the following, do you have a SIM License enabled for the machine agent?

The only other reason you would get this behavior of the metric name registered but the values not is due to that server where the http listener is running not having a SIM license and value in controller-info.xml for sim-enabled is not set to true

 

Ciao



Found something helpful? Click the Accept as Solution button to help others find answers faster.
Liked something? Click the Thumbs Up button.

Learn more about me in the Community Member Spotlight Q & A