Skip to content

Add Ruxit agent framework for monitoring #278

Closed
aloismayr wants to merge 2 commits intocloudfoundry:masterfrom
aloismayr:master
Closed

Add Ruxit agent framework for monitoring #278
aloismayr wants to merge 2 commits intocloudfoundry:masterfrom
aloismayr:master

Conversation

@aloismayr
Copy link
Contributor

This PR adds support for Ruxit monitoring to CF Java apps and includes docs, tests and config. It requires a ´ruxit´ service being bound to an app in order to add the Ruxit agent to JAVA_OPTS agentpath parameter. The default repository points to download.ruxit.com and is maintained by Dynatrace/Ruxit.
The CLA will be in Ben Hale's inbox today.

Alois Mayr added 2 commits March 5, 2016 10:53
Initial Ruxit integration

Initial Ruxit integration

Optional server parameter in credentials; Loop through RUXIT_* environment variables

Loop though RUXIT_* environment variables

Handling 'agent_repo_url' and 'agent_download_url' parameters

Map CF_INSTANCE_ID to RUXIT_NODE_ID

Use JBP_CONFIG_RUXIT_AGENT instead of own parameter

Remove RUXIT_NODE_ID, Add RUXIT_HOST_ID

Copyright updates

This change updates the copyright statements to 2016.

Container Certificate Trust Store

This change adds a framework that provides a Java trust store containing the
certificates trusted by the container's operating system.  This feature is
disabled by default, as it requires around 45 seconds to process the 173
default certificates.

