Skip to content

Instantly share code, notes, and snippets.

@ericksoen
ericksoen / snow_day_bike_ride_incident.md
Created February 16, 2023 22:09
The curious case of the Snowy Day bike ride #LFIConf2023

The curious case of the snowy day bike ride

This incident debrief describes what was intended to be a routine 15-minute bike ride to pick up coffee and laminated pastry (croissant) in the Denver area prior to the first Learning From Incidents Conf 2023 keynote.

One of the great joys of bike commuting is that transit times are highly predictable under almost all operating circumstances—this includes inclement weather like snow. Transit times by bike are less impacted by factors like traffic, parking, driver availability, and bus timetables that affect other transportation modalities, e.g., private auto, ride share, and public transportation.

Instead of the predicted 15-minute ride, the trip took approximately twice as long as anticipated and contributed to the rider arriving at the keynote after it was scheduled to start.

Incident Narrative

@ericksoen
ericksoen / config.yaml
Created May 16, 2022 14:01
OpenTelemetry duplicate spans
receivers:
otlp:
protocols:
grpc:
http:
exporters:
otlp/nr:
endpoint: otlp.nr-data.net:443
headers:
api-key: ${NEWRELIC_API_KEY}
@ericksoen
ericksoen / invoke.sh
Created September 10, 2021 22:37
Generate authentication environment variables
# Value from previous step
client_secret=?
token_endpoint="http://${auth_service_name}:8080/auth/realms/opentelemetry/protocol/openid-connect/token"
issuer_url="http://${auth_service_name}:8080/auth/realms/opentelemetry"
docker build . -t otel-auth:latest
docker run `
-v $PWD/:/tmp/otel `
-e token_endpoint=$token_endpoint `
#!/bin/bash
find . -name "node_modules" -type d -prune -exec rm -rf '{}' +
find . -name ".venv" -type d -prune -exec rm -rf '{}' +
provider "aws" {
region = "us-east-1"
}
data "aws_iam_policy_document" "policy" {
statement {
effect = "Allow"
actions = ["s3:CreateBucket"]
resources = ["*"]
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": ["s3:createBucket"],
"Resource": "*"
}
]
}
{
"version": "2.0.0",
"tasks": [
{
"label": "echo",
"type": "shell",
"command": "echo Hello"
}
]
}
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Debug FizzBuzz",
"program": "${workspaceFolder}/fizzbuzz.js"
}
]
@ericksoen
ericksoen / index_spec.ts
Last active January 10, 2019 16:24
Schematic unit test with custom matcher against file snapshot
it('performs full test', () => {
let tree: UnitTestTree = new UnitTestTree(new HostTree());
tree.create('a/b/c.ts', 'typescript file should have a license');
const runner = new SchematicTestRunner('schematics', collectionPath);
const resultTree = runner.runSchematic('add-license', { sourceDir: 'a' }, tree);
expect(resultTree.files.length).toBe(1);
const filePath = path.join(__dirname, 'file-snapshots', 'performs-full-test.txt');
expect(resultTree.readContent('a/b/c.ts')).toMatchFileContentsAtPath(filePath);
@ericksoen
ericksoen / index_spec.ts
Last active January 10, 2019 15:44
Simple schematic unit test
it('performs partial test', () => {
const expectedLicenseText = 'Copyright Google Inc. All Rights Reserved';
let tree: UnitTestTree = new UnitTestTree(new HostTree());
tree.create('a/b/c.md', 'markdown file should not have a license added');
tree.create('a/b/c.ts', 'typescript file should have a license');
const runner = new SchematicTestRunner('schematics', collectionPath);
const resultTree = runner.runSchematic('add-license', { sourceDir: 'a' }, tree );