Skip to content

Merge slog feature branch#1859

Open
Igor-splunk wants to merge 20 commits intodevelopfrom
feature/slog-as-default-logger
Open

Merge slog feature branch#1859
Igor-splunk wants to merge 20 commits intodevelopfrom
feature/slog-as-default-logger

Conversation

@Igor-splunk
Copy link
Copy Markdown
Collaborator

Description

What does this PR have in it?

Key Changes

Highlight the updates in specific files

Testing and Verification

How did you test these changes? What automated tests are added?

Related Issues

Jira tickets, GitHub issues, Support tickets...

PR Checklist

  • Code changes adhere to the project's coding standards.
  • Relevant unit and integration tests are included.
  • Documentation has been updated accordingly.
  • All tests pass locally.
  • The PR description follows the project's guidelines.

Igor-splunk and others added 18 commits January 29, 2026 10:12
* a

* Tests for slog

* Use slog in main

* Use assertion

* black box

---------

Co-authored-by: igor.grzankowski <@splunk.com>
* Secrets logs

* Get rid of log handle

* Differentiate errors
* CSPL-3551 Init IngestorCluster CR implementation

* CSPL-3551 Enhancing Ingestor inputs

* CSPL-3551 Adding tests

* CSPL-3551 Mound defaults and update them with no Splunk restart

* CSPL-3551 Fixing code after tests

