software/simpleran: Update eNB log forwarding behavior
Provide several fixes and improvements for eNB log forwarding, targeting in particular the default forwarding to Wendelin Telecom:
- Fix the generation of the
fluentbit
tag, where the default value forenb_id
andgnb_id
is now""
instead ofNone
, which produced malformed tags likeors123_COMP-1234_eNone
instead ofors123_COMP-1234
. - Add a boolean instance parameter
xlog_forwarding_enabled
(True
by default) that activates or deactivates log forwarding throughfluentbit
entirely. Specifically, when set toFalse
, the sections pertaining tofluentbit
are removed, and the Wendelin Telecom shared instance's destruction is requested. - Remove the default value for
xlog_fluentbit_forward_host
, and only forward logs (ifxlog_forwarding_enabled == True
) if the parameter is explicitly set OR the Wendelin Telecom shared instance returns the forward host address once it has been correctly requested. Similarly to above, the Wendelin Telecom shared instance is destroyed if the parameter is left empty (i.e. the default behavior).
Currently, when xlog_fluentbit_forward_host
is unset, it produces a faulty line in the fluentbit
config:
Host
which crashes the fluentbit
service until the parameter is provided.
This only happens in the case where we want to forward the logs to Wendelin Telecom (xlog_forwarding_enabled == True and xlog_fluentbit_forward_host == ""
): I consider it reasonable to flag the problem in this explicit way until the desired parameter is received from the shared instance.
- Add two simple promises that monitor the
fluentbit
instance, and to make sure the partition is reprocessed until it runs correctly:
-
check-xlog-fluentbit-forward-host
checks that the forward host and port combination is valid by attempting a connection through a socket. -
check-xlog-fluentbit-health
usesfluentbit
's Monitoring features by querying the/api/v1/health
of a dedicated monitoring HTTP server enabled in thefluentbit
configuration. If the service is healthy, the server returns a 200 status code; it returns a 500 status code whenfluentbit
starts losing data chunks due to errors or not being able to retry forwarding them.