Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Tip

When the application is up and running and the Sealights Listener agent configured, you can it is properly running from the Cockpit -> Agent Monitor screen.
You also have the ability to validate the JVM parameters in use with your application via the following command

  • Linux:  ps -ef | grep java

  • Windows: Get-CimInstance Win32_Process | Where-Object { $_.Name -like '*java*' } | Select-Object CommandLine, ProcessId (Powershell)

    • CMD Promt: C:\\Windows\\System32\\wbem\\WMIC.exe process where "name like '%java%'" get commandline,processid

    (CMD prompt)
Warning

If the agent does not appear in the Cockpit Agent Monitor when your application is up and running, you can turn on the logging of the Sealights agent by adding one or both of the following parameters:

  • Console Output: -Dsl.log.level=info -Dsl.log.toConsole=true

  • File Output: -Dsl.log.level=info -Dsl.log.toFile=true -Dsl.log.folder=<path/to/folder/with/writing/permissions/>

More details about these parameters are detailed in a dedicated documentation section https://sealights.atlassian.net/wiki/spaces/SUP/pages/1933323/SeaLights+Java+agent+-+Command+Reference#Logging

...

Kubernetes using an Init container

In the sample Yaml YAML file below, we dynamically download the agent into a side car sidecar container to make it available to the JVM of our application container

...

. We’re using a lightweight base image that contains wget and unzip.

Code Block
languageyaml
spec:
  initContainers:
  - name: sealights-java-cdcoverage-agentlistener
    image: busyboxalpine:latest
    imagePullPolicy: IfNotPresent
    command: ["/bin/sh", "-c"]
    args:
      - |
        wget -nv -O /tmp/sealights-java-agents.zip https://agents.sealights.co/sealights-java/sealights-java-latest.zip;
 
      mkdir -p /sealights;
        unzip -j /tmp/sealights-java-agents.zip sl-test-listener.jar -d /sealights;
    volumeMounts:
      - mountPath: /sealights
        name: sealights-java-coverageagent-listenerfile
  containers:
  - name: your-app-mainservice-container
    # other container configurations
    env:
    - name: sl.tagsJAVA_TOOL_OPTIONS
      value: k8s
    - name: sl.labId
      value: integ_test_microservices
    - name: JAVA_TOOL_OPTIONS
      value: -"-javaagent:/sealights/sl-test-listener.jar -Dsl.labId={{ .Values.SealightsEnvVars.lab_id }} -Dsl.tags=k8s"
    volumeMounts:
    - mountPath: /sealights
      name: sealights-java-coverageagent-listenerfile
  volumes:
    - name: sealights-java-coverageagent-listenerfile
      emptyDir: {}

JBoss & Wildfly

...