Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sentry.start_transaction with name not work correctly #1540

Closed
elct9620 opened this issue Aug 18, 2021 · 1 comment · Fixed by #1546
Closed

Sentry.start_transaction with name not work correctly #1540

elct9620 opened this issue Aug 18, 2021 · 1 comment · Fixed by #1546
Assignees

Comments

@elct9620
Copy link

elct9620 commented Aug 18, 2021

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
st0012 added a commit that referenced this issue Aug 21, 2021
This makes transaction event's transaction being overriden when
`Transaction#finish` is called.

Fixes #1540.
@st0012
Copy link
Collaborator

st0012 commented Aug 21, 2021

@elct9620 thanks for catching this issue 👍 I've opened #1546 to address it 🙂

st0012 added a commit that referenced this issue Aug 21, 2021
st0012 added a commit that referenced this issue Aug 21, 2021
* Don't apply Scope's transaction name if it's empty

Fixes #1540.

* Update changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants