Skip to content

Conversation

@petyosi
Copy link
Collaborator

@petyosi petyosi commented Sep 24, 2025

Fixes #64

@petyosi petyosi requested a review from Copilot September 24, 2025 10:48
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes an issue where formatted messages were being incorrectly used as span names instead of the original message templates. The change ensures that span names remain as the original template format while the formatted message is stored as a separate attribute.

  • Updated logfireFormatWithExtras to return an object instead of a tuple for better destructuring
  • Changed span creation to use msgTemplate as the span name instead of formattedMessage
  • Added ATTRIBUTES_MESSAGE_KEY to store the formatted message as an attribute

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
packages/logfire-api/src/index.ts Updated span creation functions to use template as span name and store formatted message as attribute
packages/logfire-api/src/formatter.ts Refactored return type from tuple to object for better readability
packages/logfire-api/src/constants.ts Added new constant for message attribute key
.changeset/cyan-bats-jump.md Added changeset entry for the fix

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@petyosi petyosi merged commit 8c57b16 into main Sep 24, 2025
2 checks passed
@petyosi petyosi deleted the petyo/fix-span-name branch September 24, 2025 10:52
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.

Span name should not include substitutions

2 participants