Sign in

João Antunes

@joao.antunes.dev
254 followers 279 following 352 posts

Code, headbang, grouch, repeat! 👨‍💻🤘😈🔁 Writing and talking about code, headbanging @ concerts, ranting @ anywhere. He/him antunes.dev & blog.codingmilitia.com

PostsRepliesMedia
João Antunes @joao.antunes.dev · 19/09/2026
post your slack react speed dial
010
João Antunes @joao.antunes.dev · 08/06/2026
Meme image of a man pointing to his head telling you to think, with the text: "no need to burn money on observability, if you never look at it anyway"
010
João Antunes @joao.antunes.dev · 03/06/2026
Anyone ever used IAsyncEnumerable along with custom activities (spans) in #CSharp #DotNet? Seems like the parent span is lost somewhere, and what should be child spans show at the top level. Used this "solution", but it's fugly, so if anyone has ever faced this, let me know 🙂
A C# code snippet with the following:

/*
 * looks like a massive hack 😅 (or is it)
 *
 * need to investigate further, but it seems yield breaks the activity flow
 *
 * storing it and restoring after seems to do the trick, but I'm not sure if this is a great idea
 */
var currentActivity = Activity.Current;

yield return mapper(columns, buffer);

Activity.Current = currentActivity;
210
João Antunes @joao.antunes.dev · 02/06/2026
😂
Notification saying I was added to a “Luddite Left” moderation list
000
João Antunes @joao.antunes.dev · 15/05/2026
🫥
Image of the following C# code:

using System;

Console.WriteLine(Enum.TryParse<Stuff>("99", out var x));
Console.WriteLine(x);

public enum Stuff { X, Y }

// output:
// True
// 99
000
João Antunes @joao.antunes.dev · 06/01/2026
Continuing preparing the chaos workshop, making use of the always reliable Spectre.Console to make things less boring 😅 #CSharp #DotNet #ChaosEngineering
A screenshot of a colorful command line application, executing a test battery to validate the results of a workshop exercise on the topic of chaos engineering.
001
João Antunes @joao.antunes.dev · 31/12/2025
And now, messing up with running containers, to add even more chaos 😅
A screenshot of some C# code, using the Docker client to mess up with running containers, in order to introduce some chaos into a system.
110
João Antunes @joao.antunes.dev · 31/12/2025
Messing around with YARP (and its request and response transform extensibility), adding some naive logic to introduce some chaos into a system, by means of latency and errors. #CSharp #DotNet #ChaosEngineering
A screenshot of some C# code, using YARP (and its request and response transform extensibility) plus some naive logic to introduce some chaos into the system, by means of latency and errors.
110
João Antunes @joao.antunes.dev · 08/09/2025
I was thinking about having some directory structure following some conventions, plus using some files using predefined formats to keep some metadata about schemas.
A screenshot of an example directory structure for a schema catalog, with directories for avro, protobuf, graphql and openapi.

Inside avro, there's a sample-domain directory, which then has a sample-event directory, with an index.toml file and directories for different versions of the avsc schemas.

Inside the openapi directory, something very similar, but with a spec.yaml file for the contract instead of avsc files.
100
João Antunes @joao.antunes.dev · 26/07/2025
What in the actual hell is this 💩? Saw someone sharing it, thought it was a joke, but alas, this is really there in the docs. I don't even have words to describe the utter nonsense that this is. #DotNet #CSharp learn.microsoft.com/en-us/dotnet...
Screenshot of a portion of .NET documentation about dictionaries, reading:

"Use AI to initialize a dictionary
You can use AI tools, such as GitHub Copilot, to generate C# code to initialize a dictionary with a collection initializer. You can customize the prompt to add specifics per your requirements.

The following text shows an example prompt for Copilot Chat:"

Then a "code" box appears with a prompt reading: "Generate C# code to initialize Dictionary<int, Employee> using key-value pairs within the collection initializer. The employee class is a record class with two properties: Name and Age."

Wraps up with the usual warnings about generative AI being crap, reading: "GitHub Copilot is powered by AI, so surprises and mistakes are possible. For more information, see Copilot FAQs"
2111
João Antunes @joao.antunes.dev · 30/06/2025
Gotta love methods and parameters with vague names. What's the unit for this size threshold? I have to assume it's bytes, but as the saying goes "assumption is the mother of all f***-ups", so I shouldn't be assuming anything 😒
A screenshot of a Java method named setSizeThreshold, which has a single parameter named sizeThreshold.

This method is part of a FileCompactionStrategy.Builder class, and serves to set the maximum file size before compaction is triggered.

Nowhere in the code does it say the unit associated with this size threshold.
100
João Antunes @joao.antunes.dev · 20/06/2025
I don't know why I even try this crap
Screenshot of a GitHub pull request, where GitHub Copilot did a review.

