How to enable history functionality

History should be configured in common configuration file for all services - globals.yaml.gotmpl. The configuration file's path is - etc/kodjin/{environment}/globals.yaml.gotmpl

History will only start to record events after you enable it. It will not get filled with existing data. For this reason it is highly recommended to enable history before cluster creation

  1. Check Zookeeper worker group present, if not add it to the file:

etc/cluster/worker-groups.<environment>.auto.tfvars

worker_groups = [
# . . .
  {
    name                 = "zookeeper"
    instance_type        = "t3.small"
    additional_userdata  = "t3.small"
    asg_desired_capacity = 3
    asg_max_size         = 3
    asg_min_size         = 3
    ami_id               = "ami-0dd8af8522cf16846"
    kubelet_extra_args   = "--node-labels=db=zookeeper --register-with-taints=key=zookeeper:NoSchedule"
    root_volume_size     = "50"
    root_volume_type     = "gp3"
    enable_monitoring    = false
  },
]

AMI ID ami-0dd8af8522cf16846 is different per each region.

  1. Enable clickhouse and zookeeper releases in deps:

etc/deps/<environment>/releases.yaml

zookeeper:
  enabled: true
clickhouse:
  enabled: true
  1. Check whether the secrets exist and have the following format:

etc/deps/<environment>/secrets/clickhouse-operator.yaml

secret:
    username: ENC[username]
    password: ENC[password]
. . .

Ensure username and password are under secret, not operator.

  1. Enable the fhir-server-clickhouse-migrations release in kodjin:

etc/kodjin/<environment>/releases.yaml

fhir-server-clickhouse-migrations:
  enabled: true
  1. Enable the fhir-server-kafka-config-secrets-sync release in kodjin:

etc/kodjin/<environment>/releases.yaml

fhir-server-kafka-config-secrets-sync:
  enabled: true

This release should be enabled by default, anyway you should check it.

  1. Set HISTORY_ENABLED to true in kodjin globals:

etc/kodjin/<environment>/globals.yaml.gotmpl

envs:
  history:
    HISTORY_ENABLED: true

If HISTORY_ENABLED was set to true after cluster creation (which is not recommended) all the relevant releases should be deployed using rmk tool
rmk release sync