Skip to main content

Monitoring setup with nevisAppliance without nevisAdmin4

The monitoring nevisAppliance configured with OpenTelemetry agent can be used for logging Product Analytics metrics for the components.

See Software installation in the nevisAppliance documentation for image installation instructions.

Installation

OpenTelemetry agent

After successful nevisAppliance installation, the /opt/agent/opentelemetry-javaagent.jar can be used for the Open Telemetry agent jar's location.

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

By default, the OpenTelemetry agent is installed with the components, no extra configuration needed.

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