Factoryinsight
2 minute read
Factoryinsight is a microservice that provides a set of REST APIs to access the data from the database. It is particularly useful to calculate the Key Performance Indicators (KPIs) of the factories.
How it works
Factoryinsight exposes REST APIs to access the data from the database or calculate the KPIs. By default, it’s only accessible from the internal network of the cluster, but it can be configured to be accessible from the external network.
The APIs require authentication, that can be ehither a Basic Auth or a Bearer
token. Both of these can be found in the Secret factoryinsight-secret
.
API documentation
Kubernetes resources
- Deployment:
united-manufacturing-hub-factoryinsight-deployment
- Service:
- Internal ClusterIP:
united-manufacturing-hub-factoryinsight-service
at port 80 - External : Access factoryinsight outside the cluster
- Internal ClusterIP:
- Secret:
factoryinsight-secret
Configuration
You shouldn’t need to configure Factoryinsight manually, as it’s configured
automatically when the cluster is deployed. However, if you need to change the
configuration, you can do it by editing the factoryinsight
section of the Helm
chart values file.
Environment variables
Variable name | Description | Type | Allowed values | Default |
---|---|---|---|---|
CUSTOMER_NAME_{NUMBER} | Specifies a user for the REST API. Multiple users can be set | string | Any | "" |
CUSTOMER_PASSWORD_{NUMBER} | Specifies the password of the user for the REST API | string | Any | "" |
DEBUG_ENABLE_FGTRACE | Enables the use of the fgtrace library. Not reccomended for production | string | true , false | false |
DRY_RUN | If enabled, data wont be stored in database | bool | true , false | false |
FACTORYINSIGHT_PASSWORD | Specifies the password for the admin user for the REST API | string | Any | Random UUID |
FACTORYINSIGHT_USER | Specifies the admin user for the REST API | string | Any | factoryinsight |
INSECURE_NO_AUTH | If enabled, no authentication is required for the REST API. Not reccomended for production | bool | true , false | false |
LOGGING_LEVEL | Defines which logging level is used, mostly relevant for developers | string | PRODUCTION, DEVELOPMENT | PRODUCTION |
MICROSERVICE_NAME | Name of the microservice. Used for tracing | string | Any | united-manufacturing-hub-factoryinsight |
POSTGRES_DATABASE | Specifies the database name to use | string | Any | factoryinsight |
POSTGRES_HOST | Specifies the database DNS name or IP address | string | Any | united-manufacturing-hub |
POSTGRES_PASSWORD | Specifies the database password to use | string | Any | changeme |
POSTGRES_PORT | Specifies the database port | int | Valid port number | 5432 |
POSTGRES_USER | Specifies the database user to use | string | Any | factoryinsight |
REDIS_PASSWORD | Password to access the redis sentinel | string | Any | Random UUID |
REDIS_URI | The URI of the Redis instance | string | Any | united-manufacturing-hub-redis-headless:6379 |
SERIAL_NUMBER | Serial number of the cluster. Used for tracing | string | Any | defalut |
VERSION | The version of the API used. Each version also enables all the previous ones | int | Any | 2 |