Add app monitoring agent framework in custom buildpack


Swatz bosh
 

Hello,

I have a custom buildpack of my software and and I want to use NewRelic/CA Wily agent frameworks which is added in java-buildpack [1].
So may I know what all components of these agents I can reuse from java-buildpack? I found that these agents are written in Ruby, so can I reuse them in my buildpack which is on java?

[1] https://github.com/cloudfoundry/java-buildpack/blob/master/lib/java_buildpack/framework/new_relic_agent.rb


Thanks


Christopher Frost
 

Hi,

The Java Buildpack is under the Apache License so you can reuse the code as
you like but obviously you will need to rewrite it from Ruby to Java if
your buildpack is written in Java. The steps you will need to go through to
get New Relic or Wily working will be very similar regardless of the
language the buildpack is written in.


Christopher Frost - Pivotal UK
Java Buildpack Team

On Thu, Sep 10, 2015 at 9:07 AM, Swatz bosh <swatzron(a)gmail.com> wrote:

Hello,

I have a custom buildpack of my software and and I want to use NewRelic/CA
Wily agent frameworks which is added in java-buildpack [1].
So may I know what all components of these agents I can reuse from
java-buildpack? I found that these agents are written in Ruby, so can I
reuse them in my buildpack which is on java?

[1]
https://github.com/cloudfoundry/java-buildpack/blob/master/lib/java_buildpack/framework/new_relic_agent.rb


Thanks


Swatz bosh
 

Hi,

To add NewRelic agent jar, I did below modifications in my custom buildpack-

1. bin/compile - inside compile I am downloading agent jar and copying it inside APP_DIRECTORY/newrelic-agent/agent.jar

2. bin/release - inside release I am doing below to add JAVA_OPTS by adding system param and path to above agent jar

default_process_types:
web: export APPDIR=$HOME/app; export JAVA_OPTS=${JAVA_OPTS} -javaagent:/tmp/staged/app/new-relic-agent/new-relic-3.14.0.jar -Dnewrelic.home:homename -Dnewrelic.config.license_key:xxaaaayyy -Dnewrelic.config.app_name=app1 -Dnewrelic.config.log_file_path=STDOUT; ./prestart.sh; ./home/a*/*/bin/startAppNode.sh


So do you think its a good approach? or do I need to try differently to add newRelic agent in my custom buildpack written in java.

Thanks


Etourneau Gwenn
 

Why not sharing the code of your buildpack on github ?
Btw the java buildpack support new relic you can check here https://github.com/cloudfoundry/java-buildpack/blob/master/docs/framework-new_relic_agent.md

Thanks

Envoyé de mon iPhone

Le 18 sept. 2015 à 15:01, Swatz bosh <swatzron(a)gmail.com> a écrit :

Hi,

To add NewRelic agent jar, I did below modifications in my custom buildpack-

1. bin/compile - inside compile I am downloading agent jar and copying it inside APP_DIRECTORY/newrelic-agent/agent.jar

2. bin/release - inside release I am doing below to add JAVA_OPTS by adding system param and path to above agent jar

default_process_types:
web: export APPDIR=$HOME/app; export JAVA_OPTS=${JAVA_OPTS} -javaagent:/tmp/staged/app/new-relic-agent/new-relic-3.14.0.jar -Dnewrelic.home:homename -Dnewrelic.config.license_key:xxaaaayyy -Dnewrelic.config.app_name=app1 -Dnewrelic.config.log_file_path=STDOUT; ./prestart.sh; ./home/a*/*/bin/startAppNode.sh


So do you think its a good approach? or do I need to try differently to add newRelic agent in my custom buildpack written in java.

Thanks


Swatz bosh
 

Sorry I can't share right now.

I know java-buildpack has frameworks for multiple such agents which also include newrelic, but its in Ruby and my custom buildpack is in java and am not looking for a generic framework right now, but a quick way to include newrelic agent jar inside my buildpack,
I tried approaching it by below code change in compile and release files of my buildpack as you can see, but I would like to know is it a correct approach ?? or I need to take care someother changes for including such newrelic agent.

1. bin/compile - inside compile I am downloading agent jar and copying it inside APP_DIRECTORY/newrelic-agent/agent.jar

2. bin/release - inside release I am doing below to add JAVA_OPTS by adding system param and path to above agent jar

default_process_types:
web: export APPDIR=$HOME/app; export JAVA_OPTS=${JAVA_OPTS} -javaagent:/tmp/staged/app/new-relic-agent/new-relic-3.14.0.jar -Dnewrelic.home:homename -Dnewrelic.config.license_key:xxaaaayyy -Dnewrelic.config.app_name=app1 -Dnewrelic.config.log_file_path=STDOUT; ./prestart.sh; ./home/a*/*/bin/startAppNode.sh


Swatz bosh
 

Can someone please help me on above query ?


Swatz bosh
 

Request someone to look on my above query please ?


Swatz bosh
 

Still waiting for your comments.

Thanks