Infrastructure prerequisites
The Audit service requires the following components to be set up before it can be started:- Docker engine
- Kafka
- Elasticsearch
Redis is not required. audit-core does not depend on Redis. If you previously configured Redis for this service, those environment variables can be removed from your deployment.
Dependencies
The Audit service is built as a Docker image and runs on top of Kafka and Elasticsearch. Therefore, these services must be set up and running before starting the Audit service.Configuration
Configuring Kafka
To configure the Kafka server for the Audit service, set the following environment variables:Connection settings
Consumer configuration
OAuth authentication (when using SASL_PLAINTEXT)
When using the
kafka-auth profile, the security protocol will automatically be set to SASL_PLAINTEXT and the SASL mechanism will be set to OAUTHBEARER.Topic naming configuration
Kafka topics
Configuring Elasticsearch
Configure Elasticsearch connection for audit data storage:The Elasticsearch index settings determine how your audit data is distributed and replicated across the cluster. The number of shards affects search performance and indexing, while replicas provide redundancy.
CAS lib configuration
Configuring logging
To control the log levels, set the following environment variables:Ingress and CORS
The Audit Core service is exposed externally on the admin host. Routing is configured through the FlowX Helm chart, which renders either a Kubernetes Ingress (default) or a Gateway API HTTPRoute per service. CORS handling lives in the service code; only the allowed-origins list is deployment-specific.Service route
The path is set through
services.audit-core.ingress.admin.path (or services.audit-core.gateway.admin.paths) in the chart values.
CORS configuration
Allowed methods, allowed headers (including
Authorization, Content-Type, Fx-Workspace-Id), and credential handling are baked into the serviceβs application.yaml with safe defaults. Override these only if you have a non-standard requirement.
For the complete route reference, Gateway API HTTPRoute configuration, and route customization, see the ingress configuration guide.
Troubleshooting
Common issues
Audit logs not appearing
Audit logs not appearing
Symptoms: Audit events are not being recorded or are missing from search results.Solutions:
- Verify the
KAFKA_TOPIC_AUDIT_INtopic exists and matches the topic other services publish to (ai.flowx.core.trigger.save.audit.v1) - Check that the consumer group ID (
SPRING_KAFKA_CONSUMER_GROUPID) is correctly configured and not conflicting with another consumer - Ensure Kafka connectivity by verifying
KAFKA_BOOTSTRAP_SERVERSis reachable from the pod - Check consumer thread count (
KAFKA_CONSUMER_THREADS) β increase if throughput is insufficient
Elasticsearch connection errors
Elasticsearch connection errors
Symptoms: Service fails to start or throws connection errors related to Elasticsearch.Solutions:
- Verify
SPRING_ELASTICSEARCH_REST_URISpoints to a reachable Elasticsearch node (do not include the protocol in this value) - Check that
SPRING_ELASTICSEARCH_REST_PROTOCOLmatches your Elasticsearch setup (httpsorhttp) - If using SSL, ensure
SPRING_ELASTICSEARCH_REST_DISABLESSLis set appropriately and certificates are valid - Verify
SPRING_ELASTICSEARCH_REST_USERNAMEandSPRING_ELASTICSEARCH_REST_PASSWORDcredentials are correct
High storage consumption
High storage consumption
Symptoms: Elasticsearch disk usage grows rapidly or cluster health turns yellow/red.Solutions:
- Review your index lifecycle management (ILM) policies to ensure old audit data is rolled over and deleted on schedule
- Adjust
FLOWX_ELASTICSEARCH_INDEXSETTINGS_SHARDSandFLOWX_ELASTICSEARCH_INDEXSETTINGS_REPLICASβ fewer replicas reduce storage at the cost of redundancy - Check the
FLOWX_ELASTICSEARCH_INDEXSETTINGS_NAMEdata stream for excessive index count - Consider reducing the retention period for audit logs in your ILM policy
Audit events delayed
Audit events delayed
Symptoms: Audit entries appear in Elasticsearch with significant delay after the triggering action.Solutions:
- Check Kafka consumer lag for the audit consumer group using your Kafka monitoring tools
- Increase
KAFKA_CONSUMER_THREADSto allow parallel consumption if lag is consistently high - Verify Elasticsearch cluster health β a degraded cluster slows down indexing
- Check
KAFKA_AUTHEXCEPTIONRETRYINTERVALβ frequent auth failures with long retry intervals can cause delays
Related resources
Audit Log
Learn about the audit logging system and how to view audit trails
Elasticsearch Indexing
Configure Elasticsearch indexing for process data