* CSPL-3895-indexercluster (#1562)

* Use endpoint to update conf file

* CSPL-3895 Matching changes from Ingestor to Indexer

---------

Co-authored-by: Kasia Koziol <kkoziol@splunk.com>
Co-authored-by: igor.grzankowski <@splunk.com>

* CSPL-3551 Applying fixes do Indexer integration

* CSPL-3551 Fixes

* CSPL-3551 Fixes

* CSPL-3560 Initial docs for I&I separation

* CSPL-3551 Update documentation to reflect on Grafana

* CSPL-3556 Unit tests

* CSPL-3972 Addressing TODOs

* CSPL-3972 Addressing TODOs

* CSPL-3551 Moving default from types to controller code

* CSPL-3551 Applying previous changes to IndexerCluster

* CSPL-3551 Moving validations to separate function and adding validation for empty values

* CSPL-3551 Making sure all inputs are put into status

* CSPL-3551 Update of conf files when queue name or type change

* CSPL-3551 Unit tests

* CSPL-4003 Helm charts support for bus and pipeline configs

* CSPL-4003 Docs update

* CSPL-4003 Addressing comments

* CSPL-3558 Integ tests init

* CSPL-3558 Adding extra validation for integraion test

* CSPL-3558 Refactoring

* CSPL-3558 Adding scenario for update and delete

* CSPL-3558 Adding helm test

* CSPL-3558 Update of k8s version

* CSPL-3558 Fix metrics-server installation issues after k8s version upgrade

* CSPL-3558 Adding additional tests

* CSPL-3558 Fixing helm tests

* CSPL-3558 Fix tests after merge

* CSPL-3558 Fix helm tests

* CSPL-4022 Remove pipeline config from inputs

* CSPL-4022 Remove bus inputs

* CSPL-4022 Introduce BusConfiguration CR

* CSPL-4022 Update docs and tests

* CSPL-4022 Update ns reference for BusConfiguration

* CSPL-4022 Fixing tests and adding bus config to ingestor controller

* CSPL-4022 Fix update behaviour

* CSPL-4022 Docs update

* CSPL-4022 Fix failing tests

* CSPL-4022 Fix tests

* CSPL-4022 Addressing PR comments

* CSPL-4022 Address comments

* CSPL-4022 Fix helm tests

* CSPL-4358 Splitting BusConfiguration into Bus and LargeMessageStore

* CSPL-4358 Update docs

* CSPL-4358 Addressing comments

* CSPL-4358 Adding more validations

* CSPL-4360 Secret reference added for Bus CR

* CSPL-4360 Fix failing tests

* CSPL-4360 Add Splunk restart

* CSPL-4360 Fix failing tests

* CSPL-4360 Fix failing tests

* CSPL-4360 Fix errors with failing validation on status

* CSPL-4358 Rename Bus to Queue

* CSPL-4358 Rename LargeMessageStore to ObjectStorage

* CSPL-4358 Making region authRegion and optional, simplifying endpoint

* CSPL-4360 Fixing tests after merge

* CSPL-4360 Fix validation that fails for status

* CSPL-4360 Fix failing to get k8s secret

* CSPL-4360 Fix failing integ and helm tests

* CSPL-4360 Fixing failing tests due to incorrect secret ref

* CSPL-4360 Addressing comments

* CSPL-4360 Addressing secret value change and removing redundant controllers

* CSPL-4360 Update of docs, helm tests and validations

* CSPL-4360 Add secret watch and fix controller tests

* CSPL-4360 Update docs

* CSPL-4360 Restart Splunk when SA changed

* Addressing comments

* Addressing changes from recent PRs

* Formatting fix

* Addressing PR comments

* Address comments

* Addressing comments

* Fix pipeline issues

* Reverting

* Refactoring according to comments

* CSPL-4513 Refactoring of existing events

* CSPL-4513 Adding events and tests for them for Index & Ingestion separation use case

* Fix formatting issues

* Logs

* Fmt fix

* CSPL-4513 Extra logs

* CSPL-4513 Moving to slog and extra tests

* CSPL-4513 Fixing ScaledUp/Down events

* CSPL-4002 Update Ansible role to ingestor (from standalone) for IngestorCluster (#1606)

* CSPL-4002 Update role for ingestor to ingestor from standalone

* CSPL-4212 Address changes from unit tests from develop branch

* Addressing comments

* Run tests against Splunk 10.2

* Fix

* Address changes from develop

* CSPL-4002 Revert 10.2 changes

* CSPL-4513 Address comments

* CSPL-4354 logs for CM and IC

* CSPL-4354 Refactoring

* CSPL-4513 Addressing Igor's changes

* Fix

* CSPL-4354 Addressing comments

* CSPL-4354 Address comments

* Feature/cspl 4354 cluster manager reconciler logging (#1721)

* CSPL-4354 logs for CM and IC

* CSPL-4354 Refactoring

* CSPL-4354 Addressing comments

* CSPL-4354 Address comments

* CSPL-4354 Address comments

* CSPL-4513 Address comments

---------

Co-authored-by: Igor Grzankowski <igorg@splunk.com>
}

reqLogger.Info("start", "CR version", instance.GetResourceVersion())
logger.InfoContext(ctx, "start", "CR version", instance.GetResourceVersion())
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: to keep it consistent across all logs, we could enforce a pattern for key naming and it could be crVersion instead of CR version

result, err := ApplyClusterManager(ctx, r.Client, instance, nil)
if result.Requeue && result.RequeueAfter != 0 {
reqLogger.Info("Requeued", "period(seconds)", int(result.RequeueAfter/time.Second))
logger.InfoContext(ctx, "Requeued", "period(seconds)", int(result.RequeueAfter/time.Second))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: to keep it consistent across all logs, we could enforce a pattern for key naming and it could be periodSeconds instead of period(seconds)

Comment thread pkg/splunk/client/awss3client.go Outdated
}

scopedLog.Info("AWS Client Config initialization successful.", "region", region, "TLS Version", tlsVersion)
scopedLog.InfoContext(ctx, "AWS Client Config initialization successful.", "region", region, "TLS Version", tlsVersion)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: tlsVersion

Comment thread pkg/splunk/client/awss3client.go Outdated
scopedLog := logging.FromContext(ctx).With("func", "GetAppsList")

scopedLog.Info("Getting Apps list", "AWS S3 Bucket", awsclient.BucketName)
scopedLog.InfoContext(ctx, "Getting Apps list", "AWS S3 Bucket", awsclient.BucketName)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: I won't write it everywhere, but it would be good to make key format consistent in logs.

Copy link
Copy Markdown
Collaborator

@rlieberman-splunk rlieberman-splunk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the PR description before merging.

Comment thread docs/LoggingAndEvents.md
@@ -0,0 +1,261 @@
# Logging & Events
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add this to the "Reference" section of the github docs similar to the examples file: https://github.com/splunk/splunk-operator/blob/main/docs/Examples.md?plain=1#L4

Comment thread docs/LoggingAndEvents.md Outdated
| `EventReasonSecretMissing` | `SecretMissing` | Required secret not found |
| `EventReasonUpgradeCheckFailed` | `UpgradeCheckFailed` | Upgrade path validation errors |

See `event_reasons.go` for the full list.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a link to this file from the doc?

Comment thread pkg/splunk/enterprise/afwscheduler.go Outdated
// so a non-empty stderr does not indicate failure.
if stdErr != "" {
scopedLog.Info("Post install command stderr output (informational only)", "stdout", stdOut, "stderr", stdErr, "post install command", command)
scopedLog.InfoContext(rctx, "Post install command stderr output (informational only)", "stdout", stdOut, "stderr", stdErr, "post install command", command)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*postInstallCommand

Comment thread pkg/splunk/splkcontroller/controller.go Outdated
// log what happens next
if err != nil {
scopedLog.ErrorContext(ctx, "Reconciliation requeued", "RequeueAfter", result.RequeueAfter, "error", err)
scopedLog.ErrorContext(ctx, "reconciliation requeued", "RequeueAfter", result.RequeueAfter, "error", err)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*requeueAfter

Comment thread pkg/splunk/splkcontroller/controller.go Outdated
}
if result.Requeue {
scopedLog.InfoContext(ctx, "Reconciliation requeued", "RequeueAfter", result.RequeueAfter)
scopedLog.InfoContext(ctx, "reconciliation requeued", "RequeueAfter", result.RequeueAfter)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*requeueAfter

@kasiakoziol
Copy link
Copy Markdown
Collaborator

  1. Please add PR description.
  2. Do we for sure want to move from capital to small letter logs?
  3. If possible, (nit), I would go through the logs and make it consistent to use specific format of resource names, e.g. Indexer Cluster, not IndexerCluster;indexerCluster;indexer cluster;indexercluster etc. because it is so much different all over different logs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants