> For the complete documentation index, see [llms.txt](https://docs.eximee.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.eximee.com/documentation/documentation-en/eksploatacja-aplikacji/monitorowanie/monitoring-zdarzen-platformowych.md).

# Platform event monitoring

## Requirements <a href="#monitoringzdarzenplatformowych-wymagania" id="monitoringzdarzenplatformowych-wymagania"></a>

* active Router2 application with EximeeEvents
  * application delivered with the Eximee platform since version 2.3167.0
* active WebformsRest application
  * application delivered with the Eximee platform
* active MonitoringLogProcessor application
  * application delivered with the Eximee platform 2.3019.0
* active database storing events
  * PostgreSQL version >=9.5 is required for the application to run
* active Kafka instance
  * we recommend version >= 3.4
* active Grafana instance min 8.X.X
  * a sample monitoring dashboard is delivered with the platform in the grafana.json file

Enabling the functionality in the platform is controlled by adding the value "monitoring" to the COMPOSE\_PROFILES variable.

## Operating assumptions <a href="#monitoringzdarzenplatformowych-zalozeniadzialania" id="monitoringzdarzenplatformowych-zalozeniadzialania"></a>

The Webforms application generates events related to the state of applications.

Different implementations of event logging can be active at the same time. This depends on the configuration and deployment.\
EximeeEventsConnector (one possible implementation) collects events and sends them to EximeeEvents.

EximeeEvents saves them to the appropriate Kafka topic.

MonitoringEventProcessor reads events from Kafka, verifies them, and saves them to the database (PostgreSQL) in a format that can be read by Grafana.

Events in the database can be read by external applications for visualization or analysis.\
A Grafana configuration for event visualization will be delivered with the platform.

<figure><img src="/files/862b779e466d884cac749576a0e819aaf68c0d64" alt=""><figcaption><p><em><strong>Figure 1.</strong> Architecture of the event monitoring solution</em></p></figcaption></figure>

## Router2 application with EximeeEvents <a href="#monitoringzdarzenplatformowych-aplikacjarouter2zeximeeevents" id="monitoringzdarzenplatformowych-aplikacjarouter2zeximeeevents"></a>

### Purpose <a href="#monitoringzdarzenplatformowych-przeznaczenie" id="monitoringzdarzenplatformowych-przeznaczenie"></a>

EximeeEvents is a plugin for the Router2 application.\
It provides an endpoint that accepts events, which are then saved to the appropriate Kafka topic.

{% hint style="warning" %}
The topic and message group sent to Kafka must be consistent with the MonitoringLogProcessor configuration.
{% endhint %}

### Configuration <a href="#monitoringzdarzenplatformowych-konfiguracja" id="monitoringzdarzenplatformowych-konfiguracja"></a>

Configuration and more information here \[Process event registration]

## MonitoringLogProcessor application <a href="#monitoringzdarzenplatformowych-aplikacjamonitoringlogprocessor" id="monitoringzdarzenplatformowych-aplikacjamonitoringlogprocessor"></a>

### Purpose <a href="#monitoringzdarzenplatformowych-przeznaczenie.1" id="monitoringzdarzenplatformowych-przeznaczenie.1"></a>

The application's task is to populate the database (currently only PostgreSQL) with platform events.

The application reads events from the source (Kafka) and verifies whether it is a system event (originating from the platform).\
Then the system events are adapted for Grafana and saved to the database.

### Configuration <a href="#monitoringzdarzenplatformowych-konfiguracja.1" id="monitoringzdarzenplatformowych-konfiguracja.1"></a>

| Key                                            | Requirement | Example                                                      | Description                                   |
| ---------------------------------------------- | ----------- | ------------------------------------------------------------ | --------------------------------------------- |
| Database - target location for storing events  |             |                                                              |                                               |
| MONITORING\_LOG\_PROCESSOR\_DATABASE\_DIALECT  | YES         | org.hibernate.dialect.PostgreSQL95Dialect                    | Database dialect intended for storing events. |
| MONITORING\_LOG\_PROCESSOR\_DATABASE\_URL      | YES         | jdbc:<postgresql://postgresql01.host:5432/monitoring_events> | Database connection details.                  |
| MONITORING\_LOG\_PROCESSOR\_DATABASE\_USERNAME | YES         | db\_user                                                     | User with permission to write events.         |
| MONITORING\_LOG\_PROCESSOR\_DATABASE\_PASSWORD | YES         | db\_pass                                                     | Password of the user accessing the database.  |

#### Kafka <a href="#monitoringzdarzenplatformowych-kafka" id="monitoringzdarzenplatformowych-kafka"></a>

| Data source                              | Requirement |                                                   |                                                |
| ---------------------------------------- | ----------- | ------------------------------------------------- | ---------------------------------------------- |
| MONITORING\_LOG\_PROCESSOR\_KAFKA\_URL   | YES         | [http://kafka.host:9092](http://kafka.host:9092/) | Kafka connection details                       |
| MONITORING\_LOG\_PROCESSOR\_KAFKA\_TOPIC | YES         | all                                               | The topic to which event messages will be sent |
| MONITORING\_LOG\_PROCESSOR\_KAFKA\_GROUP | YES         | eximee-events                                     | Eximee event group                             |

### Stored events <a href="#monitoringzdarzenplatformowych-zapisywanezdarzenia" id="monitoringzdarzenplatformowych-zapisywanezdarzenia"></a>

Events must be of system origin (origin = SYSTEM).

Event types are converted to business types.\
A type that has no corresponding business event is given an empty value.\
Information about the event type mapping is below:

| System event (eximee)                           | Business event       | Description                                                                |
| ----------------------------------------------- | -------------------- | -------------------------------------------------------------------------- |
| FORM\_NEW\_STARTED                              | FORM\_ENTRY          | Entering the application                                                   |
| <p>FORM\_NEXT\_PAGE<br>FORM\_PREVIOUS\_PAGE</p> | PAGE\_SAVE           | Saving the state of the current page - moving to the next or previous page |
| FORM\_CLIENT\_PAGE\_CHANGED                     | PAGE\_ENTRY          | Page change - entering another page.                                       |
| FORM\_SAVE                                      | FORM\_SAVE           | Submitting the application                                                 |
| FORM\_DRAFT\_SAVE                               | FORM\_DRAFT\_SAVE    | Saving a draft version of the application                                  |
| FORM\_DRAFT\_RESTORE                            | FORM\_DRAFT\_RESTORE | Restoring a draft version of the application                               |

### Database structure (PostgreSQL) <a href="#monitoringzdarzenplatformowych-strukturabazydanych-postgresql" id="monitoringzdarzenplatformowych-strukturabazydanych-postgresql"></a>

Specified database structure with business events.

| Schema         |           |              | monitoring\_events                                           |
| -------------- | --------- | ------------ | ------------------------------------------------------------ |
| **Table**      |           |              | **events**                                                   |
| **Field name** | **Type**  | **nullable** | **Description**                                              |
| id             | bigserial | FALSE        | Consecutive event identifiers                                |
| origin         | text      | FALSE        | Event origin (SYSTEM / BUSINESS)                             |
| type           | text      | FALSE        | Business event type (the event type table is above)          |
| timestamp      | timestamp | FALSE        | Event invocation time (date and time)                        |
| payload        | jsonb     | TRUE         | Event data in JSON format, if the event has additional data. |

### Migration scripts <a href="#monitoringzdarzenplatformowych-skryptymigracyjne" id="monitoringzdarzenplatformowych-skryptymigracyjne"></a>

Migration scripts for creating and modifying the table are saved in an archive to be delivered together with the platform.

## Webforms application with event logging <a href="#monitoringzdarzenplatformowych-aplikacjawebformszlogowaniemzdarzen" id="monitoringzdarzenplatformowych-aplikacjawebformszlogowaniemzdarzen"></a>

### Purpose <a href="#monitoringzdarzenplatformowych-przeznaczenie.2" id="monitoringzdarzenplatformowych-przeznaczenie.2"></a>

The event logging mechanism is intended to collect events related to application state changes across the entire platform.\
Events are sent in batches to Kafka using EximeeEvents.

### Configuration <a href="#monitoringzdarzenplatformowych-konfiguracja.2" id="monitoringzdarzenplatformowych-konfiguracja.2"></a>

To activate event collection, the configuration should be set accordingly *webforms.xml*.\
Below is a configuration snippet responsible for the active event collection flow.

{% hint style="info" %}
The connector for eximeeEvents is delivered in the eximee-events library
{% endhint %}

```
<?xml version="1.0" encoding="UTF-8" ?>
<webforms>
   ....
   <server>
      ...
      <features>
         ...
         <eventLog>
            <enabled>true</enabled>
            <coreExecutorPoolSize>5</coreExecutorPoolSize>
            <maxExecutorPoolSize>10</maxExecutorPoolSize>
            <eximeeEventsProcessor>
               <enabled>true</enabled>
               <url>http://localhost:9002</url>
            </eximeeEventsProcessor>
         </eventLog>
      </features>
   </server>
</webforms>
```

And a table presenting the installation configuration.

<table><thead><tr><th width="187">Installation key</th><th>Configuration key</th><th width="187">Example value</th><th>Description</th></tr></thead><tbody><tr><td>Active event collection mechanism</td><td></td><td></td><td></td></tr><tr><td><br></td><td>server.features.eventLog.enabled</td><td>true</td><td>Event collection mechanism activity</td></tr><tr><td><br></td><td>server.features.eventLog.coreExecutorPoolSize</td><td>5</td><td>Number of threads used for event processing</td></tr><tr><td><br></td><td>server.features.eventLog.maxExecutorPoolSize</td><td>10</td><td>Maximum number of threads used for event processing</td></tr><tr><td>Active event logging mechanism</td><td></td><td></td><td></td></tr><tr><td><br></td><td>server.features.eventLog.eximeeEventsProcessor.enabled</td><td>true</td><td>Activity of the EximeeEvents mechanism</td></tr><tr><td><br></td><td>server.features.eventLog.eximeeEventsProcessor.url</td><td><a href="http://localhost:9002/">http://localhost:9002</a></td><td>Endpoint for the EximeeEvents application for writing events to Kafka</td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.eximee.com/documentation/documentation-en/eksploatacja-aplikacji/monitorowanie/monitoring-zdarzen-platformowych.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
