Stackify Java APM Annotations


License

License

Categories

Categories

Java Languages
GroupId

GroupId

com.stackify
ArtifactId

ArtifactId

stackify-java-apm-annot
Last Version

Last Version

1.0.6
Release Date

Release Date

Type

Type

jar
Description

Description

Stackify Java APM Annotations
Stackify Java APM Annotations
Project URL

Project URL

https://github.com/stackify/stackify-java-apm-annot
Project Organization

Project Organization

Stackify, LLC
Source Code Management

Source Code Management

https://github.com/stackify/stackify-java-apm-annot

Download stackify-java-apm-annot

How to add to project

<!-- https://jarcasting.com/artifacts/com.stackify/stackify-java-apm-annot/ -->
<dependency>
    <groupId>com.stackify</groupId>
    <artifactId>stackify-java-apm-annot</artifactId>
    <version>1.0.6</version>
</dependency>
// https://jarcasting.com/artifacts/com.stackify/stackify-java-apm-annot/
implementation 'com.stackify:stackify-java-apm-annot:1.0.6'
// https://jarcasting.com/artifacts/com.stackify/stackify-java-apm-annot/
implementation ("com.stackify:stackify-java-apm-annot:1.0.6")
'com.stackify:stackify-java-apm-annot:jar:1.0.6'
<dependency org="com.stackify" name="stackify-java-apm-annot" rev="1.0.6">
  <artifact name="stackify-java-apm-annot" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.stackify', module='stackify-java-apm-annot', version='1.0.6')
)
libraryDependencies += "com.stackify" % "stackify-java-apm-annot" % "1.0.6"
[com.stackify/stackify-java-apm-annot "1.0.6"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

stackify-java-apm-annot

Maven Central Build Status

@Trace Annotation for Stackify Java APM+

Stackify APM+ Overview:

http://support.stackify.com/agent-installation-overview/

Sign Up for a Trial:

http://www.stackify.com/sign-up/

Installation

Add it as a maven dependency:

<dependency>
    <groupId>com.stackify</groupId>
    <artifactId>stackify-java-apm-annot</artifactId>
    <version>INSERT_LATEST_MAVEN_CENTRAL_VERSION</version>
</dependency>

Usage

RUM Manual Instrumentation

Real User Monitoring (RUM) manual instrumentation allows you to specify where the RUM JavaScript block is injected.

It is recommended you provide a stackify-api.properties file in your application classpath with the following content:

stackify.application=My Application Name
stackify.environment=My Environment Name

Your application code will need to call out to the Stackify com.stackify.apm.Stackify.getRUMJavaScriptBlock() method in the <head> section as detailed below:

JSP Example

<html>
  <head> 
        <%= com.stackify.apm.Stackify.getRUMJavaScriptBlock() %>
        <script and link tags>
    </head>
    <body>
    ... 
    </body>
</html>

@Trace Annotation

Add custom instrumentation to classes using the @Trace annotation. The annotation needs to be added to the class and the method to be instrumented. This is an alternative to adding a custom configuration file (stackify-apm.json) to your application.

Tracked Functions

  • trackedFunction marks a specific method as a tracked function.
  • trackedFunctionName gives control over how the tracked function will be identified in the dashboard. The function name can be a String and can also include the variables {{ClassName}}, {{MethodName}} and {{MethodParameters[#]}} (where # is an int referencing the parameter index on the annotated method, index starts at 0).

Custom Trace Entry Point

Stackify by default generates traces from web-requests on supported application servers and non-web-requests from supported frameworks. You can extend support by using @Trace(start = true) on a method; which will start a new trace.

import com.stackify.apm.Trace;

@Trace
public class ClassToBeInstrumented 
{

    @Trace(start = true)
    public void methodToStartNewTrace()
    {
        ...
    }

    @Trace
    public void methodToBeInstrumented()
    {
        ...
    }
    
    @Trace
    public void anotherMethodToBeInstrumented()
    {
        ...
    }

    @Trace(trackedFunction = true, trackedFunctionName = "Tracked Function Identifier")
    public void anotherMethodToBeInstrumentedAndMarkedAsTrackedFunction()
    {
        ...
    }

    @Trace(trackedFunction = true, trackedFunctionName = "Tracked Function {{ClassName}} - {{MethodParameters[0]}}")
    public void anotherMethodToBeInstrumentedAndMarkedAsTrackedFunctionVariable(String value)
    {
        ...
    }

    public void notInstrumented()
    {
        ...
    }
}

License

Copyright 2017 Stackify, LLC.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

com.stackify

Stackify

Stackify helps developers manage and troubleshoot application problems with integrated monitoring, metrics, errors & logs.

Versions

Version
1.0.6
1.0.5
1.0.4
1.0.1
1.0.0