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

feat(tracing): Allow transaction renaming [NATIVE-438] #651

Merged
merged 3 commits into from
Jan 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions include/sentry.h
Original file line number Diff line number Diff line change
Expand Up @@ -1440,6 +1440,12 @@ SENTRY_EXPERIMENTAL_API void sentry_span_set_data(
SENTRY_EXPERIMENTAL_API void sentry_span_remove_data(
sentry_value_t span, const char *key);

/**
* Sets a transaction's name.
*/
SENTRY_EXPERIMENTAL_API void sentry_transaction_set_name(
sentry_value_t tx, const char *name);

#endif

#ifdef __cplusplus
Expand Down
6 changes: 6 additions & 0 deletions src/sentry_value.c
Original file line number Diff line number Diff line change
Expand Up @@ -1326,3 +1326,9 @@ sentry_transaction_remove_data(sentry_value_t transaction, const char *key)
{
sentry_span_remove_data(transaction, key);
}

void
sentry_transaction_set_name(sentry_value_t tx, const char *name)
{
sentry_value_set_by_key(tx, "transaction", sentry_value_new_string(name));
Copy link
Contributor

Choose a reason for hiding this comment

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

this can return an error if tx was not an object... is it really a good idea to make this void?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This problem should solve itself once we have strong types.

Copy link
Contributor

Choose a reason for hiding this comment

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

true, fain enough

Copy link
Contributor

Choose a reason for hiding this comment

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

*fair

}