Adding custom fields to Honeycomb traces in Rails by writing a Rack middleware

In our Rails app, installing the Honeycomb beeline magically gave us traces of all HTTP requests, with dozens of useful fields like ‘request.path’ and ‘response.status_code’. I really wanted the request verb (GET or POST) and I couldn’t find that. (It’s there, in ‘request.method’, I missed it. But still, it’s useful to know how to a …

Read moreAdding custom fields to Honeycomb traces in Rails by writing a Rack middleware

Develop in Docker: Node.js, Express, & PostgreSQL on Heroku

This post builds on the excellent tutorial from Tania Rascia: Create and Deploy a Node.js, Express, & PostgreSQL REST API. I want to build a little web app that can store some data! …without installing anything new on my computer. Here’s how to configure VSCode Remote Containers to do that. Installed on my machine: Docker …

Read moreDevelop in Docker: Node.js, Express, & PostgreSQL on Heroku

Honeycomb in Rails with separate dev and production events

Honeycomb made it suuuuuper easy to see traces of HTTP requests hitting my app. Right from my computer! We installed one gem, did one rails generate from a cut-and-paste their dataset creation page gave me. Start up rails server, hit http://localhost:3000, and boom! A thing on a graph in Honeycomb! That was cool. Except, um, …

Read moreHoneycomb in Rails with separate dev and production events

Honeycomb in Rails without hard-coding the API key

Today we hooked up Honeycomb to an app for the first time! It was easy and fun! Then we configured it so that we don’t have to commit our apikey. It’s a public repo. Anyone could grab our API key and send spurious events to our Honeycomb datasets, screwing up our information and costing us …

Read moreHoneycomb in Rails without hard-coding the API key

Read a file with promises in TypeScript on Node

import * as fs from “fs”; import { promisify } from “util”; const content: Promise<string> = promisify(fs.readFile)(“path/to/the/file”, { encoding: “UTF-8” }) I am tired of looking that up over and over every time I want to read a file into a promise in Node using TypeScript, so here it is. Next time, bring me here, Google. The promisify call turns fs.readFile from a callback-based method to a promise-based one. promisify accepts …

Read moreRead a file with promises in TypeScript on Node