JS Generic Event Processor

The JavaScript Generic Event Processor microservice enriches and processes of custom JavaScript rules-based events and forwards them down the Event pipeline to an output topic, which is generally on subscribed to by the Event Sink microservice.

This microservice is part of the Event microservice pipeline. See Understanding the Event Pipeline in Unified Assurance Concepts for conceptual information.

The microservice currently exposes ECMAScript 2025 support through the GraalJS library, remains backward compatible with rules written for earlier ECMAScript versions.

Autoscaling is enabled by default for this microservice. You can optionally disable autoscaling when you deploy the microservice. See Configuring Autoscaling.

This microservice provides additional Prometheus monitoring metrics. See JavaScript Generic Event Processor Self-Monitoring Metrics.

JavaScript Generic Event Processor Prerequisites

Before deploying the microservice, confirm that the following prerequisites are met:

  1. A microservice cluster is set up. See Microservice Cluster Setup.

  2. The Apache Pulsar microservice is deployed. See Pulsar.

Deploying JavaScript Generic Event Processor

To deploy the microservice, run the following commands:

su - assure1
export NAMESPACE=<namespace>
export WEBFQDN=<WebFQDN> 
a1helm install <microservice-release-name> assure1/js-generic-event-processor -n $NAMESPACE --set global.imageRegistry=$WEBFQDN

In the commands:

You can also use the Unified Assurance UI to deploy microservices. See Deploying a Microservice by Using the UI for more information.

Changing JavaScript Generic Event Processor Configuration Parameters

When running the install command, you can optionally change default configuration parameter values by including them in the command with additional --set arguments. You can add as many additional --set arguments as you need.

For example:

Default JavaScript Generic Event Processor Configuration

The following table describes the default configuration parameters found in the Helm chart under configData for the microservice.

Name Default Value Possible Values Notes
LOG_LEVEL ERROR FATAL, ERROR, WARN, INFO, DEBUG Logging level used by application.
STREAM_INPUT persistent://assure1/event/js-generic-processor Text, 255 characters Configurable Apache Pulsar input topic path.
STREAM_OUTPUT persistent://assure1/event/sink Text, 255 characters Configurable Apache Pulsar output topic path.
PRODUCTION_ENV true true,false If true, application WILL NOT display any console.log statements from js rules.
STRICT_COMPILE true true,false If true, application will force javascript strict compilation rules.
RULE_BRANCH_DIR core/default Text, 255 characters The SVN branch directory that contains the JS Generic Event Processor rule files.
RULE_PATH processing/event/js-generic-event-processor Text, 255 characters The SVN path to the folder containing the JS Generic Event Processor rule files.

JavaScript Generic Event Processor Autoscaling Configuration

Autoscaling is supported for the JavaScript Generic Event Processor microservice. See Configuring Autoscaling for general information and details about the standard autoscaling configurations.

The JavaScript Generic Event Processor microservice also supports the additional configurations described in the following table.

Name Default Value Possible Values Notes
thresholds.backlogSize 1000 Integer The number of items that need to be in the backlog before the autoscaling starts additional processes.
thresholds.totalEventsProcessed 400 Integer Total events processed by the microservice. If the average of total events processed in five minutes exceeds the threshold, pods will be scaled.

JavaScript Generic Event Processor Self-Monitoring Metrics

The JavaScript Generic Event Processor microservice exposes the self-monitoring metrics described in the following table to Prometheus.

Metric Name Type Description
total_events_received Counter Number of events received by js-generic-processor
total_events_processed Counter Number of events processed by js-generic-processor
total_events_discarded Counter Number of events discarded by js-generic-processor
total_events_failed Counter Number of events failed by js-generic-processor
processing_time_per_event Gauge Processing time per events by js-generic-processor
js_generic_event_processor_backlog_size Gauge Number of items pending in the backlog

Note:

Metric names in the database include a prefix that indicates the service that inserted them. The prefix is prom_ for metrics inserted by Prometheus. For example, total_events_processed is stored as prom_total_events_processed in the database.