
Security News
CISA’s 2025 SBOM Guidance Adds Hashes, Licenses, Tool Metadata, and Context
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Manages a Request-Id
for each HTTP request. Hooks transparently into Faraday and service-client to pass request ids on to subsequent calls to other services. This way errors can be tracked through all layers and apps of your infrastructure easily.
The easiest way to add request ids to your system is to add the Qs::Request::Tracker::Middleware
as a middleware to your app.
require 'qs/request/tracker'
Rack::Builder.new do
use Qs::Request::Tracker::Middleware
run YourApp.new
end
This will add the request id to the response. If there is no Request-Id
HTTP header set in the request it will also set that. Please note that all middlewares that are included before it will not have that header set!
If you are using Faraday you transparently add the request id to all outgoing HTTP calls, too.
require 'faraday'
# make sure to require this middleware after faraday itself
require 'qs/request/tracker/faraday_middleware'
conn = Faraday.new(:url => 'http://example.com') do |faraday|
# it is important to have the request_id middleware inserted before any Faraday adapter
faraday.request :request_id
end
All requests done by that connection will now have a Request-Id
http header set that equal the one from the request that came into your system. If this is used not within a request context that header will just not get set.
Imporant: This feature relies on thread local variables and will not work if you deal with more than one request per thread at a time!
This approach is inspired by Andy's talk on debugging large scale systems.
This extension will automatically use the Faraday middleware for service-client connections that use the Service::Client::Adapter::Faraday
adapter.
require 'service-client'
# make sure to require this extension after service-client itself
require 'qs/request/tracker/service_client_extension'
client = Service::Client.new('http://example.com/')
client.urls.add(:root, :get, "/")
client.get(client.urls.root, oauth_token)
This will then heave the Request-Id
http header set through the Faraday middleware.
FAQs
Unknown package
We found that qs-request-tracker 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
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.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.