Application assignment
Introduction
It is currently not technically possible to automatically assign host processes and their services to a software application. Versio.io allows customers to define the application context for processes and services in an environment variable VERSIO_APPLICATION_ID
.
The environment variable for application assignment can be defined at the following levels:
- Host level - application mapping applies to all processes and services on the host. The assignment on host level is only conditionally recommended, because all captured host processes and services are assigned to an application by Versio.io (too rough).
- Process level - application mapping applies to the process instance and all services provided by it.
- Shell/Bash level - application mapping applies to all processes and services in the dedicated execution context.
Configuration
The mapping is done in a defined format Application(Service)
, which for simplicity is illustrated in the following table in the form of examples.
Specifying services reduces the mapping to an application only for the specified services. For example, the databases of a database management system can be assigned to different applications.
Assignment typ | Configuration |
---|---|
One application | VERSIO_APPLICATION_ID = "MyApp1" |
Multiple applications | VERSIO_APPLICATION_ID = "MyApp1,MyApp2" |
One application and one service | VERSIO_APPLICATION_ID = "MyApp1(Service-A)" |
One application and specific services | VERSIO_APPLICATION_ID = "MyApp1(Service-A\|Service-B)" |
Assignment to multiple applications and specific services | VERSIO_APPLICATION_ID = "MyApp1(Service-A\|Service-B),MyApp2,MyApp3(Service-C)" |
Workaround NGINX
By default, nginx removes all environment variables inherited from its parent process except the TZ variable. (https://nginx.org/en/docs/ngx_core_module.html)
This means that the VERSIO_APPLICATION_ID
environment variable is not available even if it has been set.
To automatically assign the NGINX to the application anyway, the environment variable can be entered in the /etc/nginx/versio-io.env
file.
Topology example
The following topology shows an example of how processes and specific services have been assigned to an application.
Figure:Example topology for which the processes and services are assigned to an application
Integration examples
Shell script or batch file
export VERSIO_APPLICATION_ID="crm.my-domain.com"
bash my-app
Docker
docker run -d -e VERSIO_APPLICATION_ID="crm.my-domain.com" my-docker-image:latest
Docker compose
version: "3"
services:
crm:
image: mycrm/mycrm:latest
environment:
- VERSIO_APPLICATION_ID="crm.my-domain.com"
ports:
- 443:443
Linux systemd service
[UNIT]
...
[Service]
Environment="VERSIO_APPLICATION_ID=crm.my-domain.com"
...
[INSTALL]
...