Dear Ivy Team

For REST logs (rest_client category), I would like to log the elapsed time as well as the amount of data transferred. Any tips how to configure IvyLog4jLayout ?

Best regards John

asked 03.02.2020 at 11:32

John%20Moser's gravatar image

John Moser
(suspended)
accept rate: 0%


Hi John

REST payload logs are currently limited to the features you already see in the designer. There is no summary of the content-length available when sending REST requests. But the content-length header of the response could contain valid sizes (if we're not receiving chuncked output).

What is possible today is to record request/response data via JMX api and use the visualvm plugin to detect slow services.

alt text

To enable request/response payload recording:

  • Install the 'MBean' plugin for visualvm
  • Reboot and open the VM of your engine
  • Switch to the 'MBean' tab
  • Navigate to 'IvyEngine' -> 'External REST WebService' -> 'YOURAPP' -> 'YourEnVIROMENT' -> 'YOURSERVICE'
  • set recordRequestResponse to true
  • consider raising maxEntityBytesToRecord as well

Then one could directly analyze slow calls in the slowestCall composite attribute view. Still there is no direct exposure of the payload size. But you can manually explore slowest calls....

link

answered 04.02.2020 at 06:31

Reguel%20Wermelinger's gravatar image

Reguel Werme... ♦♦
9.4k31958
accept rate: 70%

edited 04.02.2020 at 06:32

Thank you ... but (response here because I needed to add a pic)

  • I don't see the entry "External REST WebService"

alt text

link

answered 04.02.2020 at 08:00

John%20Moser's gravatar image

John Moser
(suspended)
accept rate: 0%

edited 04.02.2020 at 09:33

The External REST webservices will only be visible after the engine actually made any REST service calls (even if they call services on localhost). And as far as I remember also only on real engines - not on a Designer embedded engine.

(04.02.2020 at 08:14) Reguel Werme... ♦♦ Reguel%20Wermelinger's gravatar image

May be I have to make that clear - I am not speaking of the Designer (and will never do), I am talking about profiling in TEST and PROD.

(04.02.2020 at 08:52) John Moser John%20Moser's gravatar image

Ok but still, the node does not show up until any rest client calls have been made. And the visualVM UIs are sometimes a little weird. It can help to restart the visualVM and reconnect to the engine after you know that at least one 'rest call' has been invoked.

(04.02.2020 at 09:33) Reguel Werme... ♦♦ Reguel%20Wermelinger's gravatar image

Are only rest calls made with the Ivy Rest Client logged - what if someone used the Jax RS Client to make a rest call ?

Further I've installed the Axon.Ivy plugin in visualvm - there is a tab called "REST services". This also stays empty even though hundreds of calls have been made.

(05.02.2020 at 04:33) John Moser John%20Moser's gravatar image

All REST calls done via the officially documented ivy APIs are logged. To be precise:

  • ivyscript > ivy.rest.xyz,
  • java > Ivy.rest(),
  • proces -> Rest Client Call Activity

But not: plain JAX-RS/Jersey/HttpClient callls. If you have some of these I'd definitively recommend a migration towards the standard tooling of the platform. The main benefits of using the ivy.api are: highly configurable services + monitoring/logging capabilities.

In most cases a migration towards Ivy.rest() comes almost for free. The returned API is pretty soon standard JAX_RS. We only adjust the Client setup.

(05.02.2020 at 08:36) Reguel Werme... ♦♦ Reguel%20Wermelinger's gravatar image

The 'rest services' tab relies upon the same JMX API that is exposed in the 'Mbeans' tab. It comes with some nice visualizations but with less configuration options. But yes, if a REST call has been made using the standard approach of the platform it should be shown in the 'rest services' tab.

However, I think you are already on the right investigation path - some other technology has been used to call REST services.

(05.02.2020 at 08:47) Reguel Werme... ♦♦ Reguel%20Wermelinger's gravatar image
showing 5 of 6 show 1 more comments
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×147
×28

Asked: 03.02.2020 at 11:32

Seen: 1,798 times

Last updated: 05.02.2020 at 09:11