Spring Boot Push Micrometer Metrics to Prometheus Pushgateway

Prometheus, as a metrics solution, gets its data by actively reading it from designated services – a process known as scraping. This approach might not work if your workload contains short-lived tasks, as your task may not fall within the scraping time window.

Luckily, Prometheus has a solution for this: the Pushgateway.

It presents a push-based target for your metrics that itself is scraped by Prometheus. But how do you configure this in a Spring Boot application? Let me show you.

Read More »

Spring Boot Custom Field Error Messages in Class-Based Custom Bean ConstraintValidator

This short guide will focus on a single specific aspect of custom bean validation. If you need to catch up on how to write a custom bean validator, check out the tutorial on reflectoring.io. What is usually missing from these how-tos is the handling of validators for an entire class instead of just a field and how to set custom errors for specific field errors in a class.

Why would you want to write a validator for an entire class?

You may run into a situation where the value of one field of a class depends on the value of another field. For example, the field “type” value impacts which values are valid for the field “content”.

But when you define a custom validator, the validation annotation @interface only represents a single error message. The result is that any field error would result in the same error message. In a web service, this is not very helpful for users of your API.

Read More »

Uncharted – The Nathan Drake Collection Review (PS4 Pro)

If I were to explain to someone how Uncharted plays, I would say that it is like Tomb Raider, only with more shooting, more linear, and a lot more character-building and interaction.

I guess I’m done here. See ya next time. Thank you for reading.

Yeah, no. I am incapable of being that brief. It is 2022, and I am enjoying a game franchise developed initially for the PlayStation 3. The first entry in the series was released fifteen (15!) years ago by Naughty Dog, nowadays of The Last of Us fame. Uncharted 1 Drake’s Fortune debuted in 2007, was followed up in 2009 with Among Thieves, and the trilogy (yes, I am aware there is a part four) was completed in 2011 with Drake’s Deception. I am not really one for nostalgic trips, so I picked up the remastered version instead of the originals (and I do not have a PS3). Bluepoint, now a part of PlayStation Studios, enhanced these three games for the PlayStation 4 and splashed out 60 fps gameplay. Note, though, that the remaster itself is also already seven years old. It was released in 2015.

Read More »