Skip to content

Sentry.start_transaction with name not work correctly #1540

Closed
@elct9620

Description

@elct9620

Describe the bug

When using Sentry.start_transaction with name, the Sentry receives <unlabeled transaction> instead of configured name.

To Reproduce

transaction = Sentry.start_transaction(name: "GameServer#command", op: "execute_command")
# Do something
transaction.finish

Expected behavior

截圖 2021-08-18 下午10 06 15

Above result should use Sentry.get_current_scope.set_transaction_name to generate it.

Sentry.get_current_scope.set_transaction_name("GameServer#command")
transaction = Sentry.start_transaction(op: "execute_command")
# Do something
transaction.finish

According to the source code, the Scope keeps a transaction_names array as the Sentry event transaction name, but the Sentry::Transaction#name is correctly configured but not used in Sentry event.

Actual behavior

截圖 2021-08-18 下午10 06 12

Environment

  • Ruby Version: 2.7.3
  • SDK Version: 4.6.5
  • Integration Versions (if any): N/A

Sentry Config

This is not necessary but could be helpful.

Sentry.init do |config|
  config.breadcrumbs_logger = [:sentry_logger, :http_logger]
  config.traces_sample_rate = ENV.fetch('SENTRY_SAMPLE_RATE', 1).to_f
end

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions