factoryinsight

Technical documentation of the microservice factoryinsight, which fetches manufacturing data and calculates various Key Performance Indicators.

Introduction

Factoryinsight is a microservice responsible for receiving API requests, fetching requested data from the TimescaleDB database and calculating Key Performance Indicators based on the data. This documentation provides instructions on how to set up and configure factoryinsight for development purposes.

Environment variables

Factoryinsight can be configured using the following environment variables:

Variable nameDescriptionTypePossible valuesExample Values
CUSTOMER_NAME_{NUMBER}Specifies a user for the REST APIstringalljeremy
CUSTOMER_PASSWORD_{NUMBER}Specifies the password for the user for the REST APIstringallchangeme
DRY_RUNIf enabled, data wont be stored in database(default: false)booltrue, falsetrue
FACTORYINSIGHT_PASSWORDSpecifies the password for the admin user for the REST APIstringallchangeme
FACTORYINSIGHT_USERSpecifies the admin user for the REST APIstringalljeremy
INSECURE_NO_AUTHIf enabled, no authentication is required for the REST API (default: false)booltrue, falsetrue
LOGGING_LEVELDefines which logging level is used, mostly relevant for developers. If logging level is not DEVELOPMENT, default logging will be usedstringanyDEVELOPMENT
POSTGRES_DATABASESpecifies the database name that should be usedstringallfactoryinsight
POSTGRES_HOSTSpecifies the database DNS name / IP-address for postgreSQL / TimescaleDBstringall DNS names or IP addressesunited-manufacturing-hub
POSTGRES_PASSWORDSpecifies the database password that should be usedstringallchangeme
POSTGRES_PORTSpecifies the database port for postgreSQLintvalid port number5432
POSTGRES_USERSpecifies the database user that should be usedstringan existing user with access to the specified database in postgreSQLfactoryinsight
REDIS_PASSWORDPassword for accessing redis sentinelstringallchangeme
REDIS_URIURI for accessing redis sentinelstringall valid URIsunited-manufacturing-hub-redis-node-0.united-manufacturing-hub-redis-headless:26379
REDIS_URI2Backup URI for accessing redis sentinelstringall valid URIsunited-manufacturing-hub-redis-node-0.united-manufacturing-hub-redis-headless:26379
REDIS_URI3Backup URI for accessing redis sentinelstringall valid URIsunited-manufacturing-hub-redis-node-0.united-manufacturing-hub-redis-headless:26379
VERSIONThe version of the API usedintall1
SERIAL_NUMBERSerial number of the cluster (used for tracing)stringalldevelopment
MICROSERVICE_NAMEName of the microservice (used for tracing)stringallbarcodereader
DEBUG_ENABLE_FGTRACEEnables the use of the fgtrace library, do not enable in productionstringtrue, 1, any1

REST API endpoints

Last modified February 17, 2023: update (#208) (ea731fc)