
Security News
Risky Biz Podcast: Making Reachability Analysis Work in Real-World Codebases
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
bristol-stackdriver
Advanced tools
[](https://www.npmjs.com/package/bristol-stackdriver) [](https://david-dm.org/taxfyle/bri
This package provides a Bristol target + formatter that sends logs to Google Cloud Stackdriver.
With npm
:
npm install bristol-stackdriver
Or with yarn
yarn add bristol-stackdriver
Import the target
and formatter
and add them to your Bristol instance.
import Bristol from 'bristol'
import * as stackdriver from 'bristol-stackdriver'
const logger = new Bristol()
logger.withFormatter(stackdriver.formatter())
logger.info('Hello Stackdriver!', { shoop: 'da whoop' })
logger.error('Uh-oh', new Error('best check me out'))
bristol-stackdriver
has a few tricks up its' sleeve. The examples only present relevant configuration changes for brevity.
Stackdriver supports labels. To add labels to your log messages, use the sd:labels
field when logging.
logger.info('Starting flux capacitor', {
'sd:labels': { phase: 'startup', module: 'flux-capacitor' }
})
logger.info('Starting reactor', {
'sd:labels': { phase: 'startup', module: 'reactor' }
})
logger.error(
'Reactor meltdown!!!1111ONEONEONE',
new Error('core temp too high'),
{
'sd:labels': { module: 'reactor' }
}
)
user
and httpContext
for Error ReportingError Reporting can show request/response information about an error, as well as the ID of the user.
In order for the transport to submit that info, you need to attach it using sd:req
, sd:res
(or sd:httpContext
) and sd:user
.
http.createServer((req, res) => {
res.statusCode = 400
logger.error(new Error('Go away'), {
'sd:req': req,
'sd:res': res,
'sd:user': req.user.id
})
})
Alternatively, if you want to specify the HTTP context yourself.
http.createServer((req, res) => {
res.statusCode = 400
logger.error(new Error('Go away'), {
'sd:httpContext': {
method: req.method
/* ... */
}
})
})
In fact, using sd:req
and sd:res
is the exact same as doing:
import { collectHttpContext } from 'bristol-stackdriver'
logger.error(new Error('Go away'), {
'sd:httpContext': collectHttpContext(req, res)
})
You will need a Google Cloud Project ID + keyfile to run the tests!
You can either add the project ID + keyfile (JSON stringified) to your own environment (GCLOUD_PROJECT=your-project-id GCLOUD_CREDENTIALS="{\"type\": \"...\"}"
), or you can create an env.yaml
in the repository root, and add the following:
test:
GCLOUD_PROJECT: your-project-id
GCLOUD_CREDENTIALS: >
{
"type": "...",
<..remaining key...>
}
Taxfyle Engineering — @taxfyle
Or, more specifically, this handsome devil. This is the guy to complain to if stuff isn't working.
FAQs
[](https://www.npmjs.com/package/bristol-stackdriver) [](https://david-dm.org/taxfyle/bri
The npm package bristol-stackdriver receives a total of 124 weekly downloads. As such, bristol-stackdriver popularity was classified as not popular.
We found that bristol-stackdriver demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 20 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.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
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.