Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Can I use javaMelody in Stash ?

Flavio Beck December 9, 2014

I have Javameldy installed for JIRA and Confleunce. It is working fine!

Should be possible to install it in STASH as well ?

is there some install guide?

1 answer

2 votes
Johannes Kilian
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 9, 2014

Short answer: yes you can.

What I did: (found in some tutorials)

  • copied the following files to %STASH_HOME%\atlassian-stash\WEB-INF\lib\:
    • itext-2.1.7.jar (for creating PDF-reports)
    • javamelody.jar
    • jrobin-1.5.9.1.jar
  • added the following to file %STASH_HOME%\atlassian-stash\WEB-INF\web.xml

     

 

<webapp>
       ....
        <filter>
            <filter-name>monitoring</filter-name>
            <filter-class>net.bull.javamelody.MonitoringFilter</filter-class>
        </filter>
        <filter-mapping>
            <filter-name>monitoring</filter-name>
            <url-pattern>/*</url-pattern>
        </filter-mapping>
        <listener>
            <listener-class>net.bull.javamelody.SessionListener</listener-class>
        </listener>
 
</weppapp>

 

  • Restarted STASH

Thats's it - at least this works for me wink

 

Hope that helps

Flavio Beck December 11, 2014

I will test this solution, and add an update here next week! Thank you,

binary January 16, 2015

First of all thank you very much :) . you saved big amount of time for me. I am already using Java-melody with Bamboo. for bamboo I was using only javamelody.jar file, and it was working fine. When I tried to follow same steps for Stash, it didn't work. I just updated web.xml file in addition to javamelody.jar file and it is working for Stash too. I think you don't need itext jar file. I can see PDF output without using that.

Jim Bethancourt
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 24, 2016

Be careful with this approach.  It caused connectivity issues for us and we weren't able to create new repository definitions in Bamboo among other issues.  Test, test, test in a sandbox environment if at all possible.

Johannes Kilian
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 24, 2016

@Jim Bethancourt: We use this approach for a long time now - and we have not seen any issues yet. But we just useBitbucket and JIRA - no Bamboo, though....

Azfar_Masut October 16, 2017

In 5.3.x, there are no longer web.xml exist. Anyone have a solution on how to add the properties value?

 

Thanks in advance!

Douglas Gnoato
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 18, 2017

Disclaimer

The implementation of the Java Melody into Bitbucket is considered a customization. Customizations are out of our support scope as can seen in our Atlassian Support Offerings. Atlassian does not provide support for this integration or any other 3rd-party monitoring integration.

Yes, it possible to integrate Java Melody with Bitbucket 5.X. The process is a bit different from the previous versions and worked on our tests. Below are all the details.

  1.  Download (we used wget) the JavaMelody add on to the $BITBUCKET_HOME/shared/plugins/installed-plugins/. Note: This is the one from the marketplace listing JavaMelody Monitoring plugin, which appears to be non-compatible with Bitbucket Server (but it worked on our tests).
wget https://github.com/javamelody/jira-confluence-javamelody/releases/download/1.69.0/jira-confluence-javamelody-1.69.0.jar

      2.  Stop Bitbucket's service
      3.  Add the following to the bitbucket.properties file:

# Enable JavaMelody auto-configuration (optional, default: true)
javamelody.enabled=true
# Disable monitoring of Spring services and controllers (optional, default: true) - this is not allowed by Bitbucket Server itself and it would not have any effect if set to true
javamelody.spring-monitoring-enabled=false
# Initialization parameters for JavaMelody (optional)
# See: https://github.com/javamelody/javamelody/wiki/UserGuide#6-optional-parameters
# log http requests
javamelody.init-parameters.log=true

      4.  Start Bitbucket's service
      5.  Browse to <Bitbucket_URL>/monitoring to get access to the JavaMelody console

*Notes*
- Only Memory, CPU and Http sessions will be tracked;
- Bitbucket does not allow specifying a DataSource via JNDI, so it won't possible to get any SQL monitoring;
- It's be possible for JavaMelody, when loaded from a plugin, to interact with the host application's Spring underpinnings -> That's why we recommend setting javamelody.spring-monitoring-enabled=false
- javamelody.excluded-datasources=secretSource,topSecretSource can't be used either, since JNDI is not allowed.

Hope that helps

Like Fabio Manzoni likes this
Emeric Vernat
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 11, 2018

Thanks Douglas for tests and the process.

There were a few problems with that process:

  • The given version of the plugin is now obsolete.
  • javamelody.enabled, javamelody.spring-monitoring-enabled and javamelody.init-parameters.log are only for the javamelody spring-boot-starter and does nothing when using the plugin.
  • There is no warning that the access to the monitoring page is not restricted in Bitbucket unlike in JIRA/Confluence/Bamboo.

So, there is now an official process to install the javamelody plugin in Bitbucket and it is declared compatible with Bitbucket in the marketplace: https://github.com/javamelody/javamelody/wiki/AtlassianPlugin#Bitbucket

And I would like to improve the plugin by importing a Spring post-processor for the datasource (to monitor jdbc connections and SQL requests) and also by getting the current authenticated user if any from the plugin's filter.

I have started a new discussion for that.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events