> 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 начиная?
* active WebformsRest application
  * application delivered with the Eximee platform
* active MonitoringLogProcessor application
  * application delivered with the Eximee platform version 2.3019.0
* active database storing events
  * PostgreSQL version >=9.5 is required for the application to work
* 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

Launching 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 status of applications.

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

EximeeEvents writes them to the appropriate Kafka topic.

MonitoringEventProcessor reads events from Kafka, verifies them, and saves them to the database (PostgreSQL) in a form readable by Grafana.

Events in the database can be read by external applications for visualization or analysis.\
Together with the platform, Grafana configuration will be provided for visualizing events.

<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 written 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 fill the database (currently PostgreSQL only) 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 - the target place 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 address.                             |
| MONITORING\_LOG\_PROCESSOR\_DATABASE\_USERNAME | YES         | db\_user                                                     | User with permissions to write events.        |
| MONITORING\_LOG\_PROCESSOR\_DATABASE\_PASSWORD | YES         | db\_pass                                                     | Password for the database access user.        |

#### 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 address                           |
| MONITORING\_LOG\_PROCESSOR\_KAFKA\_TOPIC | YES         | all                                               | Topic where 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 modified into business types.\
A type that has no equivalent in a business event gets an empty value.\
Information about event type mapping is below:

| System event (eximee)                           | Business event       | Description                                                                |
| ----------------------------------------------- | -------------------- | -------------------------------------------------------------------------- |
| FORM\_NEW\_STARTED                              | FORM\_ENTRY          | Entering the application request                                           |
| <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 the draft version of the application                                |
| FORM\_DRAFT\_RESTORE                            | FORM\_DRAFT\_RESTORE | Restoring the draft version of the application                             |

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

Defined database structure with business events.

| Schema         |           |              | monitoring\_events                                         |
| -------------- | --------- | ------------ | ---------------------------------------------------------- |
| **Table**      |           |              | **events**                                                 |
| **Field name** | **Type**  | **nullable** | **Description**                                            |
| id             | bigserial | FALSE        | Sequential event identifiers                               |
| origin         | text      | FALSE        | Event origin (SYSTEM / BUSINESS)                           |
| type           | text      | FALSE        | Business event type (the table with event types is above)  |
| timestamp      | timestamp | FALSE        | Event call time (date and time)                            |
| payload        | jsonb     | TRUE         | Event data in JSON form, 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 stored in the 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 designed to collect events related to application status 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 the configuration fragment responsible for the active event collection flow.

{% hint style="info" %}
The connector to 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 showing the installation configuration.

<table><thead><tr><th width="187">Installation key</th><th>Key in the configuration</th><th width="187">Sample 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>Activity of the event collection mechanism</td></tr><tr><td><br></td><td>server.features.eventLog.coreExecutorPoolSize</td><td>5</td><td>Number of threads for event processing</td></tr><tr><td><br></td><td>server.features.eventLog.maxExecutorPoolSize</td><td>10</td><td>Maximum number of threads 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>Address of 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.
