![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
puma-plugin-telemetry
Advanced tools
Puma plugin which should be able to handle all your metric needs regarding your webserver:
Add this line to your application's Gemfile:
gem "puma-plugin-telemetry"
And then execute:
$ bundle install
Or install it yourself as:
$ gem install puma-plugin-telemetry
In your puma configuration file (i.e. config/puma.rb
or config/puma/<env>.rb
):
plugin "telemetry"
Puma::Plugin::Telemetry.configure do |config|
config.enabled = true
# << here rest of the configuration, examples below
end
Output telemetry as JSON to STDOUT
config.add_target :io
Given gem provides built in target for Datadog StatsD client, that uses batch operation to publish metrics.
NOTE Be sure to have dogstatsd
gem installed.
config.add_target :dogstatsd, client: Datadog::Statsd.new
You can provide all the tags, namespaces, and other configuration options as always to Datadog::Statsd.new
method.
For detailed documentation checkout Puma::Plugin::Telemetry::Config
class.
Puma::Plugin::Telemetry.configure do |config|
config.enabled = true
config.initial_delay = 10
config.frequency = 30
config.puma_telemetry = %w[workers.requests_count queue.backlog queue.capacity]
config.socket_telemetry!
config.socket_parser = :inspect
config.add_target :io, formatter: :json, io: StringIO.new
config.add_target :dogstatsd, client: Datadog::Statsd.new(tags: { env: ENV["RAILS_ENV"] })
end
Target is a simple object that implements call
methods that accepts telemetry
hash object. This means it can be super simple proc
or some sophisticated class calling some external API.
Just be mindful that if the API takes long to call, it will slow down frequency with which telemetry will get reported.
# Example logfmt to stdout target
config.add_target proc { |telemetry| puts telemetry.map { |k, v| "#{k}=#{v.inspect}" }.join(" ") }
This gems comes together with middleware for measuring request queue time, which will be reported in request.env
and published to given StatsD client.
Example configuration:
# in Gemfile add `require` part
gem "puma-plugin-telemetry", require: ["rack/request_queue_time_middleware"]
# in initializer, i.e. `request_queue_time.rb`
Rails.application.config.middleware.insert_after(
0,
RequestQueueTimeMiddleware,
statsd: Datadog::Statsd.new(namespace: "ruby.puma", tags: { "app" => "accounts" })
)
Rails.application.config.log_tags ||= {}
Rails.application.config.log_tags[:queue_time] = ->(req) { req.env[::RequestQueueTimeMiddleware::ENV_KEY] }
This will provide proper metric in Datadog and in logs as well. Logs can be transformed into log metrics and used for auto scaling purposes.
After checking out the repo, run bin/setup
to install dependencies. Then, run bundle exec rake spec
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
.
All gem releases are manual, in order to create a new release follow:
VERSION
, we use Semantic VersioningCHANGELOG
v#{VERSION}
as a tag, i.e. v0.1.0
Bug reports and pull requests are welcome on GitHub at https://github.com/babbel/puma-plugin-telemetry.
The gem is available as open source under the terms of the MIT License.
Everyone interacting in the puma-plugin-telemetry project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.
FAQs
Unknown package
We found that puma-plugin-telemetry demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.