Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
yabeda-http_requests
Advanced tools
Built-in metrics for external services HTTP calls! This gem is a Part of the yabeda suite.
Read introduction article on dev.to.
Works as the Puma plugin and provides following metrics:
http_request_total
- the number of external HTTP request attempts (by host, port, method)http_response_total
- the number of made external HTTP requeusts (by host, port, method, status)http_response_duration
- the histogram of response duration (by host, port, method, status)Add this line to your application's Gemfile:
gem 'yabeda-http_requests'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install yabeda-http_requests
After plugin the gem, you just have to set up metrics exporting with yabeda-prometheus gem.
The metrics page will look like this:
# TYPE http_requests_total_count counter
# HELP http_requests_total_count A counter of the total number of external HTTP requests.
http_request_total{host="twitter.com",port="443",method="GET",query="/dsalahutdinov1"} 149.0
http_request_total{host="dev.to",port="443",method="GET",query="/amplifr"} 145.0
...
To simple set up Grafana, try the sample dashboard.
Sample application aims to show how Ruby web-application, this gem and Prometheus/Grafana work togather.
Get into example
directory and run docker compose:
$ cd example
$ docker-compose up
After docker image builds and all the services get up, you can browse application endpoints:
admin/foobar
as login and password to get in. Grafana already has specific dashboard with data visualisation.Follow the yabeda-external-http-requests dashboard in Grafana. Finally, after a couple of minutes when data collected you will see the following:
Get local development environment working and tests running is very easy with docker-compose:
docker-compose run app bundle
docker-compose run app bundle exec rspec
Bug reports and pull requests are welcome on GitHub at https://github.com/yabeda-rb/yabeda-http_requests.
Bump version number in lib/yabeda/http_requests/version.rb
In case of pre-releases keep in mind rubygems/rubygems#3086 and check version with command like Gem::Version.new(Yabeda::VERSION).to_s
Fill CHANGELOG.md
with missing changes, add header with version and date.
Make a commit:
git add lib/yabeda/http_requests/version.rb CHANGELOG.md
version=$(ruby -r ./lib/yabeda/http_requests/version.rb -e "puts Gem::Version.new(Yabeda::HttpRequests::VERSION)")
git commit --message="${version}: " --edit
Create annotated tag:
git tag v${version} --annotate --message="${version}: " --edit --sign
Fill version name into subject line and (optionally) some description (list of changes will be taken from changelog and appended automatically)
Push it:
git push --follow-tags
GitHub Actions will create a new release, build and push gem into RubyGems! You're done!
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that yabeda-http_requests 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.