
Security News
Nx npm Packages Compromised in Supply Chain Attack Weaponizing AI CLI Tools
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
HttpStatsd provides a HTTP proxy for the statsd protocol. The use case is when you need to collect metrics from an external source, but for obvious reasons don't want to expose the udp interface of statsd.
It also provides a client for that proxy for easy integration with Ruby code.
Add this line to your application's Gemfile:
gem 'http_statsd'
And then execute:
$ bundle
Or install it yourself as:
$ gem install http_statsd
There is an example config.ru
file included in the repo. To use the proxy,
you need to provide at least one api key, with:
HttpStatsd::Server.set :api_keys, {
"username1" => "pass1",
"username2" => "pass2"
}
You can also set the statsd server host and port (default is "localhost:8125"):
HttpStatsd::Server.set :statsd_host, "statsd.example.com"
HttpStatsd::Server.set :statsd_port, 8125
To access the server, you can use the built in client:
c = HttpStatsd::Client.new(base_uri: "http://statsd.example.com",
username: "username1", password: "pass1")
Then, you can use the same interface as with the statsd-ruby gem:
sample_rate = 0.1
c.increment("metric.counter", sample_rate)
c.decrement("metric.counter", sample_rate)
c.count("metric.counter", 121, sample_rate)
c.gauge("metric.gauge", 123)
c.timing("metric.timing", 15.52, sample_rate)
c.batch do |b| # this will send the metrics as one http request
b.increment("metric.counter")
b.gauge("metric.gauge", 120)
end
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that http_statsd demonstrated a not healthy version release cadence and project activity because the last version was released 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
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.