Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@allingeek-gremlin/failure-flags
Advanced tools
Failure Flags is a node SDK for working with the Gremlin fault injection platform to build application-level chaos experiments and reliability tests. This library works in concert with Gremlin-Lambda, a Lambda extension, or Gremlin-Container a conatiner s
Failure Flags is a node SDK for working with the Gremlin fault injection platform to build application-level chaos experiments and reliability tests. This library works in concert with Gremlin-Lambda, a Lambda extension, or Gremlin-Container a conatiner sidecar agent. This architecture minimizes the impact to your application code, simplifies configuration, and makes adoption painless.
Just like feature flags, Failure Flags are safe to add to and leave in your application. Failure Flags will always fail safe if it cannot communicate with its sidecare or its sidecar is misconfigured.
You can get started by adding @gremlin/failure-flags to your package dependencies:
npm i --save @allingeek-gremlin/failure-flags
Then instrument the the part of your application where you want to inject faults.
const failureflags = require(`@allingeek-gremlin/failure-flags`);
...
await failureflags.ifExperimentActive({
name: 'flagname', // the name of your failure flag
labels: {}) // additional attibutes about this invocation
...
The best spots to add a failure flag are just before or just after a call to one of your network dependencies like a database or other network service. Or you can instrument your request handler and affect the way your application responses to its callers. Here's a simple Lambda example:
// Note: you must bring in the failure-flags library
const gremlin = require('@allingeek-gremlin/failure-flags');
module.exports.handler = async (event) => {
start = Date.now();
// If there is an experiment defined for this failure-flag, that is also
// targeting the HTTP method and or path then this will express the
// effects it describes.
await gremlin.ifExperimentActive({
name: 'http-ingress',
labels: {
method: event.requestContext.http.method,
path: event.requestContext.http.path }});
return {
statusCode: 200,
body: JSON.stringify(
{processingTime: Date.now() - start, timestamp: event.requestContext.time},
null,
2
),
};
};
You can always bring your own behaviors and effects by providing a behavior function. Here's another Lambda example that writes the experiment data to the console instead of changing the application behavior:
// Note: you must bring in the failure-flags library
const gremlin = require('@allingeek-gremlin/failure-flags');
module.exports.handler = async (event) => {
start = Date.now();
// If there is an experiment defined for this failure-flag, that is also
// targeting the HTTP method and or path then this will express the
// effects it describes.
await gremlin.ifExperimentActive({
name: 'http-ingress',
labels: {
method: event.requestContext.http.method,
path: event.requestContext.http.path },
behavior: async (experiment) => {
console.log('handling the experiment', experiment);
}});
return {
statusCode: 200,
body: JSON.stringify(
{processingTime: Date.now() - start, timestamp: event.requestContext.time},
null,
2
),
};
};
FAQs
Failure Flags is a node SDK for working with the Gremlin fault injection platform to build application-level chaos experiments and reliability tests. This library works in concert with Gremlin-Lambda, a Lambda extension, or Gremlin-Container a conatiner s
We found that @allingeek-gremlin/failure-flags 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.