[#76531562]

Build updates

This change updates the versions of Ruby that the buildpack is tested
against.

Added documentation Ruxit Agent

Update copyright year

Moved repository_root to download.ruxit.com

Removed agent_download_url parameter

Extension point for supplying an external Tomcat configuration

Update copyright headers

This change updates some more copyright headers that were missed the first
time around.

Improve diagnostics for invalid YAML syntax in configuration

[#111019418]

Eliminate invalid repository

Previously the empty placeholder repository root in the Tomcat configuration
was causing problems packaging the build.  This change updates the
configuration to eliminate that invalid repository.

[#114694789]

Detect Spring Boot Application via Manifest

Previously, the only way to determine a Spring Boot application was to inspect
the filesystem looking for a specific JAR file.  This change will make the
first check the parsing of the application's manifest which should improve
performance.

[#114795971]

Improve suspend documentation to include -u none

This change updates the documentation with some sage advice.

[resolves #276]

Link Spring Boot addition libs

Previously Spring Boot applications were provided with additional libs via a
classpath declaration.  Work done on Spring Boot 1.4 make this stop working.
The new solution is to symlink the libs to one of the lib directories in the
application.

[#114796053]

BOOT-INF/lib

This change causes Spring Boot additional libs to be symlinked to BOOT-INF if
it exists.

[#114796085]

Read Spring Boot Lib dir from manifest

This change updates the Spring Boot lib directory detection algorithm to read
from the manifest if an entry is provided.

[#114796139]

Copyright year to 2016 and minor doc changes
@cfdreddbot
Copy link

Hey aloismayr!

Thanks for submitting this pull request!

All pull request authors must have a Contributor License Agreement (CLA) on-file with us. Please sign the appropriate CLA (individual or corporate).

When sending signed CLA please provide your github username in case of individual CLA or the list of github usernames that can make pull requests on behalf of your organization.

If you are confident that you're covered under a Corporate CLA, please make sure you've publicized your membership in the appropriate Github Org, per these instructions.

@testobsessed
Copy link

 Code Climate has analyzed this pull request.

@nebhale
Copy link
Contributor

nebhale commented Mar 7, 2016

@aloismayr Can you give me some insight into the contents of the agent ZIP file? I'm looking for an explanation of what is in the bin/ directory, but I'd like to get a better idea all the way around.

nebhale pushed a commit that referenced this pull request Mar 7, 2016
This change adds support for the Ruxit APM agent.
[#278]
@nebhale
Copy link
Contributor

nebhale commented Mar 7, 2016

I'd also like a pointer to some documentation on how the agent is configured if you can provide that as well.

@aloismayr
Copy link
Contributor Author

@nebhale You can take a look into this ZIP file http://download.ruxit.com/agent/paas/unix/java/ruxit-Agent-Linux-1.87.124.zip
The lib and lib64 directories contain the loader for the agent and some native code that we use to instrument the process. In bin there is the part of the agent that is specifically tied to Java.

@nebhale
Copy link
Contributor

nebhale commented Mar 7, 2016

Yeah, I've take a look at the internals of the ZIP file, which is why I wanted a deeper understanding of what exactly each piece was used for. Specifically, it appears that the -javaagent only refers to one of the .sos, so I wanted to understand what the 1.2M ZIP file in /bin was used for.

@aloismayr
Copy link
Contributor Author

The part in /bin covers things like monitoring JVM memory metrics, JMX metrics, etc. and is being loaded by either the lib or the lib64 so.

@nebhale
Copy link
Contributor

nebhale commented Mar 7, 2016

How does the lib determine the location of those things? Is it relative to a working directory or relative to the library itself? Also, you've exposed some configuration via environment variables. Is there any documentation for the values that can be configuring using that strategy?

@aloismayr
Copy link
Contributor Author

The libraries in lib determine the location of those things by relative paths to the library itself, plus the information in conf/binaries.json to get the right managed and native parts. Our CI makes sure a single ZIP bundle is self-contained and valid so that the loader can find those things.

In CF we make use of three environment variables to specify the names of some entities which otherwise the agent would determine and set automatically.

RUXIT_APPLICATIONID is name of the webapplication (in case it is a web application, otherwise this will be ignored). This usually is auto-detected but we set this to application_name. Refer https://help.ruxit.com/pages/viewpage.action?pageId=18612610

RUXIT_CLUSTER_ID is the name of the process group. Ruxit groups similar processes that belong to the same application/services and type, e.g., 4 tomcats running the same services would be grouped to one process group. Again, this usually is auto-detected but for CF we set this to the application_name as this matches our model of process groups. In case you do a cf scale APP_NAME -i 4 all the 4 app-instances would belong to the same process group. Refer https://help.ruxit.com/pages/viewpage.action?pageId=8061067

RUXIT_HOST_ID overrides the detected hostname in Ruxit. In CF this normally is the name of the Garden container the app instance is running in but the container name isn't meaningful to humans.

@nebhale
Copy link
Contributor

nebhale commented Mar 10, 2016

@aloismayr Still looking this over. Just wanted to let you know that I haven't forgotten.

@nebhale
Copy link
Contributor

nebhale commented Mar 10, 2016

@aloismayr Is there documentation for the agentpath configuration arguments?

@nebhale
Copy link
Contributor

nebhale commented Mar 10, 2016

@aloismayr Also, this documentation seems to indicate that we might want RUXIT_NODE_ID instead of RUXIT_HOST_ID. What are thoughts on this?

@aloismayr
Copy link
Contributor Author

@nebhale No worries! There is no other documentation for agentpath parameter than in the buildpack's docs. Normally, Ruxit users don't need to deal with that.

server is the endpoint the agent reports data to.
tenant is the customer's environment id.
tenanttoken is the secret needed to report data to the environment.

@aloismayr
Copy link
Contributor Author

@nebhale RUXIT_NODE_ID can be used to separate processes. This is not suitable for CF environments since there is only a single process (of a specific type, e.g. tomcat) running in a Garden. We want to use RUXIT_HOST_ID to give our "virtual" host entity a meaningful name, otherwise the container name would be taken.

@nebhale
Copy link
Contributor

nebhale commented Mar 10, 2016

Sounds good. Since I can't find any mention of RUXIT_HOST_ID, I just wanted to confirm.

nebhale pushed a commit that referenced this pull request Mar 10, 2016
This change adds support for the Ruxit APM agent.
[#278]
@nebhale nebhale closed this in 6983542 Mar 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants