Advanced topics
Following section shows how to configure the Spring Boot server.
Liquibase🔗
Coming Soon
Metrics🔗
Since Chutney relies on Spring Boot Actuator and Micrometer autoconfiguration, it includes Prometheus by default.
So you can find and use default metrics : JVM, System, Datasource, Loggers, Executors and Spring MVC metrics.
Moreover, Chutney provides following metrics and corresponding Micrometer tags :
scenario_execution_count
counter (execution status, scenario id, scenario tags) is incremented after a scenario execution.scenario_execution_timer
timer (execution status, scenario id, scenario tags) is recorded after a scenario execution.scenario_in_campaign_gauge
gauge (campaign id, execution status) counts the scenario execution status after a campaign execution.campaign_execution_count
counter (campaign id, campaign title, execution status) is incremented after a campaign execution.campaign_execution_timer
timer (campaign id) is recorded after a campaign execution.
Important
We won't thoroughly document how to collect and manage your metrics outside Chutney (even if the demo includes one).
Some hints could be :
- Use the Actuator Prometheus endpoint to get the metrics with the appropriate format
- Use push solution (Prometheus Pushgateway or custom)
Authentication🔗
Important
Maven module local-dev shows :
- How to use in memory authentication and roles, see the
mem-auth
profile - How to use a custom LDAP authentication (for example purpose, it uses an embedded LDAP server)
- How to use a OIDC provider authentication (for example purpose, it uses a local server)
Chutney uses Spring Security for :
- Basic authentication
- Enforce authentication and check authorization on API (ex. admin rights Spring Boot Actuator endpoints)
- Configuring in memory users and roles with the Spring profile
mem-auth
if needed
How to use in memory Spring profile mem-auth
- Activate the profile
- Declare users and roles
- Optional, if the role include the characters 'admin', ignoring case, all permissions will be granted to that user.
Warning
If you create a role name including characters 'admin' (ignoring case), all permissions will be granted to users with this role.
If you want to add another authentication mechanism, you should follow the Spring security architecture.
Authentication requirements
The principal build by the authentication mechanism must be an instance of the Chutney UserDto.
User roles and permissions are configured either with Web app form or by editing the file.
One could use the existing AuthenticationService Chutney Spring Bean to retrieve Chutney roles by user id and grant associated authorities.
How to manage permissions
- A user can only have one role
- Chutney permissions are defined in the Authorization class.
- The static
grantAuthoritiesFromUserRole
method of UserDetailsServiceHelper class could be used to have the same authentication process thanmem-auth
profile,
i.e. if the user has a role name containing the characters 'admin', ignoring case, user will be given all authorities available, else he will be given the authorities associated by the role retrieved by the AuthenticationService.
Compression🔗
Spring Boot allows to configure compression on HTTP responses payloads.
Chutney Server stores scenarios executions reports and send them over the network, so it could be useful to use this configuration.
Server compression configuration
- The mime-types you want to compresse
- The minimum content length required for compression
Session management🔗
Spring Boot allows to configure session management.
Server session configuration (with cookie)
- The session timeout in minutes (example is 4 hours)
- Forbids Javascript to access the cookie
- Only for HTTPS requests
Actuator🔗
Spring Boot provides production-ready features with the Actuator module. Since Chutney includes this module, you can also configure it.
Actuator configuration examples
Warning
Chutney enforces ADMIN_ACCESS
permissions on all default Actuator endpoints.
Specifics values🔗
Following table shows all properties you can set to configure Chutney.
Name | Description | Default value |
---|---|---|
chutney.configuration-folder | Local directory path to data and configuration files | ~/.chutney/conf |
chutney.environment.configuration-folder | Local directory path to environments data files | ~/.chutney/conf/environment |
chutney.jira.configuration-folder | Local directory path to jira data files | ~/.chutney/conf/jira |
chutney.server.execution.async.publisher.ttl | Time to live in seconds of a finished observable scenario execution | 5 |
chutney.server.execution.async.publisher.debounce | Window time in milliseconds in which a running observable scenario execution ignores new associated engine report | 250 |
chutney.server.campaigns.executor.pool-size | Pool size of campaigns' executor | 20 |
chutney.server.scheduled-campaigns.fixed-rate | Fixed time period for scheduled campaigns execution checking | 60000 |
chutney.server.scheduled-campaigns.executor.pool-size | Pool size of scheduled campaigns' executor | 20 |
chutney.server.schedule-purge.cron | Purge launch cron planification | 0 0 1 * * * |
chutney.server.schedule-purge.timeout | Timeout in seconds for purge (+ retries) | 600 |
chutney.server.schedule-purge.retry | Number of max purge retries | 2 |
chutney.server.schedule-purge.max-scenario-executions | Number of max scenario executions to keep when purging | 10 |
chutney.server.schedule-purge.max-campaign-executions | Number of max campaign executions to keep when purging | 10 |
chutney.server.agent.name | Default name of local agent | |
chutney.server.agent.hostname | Default hostname of local agent | |
chutney.server.agent.network.connection-checker-timeout | Socket timeout in milliseconds for agent networking management actions | 1000 |
chutney.server.editions.ttl.value | Time to live value of unclosed scenario's editions | 6 |
chutney.server.editions.ttl.unit | Time to live time unit of unclosed scenario's editions | HOURS |
chutney.engine.executor.pool-size | Pool size of scenarios' executor | 20 |
chutney.engine.delegation.user | Username of engine's delegation service HTTP client | |
chutney.engine.delegation.password | Password of engine's delegation service HTTP client | |
chutney.engine.reporter.publisher.ttl | Time to live in seconds of the engine's executions' reports | 5 |
chutney.actions.sql.max-logged-rows | Max logged rows in report for SQL action | 30 |