The review is basically useless, summarizing what was done, plus adding a comment saying that a transaction should be rolled back, when the code for that roll back is right there.
000
João Antunes @joao.antunes.dev · 16/06/2025
#OutboxKit 📤 now supports #PostgreSQL and #MongoDB, in addition to the originally supported #MySQL. outboxkit.yakshavefx.dev #DotNet #CSharp #OutboxPattern
OutboxKit banner image.

On the left, it includes an envelope, representing a message, a flat image representation of a yak's head, as well the text f(x).

On the right, the text "OutboxKit" is shown.
122
João Antunes @joao.antunes.dev · 16/05/2025
Replacing the battery of my UPS 🙃 The manual says it’s not user serviceable, but there are no authorized repair shops, so 🤡
A picture of an open UPS unit, during the process of replacing its battery. The internal circuitry is visible, though I can’t describe further, cause I don’t really know what it’s all does 😅
100
João Antunes @joao.antunes.dev · 17/04/2025
The rabbit holes I get myself into 😅 #Observability #OpenTelemetry #GrafanaFaro
A screenshot of 3 open windows: one with a docker compose file with Grafana Alloy and LGTM containers; one with a sample Next.js app using the Grafana Faro Web SDK; a final one with a Grafana dashboard for the signals collected in the sample app
200
João Antunes @joao.antunes.dev · 11/03/2025
Quick morning walk before work, to try to keep computers (and people... mostly people) from taking away my remaining sanity 😅
Photo of a path next to a water stream, surrounded by trees.
030
João Antunes @joao.antunes.dev · 18/02/2025
I spent way too much time (and I mean waaaaaaay too much) to finally figure out what I was missing to be able to use #MongoDb with replica sets in #Testcontainers for #DotNet, where the port is assigned randomly to avoid conflicts.
Screenshot of a bit of C# code, a Xunit fixture, setting up the usage of Testcontainers with MongoDB, with replica sets enable to use change streams. There's an arrow pointing to the connection string, where the directConnection flag is set to true.
120
João Antunes @joao.antunes.dev · 19/01/2025
🤣
Screenshot of the result of the champions league final in EA FC 25, between Crawley Town and Bayern Munich, where Crawley Town won
010
João Antunes @joao.antunes.dev · 26/12/2024
#TIL about the AsParameters attribute in #AspNetCore 😅 (it has been available since 7 😱) learn.microsoft.com/en-us/dotnet...
A code snippet showing the usage of the AsParameters attribute to map a complex object from different sources (in this case, route and body)
100
João Antunes @joao.antunes.dev · 07/12/2024
Trying to make things go brrrr 🏎️ #DotNet #CSharp #OutboxKit
Screenshot of a terminal, after running a K6 load test
140
João Antunes @joao.antunes.dev · 19/11/2024
Meanwhile... a colleague with a fresh pair of eyes was able to figure it out 🥳 So k8sattributes sets resource attributes, but aren't automatically set as metric labels. With the transform processor, we can map things and now have labels available.
A screenshot of a piece of OpenTelemetry collector configuration, setting up the transform processor to map resource attributes as labels
100
João Antunes @joao.antunes.dev · 19/11/2024
As for logs, I see things like this, but still no labels in the output
A log from the OpenTelemetry collector, regarding the processor k8sattributes
000
João Antunes @joao.antunes.dev · 19/11/2024
So, regarding permissions, I'm pretty sure I have more than I should, but I'm in the stage of throwing everything at the problem to get it working 😅
A piece of code configuring a Kubernetes cluster role, giving it permissions so the OpenTelemetry collector can gather metrics (and other signals)
200
João Antunes @joao.antunes.dev · 18/11/2024
Yep
Image of a OpenTelemetry collector configuration, trying to scrape Kubernetes metrics
100
João Antunes @joao.antunes.dev · 16/11/2024
I just keep going into rabbit hole after rabbit hole, instead of doing what I should be doing 😅 #DotNet
A screenshot of the results of a run of BenchmarkDotNet, comparing some different ways of looking up values in dictionaries when we have 2 strings to use as a key
030
João Antunes @joao.antunes.dev · 15/11/2024
... and here we go 😅
A screenshot of the newly released Warcraft 1 Remastered
001
João Antunes @joao.antunes.dev · 13/11/2024
Yearly #dnvm appreciation post, for helping keep #DotNet up to date without much fuss
Screenshot of the dmvm command line tool upgrading the DotNet SDK
030
João Antunes @joao.antunes.dev · 29/10/2024
I know I probably shouldn't... but I'll just do it anyway 🤣 #DotNet #CSharp #OutboxKit #MongoDb
Screenshot of a piece of code, indicating the implementation of class named DistributedLockThingy
010