openshift / openshift/cluster-logging-operator

feat: add verb to default audit labelKeys for ViaQ data model

Open
#3,317 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
118
Forks
176
Avg merge
2d 15h
Merged PRs (30d)
32

Description

What this is / why we need it

When using the ViaQ data model with LokiStack, audit logs do not have verb as a Loki stream label by default. This means every audit query must do | json | verb=~"create" which requires parsing the full JSON of every log line.

The verb field is the most commonly used filter for audit log queries and has very low cardinality (~6 values: create, update, patch, delete, get, list). Adding it as a default stream label for audit logs would:

  • Eliminate full-JSON parsing for the most common filter
  • Partition the audit log stream effectively (most volume is get/list)
  • Match what the OTLP model already supports via structured metadata

Proposal

Add verb to the default labelKeys for audit logs in the ClusterLogForwarder LokiStack output when using ViaQ. For example:

spec:
  outputs:
    - name: lokistack-out
      type: lokiStack
      lokiStack:
        labelKeys:
          audit:
            labelKeys:
              - verb

Cardinality assessment

  • Only 6 possible values: create, update, patch, delete, get, list
  • Creates at most 6 additional streams per existing audit stream
  • Well within Loki's recommended "tens of values" guideline

Context

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the ViaQ defaults for the ClusterLogForwarder LokiStack output and the tests covering default audit labelKeys. Verify how the existing LokiStack configuration distinguishes ViaQ audit logs, then add verb to that default list. Done means audit streams include verb by default while explicit labelKeys configuration and existing tests remain correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
observability
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.