-
Notifications
You must be signed in to change notification settings - Fork 80
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 instrumentation using :telemetry #176
base: master
Are you sure you want to change the base?
Conversation
Hi, thank you for using the library and for the PR. This is some nice work! In the meantime, can you please merge in I can also see that at the moment the telemetry tests are failing with Elixir 1.14 (is it incompatible?), but the good news is that I'm dropping support for Elixir 1.14 (it's removed from CI on master), so that won't be a concern. Still, I'd be curious to know why it's failing there. |
mix.exs
Outdated
@@ -80,7 +80,9 @@ defmodule FunWithFlags.Mixfile do | |||
|
|||
{:ex_doc, "~> 0.21", only: :dev, runtime: false}, | |||
{:credo, "~> 1.7", only: :dev, runtime: false}, | |||
{:dialyxir, "~> 1.0", only: :dev, runtime: false} | |||
{:dialyxir, "~> 1.0", only: :dev, runtime: false}, | |||
{:telemetry_test, "~> 0.1", only: :test, runtime: false}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about this package. It looks like it's not really much used in the ecosystem: https://hex.pm/packages/telemetry_test
Is there any other way to test telemetry?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes for sure, https://hex.pm/packages/telemetry_test just abstract away the setup for telemetry event handler. But now i have updated the tests without using the telemetry_test package.
I love this idea, I was thinking of building an ad hoc solution to solve this problem Is there anything pending to be able to add this to the library? |
This PR adds instrumentation to FunWithFlags using the
:telemetry
library. This allows users to gain insights into the performance and usage of feature flags in their applications.Key changes:
[:fun_with_flags, :flag_operation]
event nameNew telemetry events:
[:fun_with_flags, :flag_operation]
duration
: Time taken for the operation in native time unitsflag_name
: Name of the flag being operated onoperation
: Type of operation (:enable, :disable, :clear, or :enabled?)options
: Any options passed to the operationresult
: Result of the operationThis change is backwards compatible and does not affect existing functionality. Users can choose to attach handlers to these events to collect metrics or perform logging.
This PR aims to provide better observability for applications using FunWithFlags, allowing for easier debugging, performance monitoring, and usage analytics.
Testing:
Next steps:
Feedback and suggestions are welcome! @tompave