Skip to content

Conversation

@temporal-nick
Copy link
Contributor

What changed?

Added a new package logging and config map logConfigs["component"]=LoggingConfig{} to allow log throttles to be configured per-component. Logging configs are referenced directly by name and may set the rate of logs or disable logs for that config. A config not explicitly set in the yaml falls back to the root logger.

Why?

There have been many times when we've wanted to specify different log throttles for different kinds of logs, and as we did so we ended up creating multiple throttledLogForXYZ members. This allows a single place to easily configure log throttles, and to easily add and remove custom log configs as needed.

@temporal-nick temporal-nick requested a review from a team as a code owner January 7, 2026 20:06
func (l *loggerProvider) Get(component LogComponentName) log.Logger {
logger, exists := l.loggers[component]
if !exists {
logger = l.root
Copy link
Collaborator

Choose a reason for hiding this comment

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

so if component doesn't exist, then the default behavior is to use root which means always log right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, though the default logger can be set with a throttle as well.

Comment on lines 77 to 82
adminservice:
throttleMaxRPS: 10
testexample:
throttleMaxRPS: 11
adminstreams:
throttleMaxRPS: 12
Copy link
Collaborator

Choose a reason for hiding this comment

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

should we always config adminservice and adminstreams and treat logConfigs as overrides? this is to avoid adding these configs in all yaml files.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hm, yeah some defaults based on the old values is probably a good idea. I'll add a block in logging

profiling: {}
logConfigs:
adminservice:
throttleMaxRPS: 10
Copy link
Collaborator

Choose a reason for hiding this comment

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

can RPS be < 1?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, will update to demonstrate it

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