Better Component Feedback on Startup
The Eventide component runner just got a nice little update for both developers and operators of Eventide services: A service now outputs a comprehensive description of a service’s contents and the environment.
Example
Here’s an example from Eventide’s account example component:
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-darwin19]
Environment Variables:
ENTITY_CACHE_SCOPE: exclusive
MESSAGE_STORE_SETTINGS_PATH: (not set)
HANDLE_STRICT: (not set)
LOG_LEVEL: (not set)
LOG_TAGS: (not set)
STARTUP_INFO: (not set)
ENV_VAR_INFO: (not set)
Host: account-component
Component: AccountComponent::Start (Name: (none))
Consumer: AccountComponent::Consumers::Commands
Category: account:command
Position: 5
Identifier: (none)
Correlation: (none)
Position Stream: account:command+position
Handlers:
Handler: AccountComponent::Handlers::Commands
Messages: Open, Close, Deposit, Withdraw
Consumer: AccountComponent::Consumers::Commands::Transactions
Category: accountTransaction
Position: 0
Identifier: (none)
Correlation: (none)
Position Stream: accountTransaction:position
Handlers:
Handler: AccountComponent::Handlers::Commands::Transactions
Messages: Deposit, Withdraw
Host running: account-component
Process ID: 41880
New Gems
The new startup input is included as of the evt-component_host
v2.0.0.5 gem, the evt-consumer
v2.2.0.1 gem, and the evt-consumer-postgres
v2.3.0.1 gem, and also depends on updates to the evt-messaging
v2.5.1.0 gem.
Refreshing a component’s gems will apply all of these changes implicitly.
The Included Startup Info
The startup info includes details about components, consumers, streams, handlers, and messages, as well as environment variables used to override Eventide’s runtime options, and the Ruby runtime.
Component Information
The component information includes:
- Component host name
- Components run by the host
- Consumers within the component
- The category stream processed by a consumer
- Handlers within a consumer that receives messages dispatched from the consumer dispatches
- Messages that a handler receives from the consumer
The consumer’s info also includes:
- The global position of the message that the consumer is starting from
- The consumer’s identifier
- The consumer’s Pub/Sub correlation
- The consumer’s position stream
The consumer’s info also may optionally include:
- Consumer optional group member and consumer group size
- Consumer’s optional SQL query condition for filtering consumed messages.
Environment Variable Information
The information printed when a service is starting also includes the environment variables that override some of Eventide’s default behaviors.
The environment variable information includes:
- ENTITY_CACHE_SCOPE
- MESSAGE_STORE_SETTINGS_PATH
- HANDLE_STRICT
- LOG_LEVEL
- LOG_TAGS
- STARTUP_INFO
- ENV_VAR_INFO
Controlling the Component Startup Information Output
The component startup information output is controlled by the STARTUP_INFO
environment variable.
The variable’s default value is “on”.
To deactivate the printing of the component startup information, set the STARTUP_INFO
to “off”.
STARTUP_INFO=off start_service.rb
Controlling the Environment Variable Information Output
The environment variable information output is controlled by the ENV_VAR_INFO
environment variable.
The variable’s default value is “on”.
To deactivate the printing of the environment variables list, set the ENV_VAR_INFO
to “off”.
ENV_VAR_INFO=off start_service.rb
Log Output
All of the startup info is also output by the logger at the info
level.
To output the startup info to the logger, set the LOG_TAGS
environment variable to start
.
LOG_TAGS=start start_service.sh
The logger outputs all of the regular startup info detailed above, as well as:
- The consumer’s message reader’s retrieval batch size
- The consumer’s position update interval
- The consumer’s poll interval in milliseconds
Conclusion
This small change to the Eventide stack puts essential feedback about the makeup of a service’s components directly into the hands of developers and operators at startup without any extra effort, and without having to inspect logs.
This feature is one of a handful of affordances to be released in the coming months that will make your experience of the award-winning Eventide stack even more polished and enjoyable.
Look for more usability improvements to critical areas of the Eventide stack like testing, integration with Rails, and monitoring.
In the mean time, sign up for the Eventide Slack and join the conversation!