SPEKTRA Edge Logging Store

Understanding the SPEKTRA Edge loggging store.

The logging store for logs is implemented in the logging/logs_store/v1/store.go file. This interface also uses the WideColumn store under the hood. We are mapping to KeyedValues all Log instances. Unlike in Audit, these logs can truly be very long, for one uid.Key mapping we can have logs lasting days, months, and years.

From the Log instance, we extract fields scope, region, service, version, log_descriptor, and labels, which are converted to uid.Key.

Regarding ColumnValue, the whole Log body is marshaled into a binary array, and the rest of the columns are extracted in the following way:

  • Column family is just one for all logs
  • Time is taken from the log timestamp, but we use second precision only.
  • To prevent log overrides, in the column key we store the nanosecond part of the log timestamp.

In this case, we would also benefit from the v3 version where timestamps have nanosecond precision.

Logs saving/querying is like for other described here storages, and source code should be more or less readable.