Skip to content

Commit

Permalink
Prepare changelog for release 0.0.44, fix missing keys in zuul/nodepool
Browse files Browse the repository at this point in the history
logging

Add the 'container' and 'namespace' keys to logs emitted by zuul and
nodepool when using the forward input, to bring it to parity with
the HTTP input. Mark the other k8s-related keys as deprecated.

Write CHANGELOG for release 0.0.44.

Change-Id: I65d4117512c133e9495267c4e78ecd636991d161
  • Loading branch information
mhuin committed Oct 8, 2024
1 parent 9774dbe commit 7043c5d
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 11 deletions.
10 changes: 9 additions & 1 deletion controllers/libs/logging/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func CreateForwarderEnvVars(name string, extraLabels []FluentBitLabel) []apiv1.E
return forwarderEnvVars
}

func CreateBaseLoggingExtraKeys(name string, component string) []FluentBitLabel {
func CreateBaseLoggingExtraKeys(name string, component string, container string, namespace string) []FluentBitLabel {
baseExtraKeys := []FluentBitLabel{
{
Key: "labels_app",
Expand All @@ -71,6 +71,14 @@ func CreateBaseLoggingExtraKeys(name string, component string) []FluentBitLabel
Key: "component",
Value: component,
},
{
Key: "namespace",
Value: namespace,
},
{
Key: "container",
Value: container,
},
}
return baseExtraKeys
}
Expand Down
2 changes: 1 addition & 1 deletion controllers/nodepool.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ func (r *SFController) mkLoggingTemplate(serviceName string) (string, error) {
}

var loggingParams = logging.CreateForwarderConfigTemplateParams("nodepool."+serviceName, r.cr.Spec.FluentBitLogForwarding)
var loggingExtraKeys = logging.CreateBaseLoggingExtraKeys("nodepool-"+serviceName, "nodepool")
var loggingExtraKeys = logging.CreateBaseLoggingExtraKeys("nodepool-"+serviceName, "nodepool", serviceName, r.ns)
// Change logLevel to what we actually want
loggingParams.LogLevel = string(selectedLogLevel)

Expand Down
8 changes: 4 additions & 4 deletions controllers/zuul.go
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ func (r *SFController) computeLoggingConfig() map[string]string {
}

var zeloggingParams = logging.CreateForwarderConfigTemplateParams("zuul.executor", r.cr.Spec.FluentBitLogForwarding)
var zeloggingExtraKeys = logging.CreateBaseLoggingExtraKeys("zuul-executor", "zuul")
var zeloggingExtraKeys = logging.CreateBaseLoggingExtraKeys("zuul-executor", "zuul", "zuul-executor", r.ns)
// Change logLevel to what we actually want
zeloggingParams.LogLevel = string(zuulExecutorLogLevel)
loggingData["zuul-executor-logging.yaml"], _ = utils.ParseString(
Expand All @@ -408,7 +408,7 @@ func (r *SFController) computeLoggingConfig() map[string]string {
}{zeloggingExtraKeys, zeloggingParams})

var zsloggingParams = logging.CreateForwarderConfigTemplateParams("zuul.scheduler", r.cr.Spec.FluentBitLogForwarding)
var zsloggingExtraKeys = logging.CreateBaseLoggingExtraKeys("zuul-scheduler", "zuul")
var zsloggingExtraKeys = logging.CreateBaseLoggingExtraKeys("zuul-scheduler", "zuul", "zuul-scheduler", r.ns)
// Change logLevel to what we actually want
zsloggingParams.LogLevel = string(zuulSchedulerLogLevel)
loggingData["zuul-scheduler-logging.yaml"], _ = utils.ParseString(
Expand All @@ -419,7 +419,7 @@ func (r *SFController) computeLoggingConfig() map[string]string {
}{zsloggingExtraKeys, zsloggingParams})

var zwloggingParams = logging.CreateForwarderConfigTemplateParams("zuul.web", r.cr.Spec.FluentBitLogForwarding)
var zwloggingExtraKeys = logging.CreateBaseLoggingExtraKeys("zuul-web", "zuul")
var zwloggingExtraKeys = logging.CreateBaseLoggingExtraKeys("zuul-web", "zuul", "zuul-web", r.ns)
// Change logLevel to what we actually want
zwloggingParams.LogLevel = string(zuulWebLogLevel)
loggingData["zuul-web-logging.yaml"], _ = utils.ParseString(
Expand All @@ -430,7 +430,7 @@ func (r *SFController) computeLoggingConfig() map[string]string {
}{zwloggingExtraKeys, zwloggingParams})

var zmloggingParams = logging.CreateForwarderConfigTemplateParams("zuul.merger", r.cr.Spec.FluentBitLogForwarding)
var zmloggingExtraKeys = logging.CreateBaseLoggingExtraKeys("zuul-merger", "zuul")
var zmloggingExtraKeys = logging.CreateBaseLoggingExtraKeys("zuul-merger", "zuul", "zuul-merger", r.ns)
// Change logLevel to what we actually want
zmloggingParams.LogLevel = string(zuulMergerLogLevel)
loggingData["zuul-merger-logging.yaml"], _ = utils.ParseString(
Expand Down
6 changes: 3 additions & 3 deletions doc/deployment/logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ The log JSON payload that is sent to your Fluent Bit collector is enriched with
|--------|------------------|
| labels_run | the "run" label in the pod's metadata; ie the name of the microservice emitting the log line |
| labels_app | the "app" label, it is always set to "sf" |
| podip | the IP address of the pod |
| podip | [DEPRECATED] the IP address of the pod |
| namespace | the namespace where the pod is running |
| nodename | the node where the pod is running |
| podname | the name of the pod where the service is running |
| nodename | [DEPRECATED] the node where the pod is running |
| podname | [DEPRECATED] the name of the pod where the service is running |
| log | the actual log line collected |
| component | the name of the component running the microservice; typically "zuul" or "nodepool" |
| container | the name of the container emitting the logs |
Expand Down
19 changes: 17 additions & 2 deletions doc/reference/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,28 @@ All notable changes to this project will be documented in this file.
### Added
### Removed
### Changed
### Fixed
### Security

## [v0.0.44] - 2024-10-08

### Added

- log forwarding - Added support for the [forward input](https://docs.fluentbit.io/manual/pipeline/inputs/forward).
The HTTP input is deprecated and support for it will be removed at a later point.
- log forwarding - improved fluent bit sidecar containers' resilience to OOM killing and backpressure issues.

### Removed
### Changed


- log forwarding - The HTTP input is **deprecated** and support for it will be removed at a later point.
- log forwarding - The predefined labels `podip`, `nodename` and `podname` are **deprecated**.
They are not supported in the Forward input for the Zuul and Nodepool components, and will
be removed for all components at a later point.

### Fixed

SF bootstrap-tenant command - fix the base pre-run playbook for container based job (wrong condition check)
- SF bootstrap-tenant command - fix the base pre-run playbook for container based job (wrong condition check)

### Security

Expand Down

0 comments on commit 7043c5d

Please sign in to comment.