Skip to content

Fix/telemetry #13

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Fix/telemetry #13

wants to merge 7 commits into from

Conversation

jacobbamio
Copy link
Contributor

🚪 Why?

This Pull Request addresses feedback from a previous PR by refining the implementation and aligning it with requested changes. The goal is to improve code clarity, idiomatic usage, and test coverage.

🔑 What?

This PR introduces the following changes based on reviewer comments:

  • Updates the telemetry settings attribute from is_enabled to enabled for a more idiomatic Ruby style.
  • Adds contexts to the telemetry settings specs to improve tests behavior.

🏡 Context

@jacobbamio jacobbamio requested a review from a team as a code owner July 24, 2025 12:44
@jacobbamio jacobbamio requested a review from oriolgual July 24, 2025 12:44
Comment on lines +11 to +14
RUBY_TO_API_KEY_MAPPING = T.let({
'enabled' => 'is_enabled'
}.freeze,
T::Hash[String, String])
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

in order to be more idiomatic for ruby, while using the required Mastra API prop. I explored putting it directly in the camelized options with an if clause, but if in the future we adapt other API methods that are not idiomatic for Ruby, this way we just add it to the hash.

I'm changing this because before we had the is_enabled, which was the Mastra prop name, but you told me to use enabled to be more idiomatic ( which I think is a good tip tbh ).

Any other approach you think would be better?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, sorry. What I mean is that this feels very complex just for one particular case. When you pass the telemetry settings to the options, couldn't the settings itself know how to serialize themselves (so returning a hash with is_enabled) instead of having the client know about this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes hella more sense, yup, ty

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.

2 participants