javamelody / jira-confluence-javamelody

JavaMelody plugin for JIRA, Confluence or Bamboo
Apache License 2.0
12 stars 6 forks source link

RUM does not work in JIRA & Confluence #6

Open evernat opened 4 years ago

evernat commented 4 years ago

In Atlassian marketplace, a user said in reviews:

Good plugin. I'm most likely doing something wrong but, having upgraded to 1.67 to make use of Real User Monitoring, I can't find these metrics anywhere in the monitoring webpage? I've enabled it via JVM parameter -Djavamelody.rum-enabled=true. Any ideas?

When adding the JVM parameter -Djavamelody.rum-enabled=true in JIRA or Confluence and after using some pages of JIRA or Confluence, RUM (Real User Monitoring) is supposed to be displayed in the request detail pages with Network, Server execution, DOM processing and Page rendering. (Doc). But it is not displayed.

evernat commented 4 years ago

That is because the html pages are gzipped by JIRA or Confluence before being seen by the javamelody monitoring filter, so the javamelody monitoring filter don't see where to inject the javascript for RUM.

It could be fixed by putting the javamelody monitoring filter between html generation and the gzip compression filter of JIRA / Confluence, so that the RUM javascript can be injected in the html page. That is by changing location="after-encoding" weight="1" to location="before-decoration" weight="200" in atlassian-plugin.xml. But it would break the access to the monitoring page in Bitbucket.

So the workaround is to disable (gzip) compression of http responses in the General configuration in the menu of JIRA or Confluence, then the JVM parameter -Djavamelody.rum-enabled=true will work. But it would increase bandwidth usage (http responses will not be compressed anymore).