Skip to main content

Monitoring setup on Supported systems without nevisAdmin4

Product Analytics metrics can be viewed on VM using OpenTelemetry agent without using nevisAdmin 4.

Installation

OpenTelemetry agent

Download nevis-opentelemetry-javaagent-<version>.jar from the Nevis portal and save it as /opt/agent/opentelemetry-javaagent.jar

Create the otel.properties file under /var/opt/<service-name>/default/conf in each component.

otel.service.name = <service-name>
otel.traces.exporter = none
otel.metrics.exporter = none
otel.logs.exporter = none

For Java based components, to use the OpenTelemetry agent, extend the JAVA_OPS of the relevant component with:

JAVA_OPTS=(
"-javaagent:/opt/agent/opentelemetry-javaagent.jar"
"-Dotel.javaagent.logging=application"
"-Dotel.javaagent.configuration-file=/var/opt/<service-name>/default/conf/otel.properties"
"-Dotel.resource.attributes=service.version=<version>,service.instance.id=<intanceId>"
)

where

  • service-name: Name of the service, e.g.: nevisidm
  • version: Version of the service, e.g.: 1.0
  • intanceId: Name of the instance, such as idm-dev

Product Analytic Logger

To enable writing metrics, a new logger must be introduced. In the logging.yml add the following new logger for each component:

  Loggers:
Logger:
- name: "ProductAnalytics"
level: "INFO"

Example logging.yml file for nevisAuth:

Configuration:
monitorInterval: 60
Appenders:
RollingFile:
- name: "SERVER"
fileName: "log/esauth4sv.log"
filePattern: "log/esauth4sv.log.%i"
PatternLayout:
pattern: "%d{ISO8601} %-15.15t %mdc{trace_id} %mdc{span_id} %-20.20c %-5.5p %m%n"
Policies:
SizeBasedTriggeringPolicy:
size: "100 MB"
DefaultRolloverStrategy:
max: "9"
Loggers:
Logger:
- name: "ProductAnalytics"
level: "INFO"
- name: "EsAuthStart"
level: "INFO"
- name: "org.apache.catalina.loader.WebappClassLoader"
level: "FATAL"
- name: "org.apache.catalina.startup.HostConfig"
level: "ERROR"
- name: "ch.nevis.esauth.events"
level: "FATAL"
Root:
level: "WARN"
additivity: "false"
AppenderRef:
- ref: "SERVER"

Reading Product Analytics log files

The ProductAnalytics logs can be collected from the components' VMs. Every component creates their product analytics log file under the container's log or logs directory. Here is an example to retrieve the file in the nevisIdm component:

cat <path-to-log-dir>/<service-name>-nevis-product-analytics.jsonl

where

  • path-to-log-dir: Path of the log directory, e.g.: /var/opt/nevisidm/idm/log/
  • service-name: Name of the service, e.g.: nevisidm
caution

The ProductAnalytics metrics are logged in every 24 hours to the <service-name>-nevis-product-analytics.jsonl