Skip to content

Conversation

tdeebswihart
Copy link
Contributor

@tdeebswihart tdeebswihart commented May 9, 2025

What changed?

I've changed some of the tags I altered in #7738 back to StringTags from StringerTags and added usage recommendations to the StringerTag (and StringersTag) methods.

Why?

@prathyushpv rightly pointed out that some of the tags I changed in #7738 are applied to the loggers themselves and not just the messages. This means that the String() method will be invoked every time a log is to be emitted. This incurs extra allocations etc. etc.

Also document the tags so it's clear. Thanks to @prathyushpv for finding
this issue
@tdeebswihart tdeebswihart requested a review from prathyushpv May 9, 2025 12:45
@tdeebswihart tdeebswihart requested a review from a team as a code owner May 9, 2025 12:45
@tdeebswihart tdeebswihart merged commit 6141dd6 into main May 9, 2025
53 of 54 checks passed
@tdeebswihart tdeebswihart deleted the tds-zap-smarter-stringer-tag-usage branch May 9, 2025 17:40
josesa added a commit to josesa/temporal that referenced this pull request May 12, 2025
* main: (22 commits)
  Add host health metrics gauge (temporalio#7728)
  add rule expiration check (temporalio#7749)
  Add activity options to the pending activity info (temporalio#7727)
  Enable DLQ V2 for replication (temporalio#7746)
  chore: be smarter about when to use Stringer vs String (temporalio#7743)
  versioning entity workflows: enabling auto-restart pt1 (temporalio#7715)
  Refactor code generators (temporalio#7734)
  allow passive to generate replication tasks (temporalio#7713)
  Validate links in completion callbacks (temporalio#7726)
  CHASM: Engine Update/ReadComponent implementation (temporalio#7696)
  Enable transition history in dev env and tests (temporalio#7737)
  chore: Add Stringer tags (temporalio#7738)
  Add internal pod health check to DeepHealthCheck (temporalio#7709)
  Rename internal CHASM task processing interface (temporalio#7730)
  [Frontend] Log slow gRPC requests (temporalio#7718)
  Remove cap for dynamic config callback pool (temporalio#7723)
  Refactor updateworkflowoptions package (temporalio#7725)
  Remove a bunch of redundant utf-8 validation (temporalio#7720)
  [CHASM] Pure task processing - GetPureTasks, ExecutePureTasks (temporalio#7701)
  Send ActivityReset flag to the worker in heartbeat response (temporalio#7677)
  ...
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.

2 participants