Understanding Prometheus' changes() function and what it can do for me

Recently, roidelapluie wrote an interesting comment on my entrywishing that Prometheus had features to deal with missing metrics that suggested answering my questionabout how many times alerts fired over a time interval with a clever(or perhaps obvious) use of the changes() function:

changes(ALERTS_FOR_STATE[1h])+1

When I tried this out, I had one of those 'how does this work' momentsuntil I thought about it more. To understand why this works as well asit does


Nil in Go is typed in theory and sort of untyped in practice

I was recently reading Down the Golang nil Rabbit Hole ( via ), andran into the statement part way through:

So here’s a fun fact, Go has multiple “types” of nil .Specifically, there are both typed and untyped nil variables.

Some of you reading this are now reaching for your keyboards ( cf ), and that was my first reaction too. ButI think it's more interesting to talk about how someone could windup feeling that nil is sometimes untyped, because Go'


What tool you use to read IPMI sensor information can matter

Most modern servers have some sort of onboard IPMI (sometimes called a service processor), and there are good reasonsto want to read the IPMI's sensors instead of relying purely on whatever sensor readings you can get from the Linux kernel .There are a number of open source projects for reading IPMI informationon Linux (and sometimes other systems); I have direct experience with ipmitool and FreeIPMI , and the Arch wiki lists a fewmore .

Until very recently I would have told you that these tools weremore or


The attractions of reading sensor information from IPMIs

Most modern servers have some sort of onboard IPMI (sometimes called a service processor), and commonly the IPMI hasaccess to information from various sensors, which it can provideto you on demand. Usually you can query the IPMI both locally andover the network (if you've connected the IPMI to the network atall). In addition, CPUs, motherboards, and various components suchas NVMe drives and GPU cards can have their own sensors, which theserver's operating system can expose to you.


Internet routing can now vary based on things you wouldn't expect

Today Toronto had a little issue with Cloudflare , whichgave me a chance to learn a useful lesson about the modern Internetand how it routes traffic. The summary of the lesson is that thevenerable Unix traceroute command may not be your friend any more.

I come from an era of a relatively simple Internet. Back then, thepath that your packets took through the network was expected todepend only on the destination and the source IPs. Things in themiddle might drop some traffic or filter parts of it out,


Linux's hardware monitoring can lie to you

Let's start with my tweets :

Fedora 33's 5.11.7 kernel seems to do a real number onpower/fan/temperature levels of my Radeon RX 550 sitting idle inframebuffer text console. Fan RPMs went from 780 or so to 2100 andtemperature jumped from 29C to 31C and climbing.

[...]

Ah. The reason my GPU's temperature is steadily climbing despitethe fans running at 210


HTTPS is really multiple protocols these days

For all of its warts, HTTP is essentially a single protocol; if yousee 'https://...', you know what pretty much anything will do withit, and they're all going to do about the same thing. This is notthe case for HTTPS. HTTPS looks like a single protocol, invoked by'https://....', but it's really a bunch of protocols all dumpedin a big sack labeled 'HTTPS' on the outside


Discovering Vim's Visual (selection) mode

Usually, when I want to operate on a block of text (for example to reflow it ) I can select it with one ofVim's motion commands, such as '}' for a nominal paragraph. Vim'snotion of a paragraph is sufficiently all-encompassing that thisworks for a lot of things that aren't strictly paragraphs but are,for example, ed style diffs. When I want to select something thatdoesn't match up with this, such as only part of a quoted


Portability has ongoing costs for code that's changing

I recently had a hot take on Twitter :

Hot take: no evolving project should take patches for portabilityto an architecture that it doesn't have developers using, or atleast a full suite of tests and automated CI on. Especially if thearchitecture is different from all supported ones in some way (eg,big-endian).

Without regular usage or automated testing, it's far too likely thatthe project will break support on the weird architecture. And keepingthe code up to date for the weird


My uncertainty about swapping and swap sizing for SSDs and NVMe drives

The traditional reason to avoid configuring a lot of swap space onyour servers and to avoid using swap in general was that lots ofswap space made it much easier for your system to thrash itselfinto total overload . But that's wisdom (and painfulexperience) from back in the days of system-wide 'global' swapping and your swap being on spinningrust (ie, hard drives). A lot of paging evicted memory back in(whether from swap or from its original files) is random IO and