Introduction
The JS7 Controller and Agent offer JS7 - Metrics for ongoing monitoring.
Metrics can be integrated with OpenTelemetry and optionally with Prometheus, and can be visualized from JS7 - Dashboards with Grafana.
- Integration includes to
- make Controller and Agents report telemetry data to an OpenTelemetry server.
- allow Prometheus scraping telemetry data from the
/metrics
endpoint offered by the OpenTelemetry server.
- This suggest a secure approach that does not allow connections to the network zone of Controller and Agents but from Conntroller and Agents only.
- Alternatively, users can consider a straightforward proceeding to integrate using JS7 - Metrics with Prometheus that directly scrapes the
/metrics
endpoint offered by Controller and Agents which works without use of OpenTelemetry..
FEATURE AVAILABILITY STARTING FROM RELEASE 2.8.1
JS7 Product Configuration
For integration with OpenTelemetry the JS7 products have to add the opentelemetry-javaagent.jar
file to their classpath. The file does not ship with JS7. Users can download the file from OpenTelemetry releases available from https://github.com/open-telemetry/opentelemetry-collector-releases/releases.
In addition, a number of Java options must be specified to select metrics and to identify the JS7 product instance. Find details how to apply Java options from the JS7 - How To - Apply Java Options article.
Agent
# On-premises installation: copy OpenTelemetry Agent .jar file to JS7 Agent classpath cp opentelemetry-javaagent.jar /opt/sos-berlin.com/js7/agent/lib/user_lib/ # On-cloud container: copy OpenTelemetry Agent .jar file to JS7 Agent classpath cp opentelemetry-javaagent.jar /var/sos-berlin.com/js7/agent/var_4445/config/lib/
Explanations:
- Locations are different if the JS7 Agent is operated on-premises or from a container.
- For container operation typically the
/var/sos-berlin.com/js7/agent/var_4445
directory is mounted and is accessible from a volume.
The following Java options represent a minimum. Users should check the OpenTelemetry documentation how to configure the OpenTelemetry Agent.
JAVA_OPTIONS="$JAVA_OPTIONS -javaagent:/opt/sos-berlin.com/js7/agent/lib/user_lib/opentelemetry-javaagent.jar \ -Dotel.traces.exporter=none \ -Dotel.logs.exporter=none \ -Dotel.metrics.exporter=otlp \ -Dotel.exporter.otlp.endpoint=http://otel-collector:4318 \ -Dotel.instrumentation.jvm-metrics.enabled=true \ -Dotel.instrumentation.runtime-metrics.enabled=true \ -Dotel.resource.attributes=service.name=js7_sit_agent_primary,service.instance.id=js7_sit_agent_primary_testsuite \ -Xshare:off"
Explanations:
- Line 1: specifies the location of the
opentelemetry-javaagent.jar
file. - Line 2-4: follow a number of standard options.
- Line 5: specifies the OpenTelemetry Collector endpoint from its protocol, host and port.
- Line 6-7: specifies the metrics that will be forwarded to OpenTelemetry Collector.
- Line 8: specifies the service.name and service.instance.id that identify the related JS7 Agent instance.
- Line 9: disables Java Class Data Sharing which is required by the OpenTelemetry Agent.
Controller
# On-premises installation: copy OpenTelemetry Agent .jar file to JS7 Controller classpath cp opentelemetry-javaagent.jar /opt/sos-berlin.com/js7/controller/lib/user_lib/ # On-cloud container: copy OpenTelemetry Agent .jar file to JS7 Controller classpath cp opentelemetry-javaagent.jar /var/sos-berlin.com/js7/controller/var/config/lib/
Explanations:
- Locations are different if the JS7 Controller is operated on-premises or from a container.
- For container operation typically the
/var/sos-berlin.com/js7/controller/var
directory is mounted and is accessible from a volume.
The following Java options represent a minimum. Users should check the OpenTelemetry documentation how to configure the OpenTelemetry Agent.
JAVA_OPTIONS="$JAVA_OPTIONS -javaagent:/opt/sos-berlin.com/js7/controller/lib/user_lib/opentelemetry-javaagent.jar \ -Dotel.traces.exporter=none \ -Dotel.logs.exporter=none \ -Dotel.metrics.exporter=otlp \ -Dotel.exporter.otlp.endpoint=http://otel-collector:4318 \ -Dotel.instrumentation.jvm-metrics.enabled=true \ -Dotel.instrumentation.runtime-metrics.enabled=true \ -Dotel.resource.attributes=service.name=js7_sit_controller_primary,service.instance.id=js7_sit_controller_primary_testsuite \ -Xshare:off"
Explanations are the same as for the JS7 Agent.
JOC Cockpit
# On-premises installation: copy OpenTelemetry Agent .jar file to JS7 JOC Cockpit classpath cp opentelemetry-javaagent.jar /opt/sos-berlin.com/js7/joc/lib/user_lib/ # On-cloud container: copy OpenTelemetry Agent .jar file to JS7 Agent classpath cp opentelemetry-javaagent.jar /var/sos-berlin.com/js7/joc/resources/
Explanations:
- Locations are different if the JS7 JOC Cockpit is operated on-premises or from a container.
- For container operation typically the
/var/sos-berlin.com/js7/joc/jetty_base/resources
directory is mounted and is accessible from a volume.
The following Java options represent a minimum. Users should check the OpenTelemetry documentation how to configure the OpenTelemetry Agent.
JAVA_OPTIONS="$JAVA_OPTIONS -javaagent:/opt/sos-berlin.com/js7/joc/lib/user_lib/opentelemetry-javaagent.jar \ -Dotel.traces.exporter=none \ -Dotel.logs.exporter=none \ -Dotel.metrics.exporter=otlp \ -Dotel.exporter.otlp.endpoint=http://otel-collector:4318 \ -Dotel.instrumentation.jvm-metrics.enabled=true \ -Dotel.instrumentation.runtime-metrics.enabled=true \ -Dotel.instrumentation.jetty.enabled=true \ -Dotel.instrumentation.hibernate.enabled=true \ -Dotel.instrumentation.hikaricp.enabled=true \ -Dotel.resource.attributes=service.name=js7_sit_joc_primary,service.instance.id=js7_sit_joc_primary_testsuite \ -Xshare:off"
Explanations are the same as for the JS7 Agent.
OpenTelemetry Collector Configuration
The following example represents a possible way how to configure the Collector. There's more than one way. Users should check the OpenTelemetry documentation how to configure the Collector.