
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
mercurius-apollo-tracing
Advanced tools
[](https://github.com/nearform/mercurius-apollo-tracing/actions/workflows/ci.yml)
Fastify plugin to be used with Mercurius to collect performance metrics from your Graphql resolvers and send them to apollo studio.
npm i mercurius-apollo-tracing
plugin can be registered like this:
const fastify = require('fastify')
const mercuriusTracing = require('mercurius-apollo-tracing')
const app = fastify()
// you need this if you want to be able to add the server to apollo studio
// they ping your server directly from the browser
app.register(require('fastify-cors'))
app.register(mercurius, {
schema,
resolvers,
graphiql: true
}) // must be done before registering mercuriusTracing
app.register(mercuriusTracing, {
apiKey: 'your:Api:Key', // replace 'your:Api:Key' with the one from apollo studio
graphRef: 'yourGraph@ref' // replace 'yourGraph@ref'' with the one from apollo studio
})
You can flush traces manually at any time by :
app.apolloTracingStore.flushTracing()
endpointUrl?: string
graphRef: string
apiKey: string
sendReportsImmediately?: boolean
default: false
reportIntervalMs?: number
default: 10000
maxUncompressedReportSize?: number
default: 4194304
maximum size of the payload in bytes
checkReportSizeRequestCountInterval?: number
default: 100
If you are running in lambda-like environment, keep in mind to pass sendReportsImmediately: true
flag to registration options to make sure the report is send before process exits.
Plugin hooks into each resolver in your schema, so performance will be negatively affected. Performance will be impacted more if you have many fast/small resolvers. If you have less resolvers and it takes more time to resolve them, perf difference is lower. We've measured it in the benchmark here and observed slow down of roughly 25 percent. This is still smaller penalty than compared to running with tracing on apollo-server-fastify. Also in real world API where resolvers actually do something the difference will be much smaller though. These were actual results:
server | Without tracing(Requests/s) | With tracing enabled(Requests/s) |
---|---|---|
apollo-server-fastify+graphql-jit | 4162.8 | 1478.4 |
mercurius | 9162 | 6866 |
Ran on Ubuntu 21.04, Node 16.7.0 and AMD Ryzen 5900x.
Yes this plugin works fine with them.
Yes, this plugin supports batched queries.
FAQs
[](https://github.com/nearform/mercurius-apollo-tracing/actions/workflows/ci.yml)
We found that mercurius-apollo-tracing demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers 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
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.