Quantcast
Channel: Christopher Davis – Christopher Davis
Browsing index pages (21 articles)
↧

How to Test Code that Executes Subprocesses

I was writing some stuff that programmatically executed terraform via Hashicorp's terraform-exec library this week. This works by interacting with a terraform executable that you provide (along with a...

View Article


Map and Filter with Generics and Go 1.23 Iterators

I found myself missing map and filter constructs for some small things in Go, and here we are. Go 1.18 got generics, and I've admittedly not used them too much in real apps. Go 1.23 brought iterators....

View Article


How to Debug OAuth Auth Code Login Flows

This is from the oauth clients perspective. Some piece of software is implementing a login with Google or Github or {socialPlatform}, and it's not working. Client and Authorization Server are terms...

View Article

A (Small) Observability 2.0 Success Story

At PMG, we've spent the last few months instrumenting our applications with OpenTelemetry and integrating with a tracing vendor. Part of this, for me, was reading the Observability Engineering book,...

View Article

How to Send AWS EventBridge Events to CloudWatch Logs

Ostensibly this is easy. Set an event rule target to a log group and it Just Works (tm). I suspect that's probably the case in the AWS UI, but with infra as code there's a missing piece: cloudwatch...

View Article


Test Setup and Teardown Methods in Go

How to mimic XUnit-style setUp and tearDown methods in Go.… Continue reading Test Setup and Teardown Methods in Go →

View Article

Dependency Inversion with Client Side Interfaces in Go

One interesting thing about Go is that it lacks and explicit implements keyword for interfaces. If you want to implement an interface, there's no extra step. As long as function signatures match the...

View Article

Dependency Inversion in Go HTTP Handlers

This post has a lot of Go, but I suspect its relevant to any programming language with first class functions. I've been doing some more work in Go the last month or so. One bit of advice I really like...

View Article


Using DataDog Sampling Rules to Exclude Traces

There are some docs on this, but it took way to much trial and error on my part to figure it out, so hopefully this helps some future person (or future me!). The gist of this is there are two ways to...

View Article


Running Database Integration Tests in Go

I'm working through writing a Go app backed by a PostgreSQL database (using sqlx). Whenever I'm writing code that interacts with a database, I want to make sure that I'm testing against the real thing...

View Article

Conditionally Applying Middlware in Go

I've been prototyping some stuff with Huma, and, while it lets your bring your own router, that doesn't mean that all features of the router are available to you. My problem was that I wanted API...

View Article

Beware Blocking Channel Sends in Go

I recently got bit by a blocking channel send in Go causing an entire program to hang. I had gorouting thing running on a timer to check something periodically and send results to a channel. Another...

View Article

Reading a GZipped File from S3 to Memory in NodeJS

Specifically, I had firehose landing some small-ish files in S3 that were gzipped. Each file has a JSON object per row and I need to get the contents of that file into a lambda for processing. SO...

View Article


Alarming on a High Lambda Error Rates

AWS Lambda has this nice graph on the monitor page for an indivdiaul lambda function that shows its success rate. Recently I had a lambda that was broken due to a failed build during a terraform apply....

View Article

Using Docker Health Checks to Wait for Development Environment Services

At PMG we use Docker and Docker Compose to spin up backing services for local development and continuous integration -- think things like databases, cache, or localstack. One challenge, especially in a...

View Article


Cross-Account waitForTaskToken in AWS Step Functions

One small gotcha in AWS Step Functions is that the waitForTaskToken integration pattern only really works within the same AWS account (and region). You must pass task tokens from principals within the...

View Article

What I Learned at AI Conference

This week I attended AI Conference in San Francisco. I don't really do a lot of work with machine learning or generative AI, but the entire software world is shifting in that direction so... gotta keep...

View Article


Deploying a Single SPA Application on AWS

This post is a follow up to Hosting a Single Page Application in AWS. It builds on that article with some specifics for the Single SPA micro frontend famework. There are couple core problems to solve...

View Article

Hosting a Single Page Application in AWS

Last year I started using Single SPA as framework for a microfrontend based single page application. Part of this was figuring out how to even host a single page application in AWS. I wanted to do this...

View Article

Create Your Own Certificate Authority with Terraform

I did this for an EC2 Client VPN Endpoint and certificate based authentication in a continuous integration environment. It might also be suitable for localhost certificates and is pretty much what...

View Article
Browsing index pages (21 articles)


Latest Images