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

Example for adding OpenTelemetry Agent to JS7 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.

Example for JS7 Agent Java Options used with 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

Example for adding OpenTelemetry Agent to JS7 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.

Example for JS7 Controller Java Options used with 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

Example for adding OpenTelemetry Agent to JS7 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.

Example for JS7 JOC Cockpit Java Options used with 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.

Example for OpenTelemetry Collector config.yml configuratin file
extensions:
  health_check:

receivers:
  otlp:
    protocols:
      grpc:
        endpoint: 0.0.0.0:4317
      http:
        endpoint: 0.0.0.0:4318

processors:
  filter/memory_only:
    metrics:
      include:
        match_type: strict
        metric_names:
          - jvm.memory.used
          - jvm.memory.committed
          - jvm.memory.max
          - jvm.memory.pool.capacity
          - jvm.memory.pool.used
          - jvm.memory.pool.committed
          - jvm.memory.pool.max
          - jvm.gc.pause
          - jvm.gc.memory.allocated
          - jvm.gc.memory.promoted
          - jvm.gc.live.data.size
          - jvm.gc.max.data.size
          - jvm.gc.collection.count
          - jvm.gc.collection.time
          - jvm.memory.pool.name
          - jvm.memory.pool.type
          - jvm.gc.count
          - jvm.gc.time
          - jvm.gc.pause.time
          - jvm.memory.init
          - jvm.memory.pool.init
          - process.memory.rss
          - process.memory.virtual

  filter/js7_sit_joc_primary:
    metrics:
      include:
        match_type: strict
        resource_attributes:
          - key: service.instance.id
            value: js7_sit_joc_primary_testsuite

  filter/js7_sit_controller_primary:
    metrics:
      include:
        match_type: strict
        resource_attributes:
          - key: service.instance.id
            value: js7_sit_controller_primary_testsuite

  filter/js7_sit_agent_primary:
    metrics:
      include:
        match_type: strict
        resource_attributes:
          - key: service.instance.id
            value: js7_sit_agent_primary_testsuite

exporters:
  prometheus:
    endpoint: "0.0.0.0:9091"

  debug:
    verbosity: detailed

service:
  extensions: [health_check]
  pipelines:
    metrics/js7_sit_joc_primary:
      receivers: [otlp]
      processors: [filter/js7_sit_joc_primary]
      exporters: [prometheus]

    metrics/js7_sit_controller_primary:
      receivers: [otlp]
      processors: [filter/memory_only, filter/js7_sit_controller_primary]
      exporters: [prometheus]

    metrics/js7_sit_agent_primary:
      receivers: [otlp]
      processors: [filter/memory_only, filter/js7_sit_agent_primary]
      exporters: [prometheus]

Resources


  • No labels