Insight Collector Service¶
This collector service collects and publishes various reports at the end of each workflow. These reports are available as workflow attachments. Currently, the following reports are published:
- Execution log: workflow execution log (
executionlog.txt
by default) - Summary report: workflow summary report (
executionreport.html
by default) - Surefire XML report: workflow summary report in Surefire XML format (
executionreport.xml
by default)
This service exposes one user-facing endpoint.
Environment Variables¶
Logging¶
You can set the INSIGHTCOLLECTOR_DEBUG_LEVEL
(all upper-cased) or DEBUG_LEVEL
environment variables
to DEBUG
to add additional information in the console for the launched service. It defaults to
INFO
. (Please note that setting DEBUG_LEVEL
to DEBUG
will produce tons of logs.)
The possible values are NOTSET
, DEBUG
, INFO
, WARNING
, ERROR
, and FATAL
. Those values
are from the most verbose, NOTSET
, which shows all logs, to the least verbose, FATAL
, which
only shows fatal errors.
If INSIGHTCOLLECTOR_DEBUG_LEVEL
is not defined then the value of DEBUG_LEVEL
is used (or INFO
if
DEBUG_LEVEL
is not defined either).
Access logs are only shown at NOTSET
and DEBUG
levels.
Insight Collector Configuration¶
The INSIGHTCOLLECTOR_CONFIGURATION
(all upper-cased) environment variable, if defined,
must refer to an existing file that contains reports configuration.
Tip
If the content of this referred file changes, the execution log configuration used by the Insight Collector service will change accordingly. You do not need to restart the service.
You can also set one service-specific configuration option using environment variable:
INSIGHTCOLLECTOR_WORKERS_MAX_WAIT_SECONDS
sets the maximum duration to wait for workflow workers to complete their jobs.
Reports Configuration File¶
If you want to configure reports settings, you must create a YAML file.
Reports configuration files must use YAML syntax and may have a .yml
or .yaml
file extension.
A reports configuration file has one mandatory section: insights
. It
must contain at least one entity definition. An entity is defined by his name
and kind
properties, which are mandatory.
An example of a reports configuration file is:
insights:
- name: executionlog
kind: ExecutionLog
spec:
step-depth: 0
job-depth: 0
max-command-length: 0
Please refer to the Insights guide for more information.
Service Configuration File¶
This service has a configuration file (insightcollector.yaml
by default) that describes
the common service configuration options.
If no configuration file is found it will default to the following values:
apiVersion: opentestfactory.org/v1beta2
kind: ServiceConfig
current-context: default
contexts:
- name: default
context:
port: 443
host: 127.0.0.1
ssl_context: adhoc
eventbus:
endpoint: https://127.0.0.1:38368
token: token
workers_max_wait_seconds: 30
The configuration included in the ‘allinone’ image is described in “Common settings.” The
listening port is 7796 and the bind address is 0.0.0.0
as the service may expose a user-facing endpoint.
One service-specific configuration option can be refined.
Subscriptions¶
The insight collector plugin subscribes to the following events:
kind |
apiVersion |
---|---|
WorkflowCompleted |
opentestfactory.org/v1 |
WorkflowCancelled |
opentestfactory.org/v1 |
The insight collector plugin exposes an /inbox
endpoint that is used by the event bus to post relevant events.
Launch Command¶
If you want to manually start the Insight Collector service, use the following command:
python -m opentf.plugins.insightcollector.main [--context context] [--config configfile]
Additional command-line options are available and described in “Command-line options.”