This project provides a JAR file that can be used to integrate your Java applications with FluxNinja Aperture.
Supported technologies:
| Framework | Supported versions |
|---|---|
| Armeria | 1.15+ |
| Netty | 4.1+ |
Jar of the java agent can be built from aperture-java root directory, using the following command:
./gradlew javaagent:agent:shadowJar
The resulting jar can be found in the aperture-java/javaagent/agent/build/libs
directory.
To statically load the java agent when running some application jar, use the following command:
java -javaagent:path/to/javaagent.jar -jar path/to/application.jar
Aperture Java Instrumentation Agent can be configured using a properties file, system properties or environment variables:
| Property name | Environment variable name | Default value | Description |
|---|---|---|---|
| aperture.javaagent.config.file | APERTURE_JAVAAGENT_CONFIG_FILE | Path to a file containing configuration properties | |
| aperture.agent.address | APERTURE_AGENT_ADDRESS | localhost:8080 | Address of Aperture Agent to connect to |
| aperture.api.key | APERTURE_API_KEY | API Key to connect with FluxNinja Cloud Agent | |
| aperture.control.point.name | APERTURE_CONTROL_POINT_NAME | (Required) Name of the control point this agent represents | |
| aperture.javaagent.enable.ramp.mode | APERTURE_JAVAAGENT_ENABLE_RAMP_MODE | false | Sets the ramp mode of flows started by the client. If set to true, all flows will require at least one ramp component to accept them. |
| aperture.javaagent.insecure.grpc | APERTURE_JAVAAGENT_INSECURE_GRPC | true | Whether gRPC connection to Aperture Agent should be over plaintext |
| aperture.javaagent.root.certificate | APERTURE_JAVAAGENT_ROOT_CERTIFICATE | Path to a file containing root certificate to be used (insecure connection must be disabled) |
|
| aperture.connection.timeout.millis | APERTURE_CONNECTION_TIMEOUT_MILLIS | 1000 | Aperture Agent connection timeout in milliseconds |
| aperture.javaagent.ignored.paths | APERTURE_JAVAAGENT_IGNORED_PATHS | Comma-separated list of paths that should not start a flow | |
| aperture.javaagent.ignored.paths.regex | APERTURE_JAVAAGENT_IGNORED_PATHS_REGEX | Whether the configured ignored paths should be read as regular expressions |
The priority order is system.property > ENV_VARIABLE > properties file.
Example invocation with commandline-set properties:
java -javaagent:path/to/javaagent.jar \
-Daperture.agent.address="ORGANIZATION.app.fluxninja.com:443" \
-Daperture.api,key="API_KEY" \
-Daperture.control.point.name="awesomeFeature" \
-Daperture.javaagent.ignored.paths="/healthz,/connected" \
-jar path/to/application.jarExample invocation using a properties file:
java -javaagent:path/to/javaagent.jar \
-Daperture.javaagent.config.file="/config.properties" \
-jar path/to/application.jarThe /config.properties file:
aperture.agent.address=ORGANIZATION.app.fluxninja.com:443
aperture.api.key=API_KEY
aperture.control.point.name=awesomeFeature
aperture.javaagent.ignored.paths=/healthz,/connected