Prometheus Monitoring System Histogram and Summary
Business systems designed monitoring metrics of type Summary, calculating the average duration: request_duration_milliseconds_sum / request_duration_milliseconds_count.
Reviewing the data, a particular interface was found to have very high average duration, and when examining the time series chart, the average duration suddenly increased – effectively, one request took a long time, which pulled up the overall average. The goal was to identify exactly when this request occurred, but due to the low number of requests within the period, the data retrieved remained empty.
Blog Translation Project Musings: Cultural Transmission, AI Programming
Cultural Propagation: Its ideological influence, subtle and pervasive. AI Programming: Not performing software design, resulting in a lot of rework.
Cultural Propagation Initially, the project only supported English, Japanese, and Korean. Thinking it was just AI translation, we wondered if supporting more languages wouldn’t be a good idea. So, French, Russian, and Hindi were added. At this point, no problems were detected; when the program executed translations, formatting issues arose due to historical code problems, requiring re-translation of archived articles.
Blog Translation Project Musings: Historical Conversations
The initial design of the blog translation project was overly complex – first parsing Markdown format, then using placeholders to protect the content, and finally sending it to a large model for translation. This was entirely unnecessary; large models inherently possess the ability to recognize Markdown syntax and can directly process the original content while maintaining formatting during translation.
Our work shifted from debugging code to debugging the prompting of the model.
Find all functions not referenced in the Go project.
In a Go language project, using staticcheck to find unused functions is an efficient static analysis method.
1. Install staticcheck Ensure that Go (version 1.16+) is installed, and then execute the following command to install staticcheck:
go install honnef.co/go/tools/cmd/staticcheck@latest 2. Basic Usage: Finding Unused Functions Run the following command in the project root directory:
staticcheck ./... Key Check Rules:
U1000: Detects unused functions, methods, variables, or types. U1001: Detects unused parameters.
Git Submodule Merge History Lost
There’s a Git repository locally where submodules were in temporary branches during the initial pull. I made commits on that temporary branch, and then switched back to the main branch. However, those committed changes seem to be lost and cannot be found within the main branch. I also can’t find any record of that temporary branch.
Solutions After committing to a temporary branch within the Git submodule and switching back to the main branch, these commits are no longer found.
GitHub Pages Easter Egg: Deploying Multiple Pages
Recently, my biological clock has been a bit off, still tinkering with GitHub Pages deployments around 2 AM.
I went to eat after work, and I just wanted to sleep when I finished, then came back around 8:30 PM, feeling drowsy, thinking I’d take a nap, and ended up falling asleep immediately. When I woke up, it was already past 2 AM.
Categories that haven’t even launched yet: AI Study Group
Old problems, the flamboyant beauty of blossoming flowers. (This captures the essence and poetic nature of the original.)
Alternatively, a more literal translation could be: “Old ailments, beautiful eyes like blooming flowers.” However, the first option is generally preferred for its aesthetic quality.
For many years, I’ve focused on backend development, and recently started to explore AI programming while dipping my toes into some frontend-related content. However, during this period of tinkering, I gradually realized I was falling back into an old habit – being dazzled by shiny new things. I constantly try to use AI to create a frontend interface, but in reality, these attempts haven’t provided much practical benefit for my current work and are actually wasting my energy.
Claude4 released, attempting to develop: Hugo tags, hyperlink translation assistant
This site is developed using Hugo, but I’ve always used Chinese titles, which results in less friendly generated article links. In simpler terms, when shared, they don’t look as good because the Chinese characters are escaped into formats like %E4%BD%A0%E5%A5%BD within the links. While you can solve this by setting a slug, it’s tedious to do manually every time.
Therefore, I decided to try using Claude4 to develop a translation assistant that automatically converts Chinese titles to English slugs and adds hyperlinks within the articles.