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

Add custom data helper #1147

Closed
tombruijn opened this issue Jul 4, 2024 · 0 comments · Fixed by #1149
Closed

Add custom data helper #1147

tombruijn opened this issue Jul 4, 2024 · 0 comments · Fixed by #1149
Assignees

Comments

@tombruijn
Copy link
Member

Our sample data docs give this example.

Appsignal::Transaction.current.set_sample_data(
  "custom_data",
  :i18n => {
    :locale => "en_GB",
    :default_locale => "en_US"
  }
)

Let's add a custom helper for this like Appsignal.set_custom_data and Appsignal::Transaction#set_custom_data

@tombruijn tombruijn self-assigned this Jul 4, 2024
tombruijn added a commit that referenced this issue Jul 4, 2024
I saw we tell people in our docs to use the
`Appsignal::Transaction#set_sample_data` method. Let's not do that.

Here's a helper to hide all those internals away and make it less likely
to break when setting custom data as sample data.

I considered adding logic to merge the custom data, but merging these
values is quite tricky because it can be both a Hash and an Array as the
root object. It's not something I want to think about right now. If we
want to add this in the future, we can also name that helper
`add_custom_data` to differentiate between setting and merging the
custom data.

Closes #1147
tombruijn added a commit that referenced this issue Jul 4, 2024
I saw we tell people in our docs to use the
`Appsignal::Transaction#set_sample_data` method. Let's not do that.

Here's a helper to hide all those internals away and make it less likely
to break when setting custom data as sample data.

I considered adding logic to merge the custom data, but merging these
values is quite tricky because it can be both a Hash and an Array as the
root object. It's not something I want to think about right now. If we
want to add this in the future, we can also name that helper
`add_custom_data` to differentiate between setting and merging the
custom data.

Closes #1147
tombruijn added a commit that referenced this issue Jul 8, 2024
I saw we tell people in our docs to use the
`Appsignal::Transaction#set_sample_data` method. Let's not do that.

Here's a helper to hide all those internals away and make it less likely
to break when setting custom data as sample data.

I considered adding logic to merge the custom data, but merging these
values is quite tricky because it can be both a Hash and an Array as the
root object. It's not something I want to think about right now. If we
want to add this in the future, we can also name that helper
`add_custom_data` to differentiate between setting and merging the
custom data.

Closes #1147
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.

1 participant