About all

Apdex pain: Appendicitis: Causes, symptoms and treatment

Appendicitis – NHS

Appendicitis is a painful swelling of the appendix. The appendix is a small, thin pouch about 5 to 10cm (2 to 4 inches) long. It’s connected to the large intestine, where poo forms.

Nobody knows exactly what the appendix does, but removing it is not harmful.

Symptoms of appendicitis

Appendicitis typically starts with a pain in the middle of your tummy (abdomen) that may come and go.

Within hours, the pain travels to the lower right-hand side, where the appendix usually lies, and becomes constant and severe.

Pressing on this area, coughing or walking may make the pain worse.

You may lose your appetite, feel sick and have constipation or diarrhoea.

When to get medical help

If you have abdominal pain that’s gradually getting worse, contact a GP or your local out-of-hours service immediately.

If these options are not available, call NHS 111 for advice.

Call 999 to ask for an ambulance if you have pain that suddenly gets worse and spreads across your abdomen, or if your pain temporarily improves before getting worse again.

If your pain eases for a while but then gets worse, your appendix may have burst, which can lead to life-threatening complications.

Read more about diagnosing appendicitis and complications of appendicitis.

How appendicitis is treated

If you have appendicitis, it’s likely your appendix will need to be removed as soon as possible.

Removal of the appendix, known as an appendicectomy or appendectomy, is 1 of the most common operations in the UK and its success rate is excellent.

It’s most commonly carried out as keyhole surgery (laparoscopy).

Several small cuts are made in the abdomen, allowing special surgical instruments to be inserted.

Open surgery, where a larger, single cut is made in the abdomen, is usually used if the appendix has burst or access is more difficult.

It usually takes a couple of weeks to make a full recovery after your appendix has been removed.

But strenuous activities may need to be avoided for up to 6 weeks after having open surgery.

What causes appendicitis?

It’s not clear what causes appendicitis. In many cases it may be that something blocks the entrance of the appendix.

For example, it could become blocked by a small piece of poo, or an upper respiratory tract infection could cause the lymph node within the wall of the bowel to become swollen.

If the obstruction causes inflammation and swelling, it could lead to increased pressure within the appendix, which may then burst.

As the causes of appendicitis are not fully understood, there’s no guaranteed way of preventing it.

Who’s affected

Appendicitis is a common condition. In England, around 50,000 people are admitted to hospital with appendicitis each year.

You can get appendicitis at any age, but it usually affects people aged between 10 and 30 years.

Video: what is appendicitis?

Watch this animation to learn about what causes appendicitis and how it’s treated.

Media last reviewed: 1 May 2021
Media review due: 1 May 2024

Page last reviewed: 21 October 2022
Next review due: 21 October 2025

Appendicitis: Causes, symptoms and treatment

When you purchase through links on our site, we may earn an affiliate commission. Here’s how it works.

The vermiform appendix extends off of the colon, also known as the large intestine.

Appendicitis is inflammation of the vermiform appendix (or just the appendix, for short), a little structure within the lower gastrointestinal tract.

In appendicitis, the appendix swells, causing a condition that is classified as either acute or chronic. Both acute and chronic appendicitis are characterized by some of the same symptoms, especially abdominal pain. However, while chronic appendicitis features pain that waxes and wanes over periods of weeks, months or years, and that tends to be milder, acute appendicitis has symptoms that are more severe and emerge rapidly, typically over 12 to 24 hours

Acute appendicitis requires immediate treatment to avoid life-threatening complications.

What causes appendicitis?

Appendicitis develops when the lumen (the hollow, inner region of the vermiform appendix) becomes blocked or parts of the gastrointestinal tract to which the appendix is attached become blocked. Such blockages can result from material, such as a piece of fecal matter blocking the hollow interior of the appendix, or they may stem from the presence of a tumor.

This leads to an inflammatory reaction to infectious agents that become trapped inside the appendix, since the blockage prevents these agents from being cleared away by normal secretions and movements of bodily fluids. Usually, such an infection is caused by bacteria, but it also can be driven by a virus or parasite. 

The appendix then swells, causing pain, which is exacerbated when the swelling pushes on nearby blood vessels in a way that cuts off the blood supply to the appendix. Obstructed blood supply leads to ischemia, meaning a lack of blood flow to the tissue. This weakens the tissue, and in cases of acute appendicitis, this weakening can be drastic enough to put the appendix at risk of perforating (developing small holes) or even rupturing. 

Chronic appendicitis also features episodes of inflammation that can decrease blood supply to the appendix. However, any episode that reaches a level of severity bad enough to cause perforation is then called acute appendicitis and treated as such.

Risk factors for appendicitis

Appendicitis is fairly common: 8.6% of the male population and 6.7% of the female population will have the condition at some point in their lives. 

While a family history of appendicitis may be a risk factor for male patients, who have a slightly higher overall risk of the condition than female patients do, the only reliable predictor of risk for everyone is age. Appendicitis is most common between the ages of 10 and 20, and then there is another, smaller peak in older people that arises in the early 40s, peaks around age 65 and then gradually decreases again. This is called a bimodal age distribution. 

Although appendicitis most commonly occurs in the aforementioned age ranges, it’s important to keep in mind that the condition can occur at any age. 

Also, since chronic appendicitis is characterized by waxing and waning episodes, and since any such episode can potentially become acute, people who suffer from chronic appendicitis are also at risk for acute appendicitis.

What are the symptoms of appendicitis?

One of the main symptoms of appendicitis is abdominal pain. (Image credit: urbazon via Getty Images)

According to Johns Hopkins Medicine, the symptoms of appendicitis include the following:

  • abdominal pain
  • nausea
  • lack of appetite
  • vomiting
  • painful urination
  • fever

Pain is the dominant symptom of both chronic and acute appendicitis. As noted above, the pain waxes and wanes over weeks, months or years in cases of chronic appendicitis, whereas symptoms of acute appendicitis develop abruptly. 

Typically, the pain of acute appendicitis begins gradually as a dull sensation around the navel that develops over 12 to 24 hours. Then, the pain shifts to the right side of the lower abdomen, classically to a location that surgeons call the “McBurney’s point.” It’s important to keep in mind, however, that many people experience variations of this classic pattern of pain progression, or patterns that are very different. Pregnancy notoriously makes the development of appendicitis confusing, because the growing womb shifts organs to different locations, making the McBurney’s point less likely to be the focus of the pain. 

It should be noted that a very small number of people carry their appendix on the left side of the body, instead of the right side, so it’s technically possible for pain in the lower left abdomen to be the result of appendicitis.

How is appendicitis diagnosed?

In evaluating patients for possible appendicitis, physicians and surgeons order blood tests to determine if the number of white blood cells, a type of immune cell, is elevated. Doctors also perform a physical examination in which the abdomen and legs are manipulated in certain ways to elicit classic signs of appendicitis, such as McBurney’s sign. But generally, they do not diagnose appendicitis based on the physical examination alone. 

To add to the information obtained from physical examination and blood tests, doctors order or perform imaging of the abdomen. Usually, the first imaging is ultrasound scanning to reveal if the appendix is swollen. If the ultrasound imaging does not give a clear result, doctors will order either computed tomography (CT) scanning or magnetic resonance imaging (MRI) of the abdomen to get a better look. Currently, CT is the most accurate method for confirming appendicitis.

Complications of appendicitis

In cases of acute appendicitis, the imaging and laboratory workup will be used not only to confirm that appendicitis is present but also to detect or rule out the following complications. The presence or absence of these complications determines whether nonsurgical treatment can be considered.

  • Perforation or rupture: One or more holes opens in the appendix, making it possible for the infection to spread through the abdomen and pelvis. This can lead to an abscess (the infection leaks out of the appendix but becomes enclosed in a ball of pus), peritonitis (the abdominopelvic cavity becomes infected) or sepsis (the infection spreads throughout the bloodstream).
  • An abscess on or near the appendix or elsewhere in the abdomen: As noted above, this is basically a swollen accumulation of pus.
  • Evidence of a possible tumor near the appendix, or within it.
  • An appendicolith: This term refers to a calcified deposit within the appendix. CT scanning is particularly good at revealing this.

Generally, the aforementioned complications are issues related to acute appendicitis, although it is sometimes possible for a small abscess to form in connection with chronic appendicitis.

How is appendicitis treated?

Appendicitis may require surgery. (Image credit: Science Photo Library via Getty Images)

If you have appendicitis with any of the above complications, surgery is mandatory, but there is no need to worry. Appendectomy is a safe, routine operation. In nearly all cases, such complications emerge in the setting of acute appendicitis, rather than chronic. If they do emerge in someone whose appendicitis has been chronic, the case is then considered to be acute, as explained previously.

Usually, the procedure is performed laparoscopically, meaning that surgeons make just a few very tiny incisions in the patient’s abdomen and the appendix is pulled from the body through a tube. Recovery from laparoscopic appendectomy (sometimes called “lap-appy”) is fairly rapid. In fact, because recovery is easy, a patient may decide, in consultation with their doctor, to have their appendix removed even if they have an uncomplicated case, for reasons that will be discussed below.

The idea that an inflamed appendix must always be removed dates back to the late 19th century, when antibiotics weren’t available and surgeons began performing appendectomies (removal of the appendix) routinely as a way to prevent death that would result if a swollen appendix perforated. Perforation is a feared complication because it can lead to abscess, peritonitis or sepsis, which can be fatal.  

Nowadays, however, many people with appendicitis don’t need surgery and can recover with just antibiotics.

Related stories

Nonsurgical treatment is appropriate for a certain fraction of appendicitis cases. Evidence shows that people with acute appendicitis who have not developed complications can receive only antibiotics, with a success rate of about 70%. This means that in about 70% of people who receive the right kind of antibiotics on the correct schedule to treat uncomplicated appendicitis, the appendicitis will clear and then not recur. Of course, this also means that about 30% of uncomplicated appendicitis cases treated nonsurgically will recur, so many people opt for surgical treatment even when they do not experience complications.

When it comes to chronic appendicitis, patients may experience episodes for years without developing complications. But even so, it’s not uncommon for doctors to offer antibiotics for flare-ups and to offer surgery to treat the condition, since removing the appendix ends the problem for good.

Scientists are evaluating the influence of age and other factors on the success rate of nonsurgical treatments for appendicitis. Treating the condition with antibiotics, alone, used to require that patients stay in the hospital and receive the drugs intravenously for 14 to 21 days. Today, however, doctors can successfully treat appendicitis by giving patients intravenous antibiotics for as few as four days and then antibiotic pills for seven to 10 days. These pills can be taken at home, so patients can be discharged from the hospital at that time.

This article is for informational purposes only and is not meant to offer medical advice.

Stay up to date on the latest science news by signing up for our Essentials newsletter.

Contact me with news and offers from other Future brandsReceive email from us on behalf of our trusted partners or sponsors

David Warmflash is a medical researcher, astrobiologist, science communicator, and author, located in Portland, Oregon. He holds an MD from Tel Aviv University Sackler School of Medicine and has conducted research in astrobiology, space biology, and space medicine during research fellowships at NASA’s Johnson Space Center, the University of Pennsylvania, and Brandeis University, and in collaboration with The Planetary Society and the Israeli Aerospace Medicine Institute.

  1. 1

    $500,000 chunk of ‘floating gold’ found in dead whale

  2. 2

    Scientists discover huge, heat-emitting blob on the far side of the moon

  3. 3

    Elite Bronze Age tombs laden with gold and precious stones are ‘among the richest ever found in the Mediterranean’

  4. 4

    The ‘man in the moon’ may be hundreds of millions of years older than we thought

  5. 5

    Kentucky man finds over 700 Civil War-era coins buried in his cornfield

  1. 1

    Zapotec ‘entrance to underworld’ discovered under Catholic church in Mexico

  2. 2

    Humans were in South America at least 25,000 years ago, giant sloth bone pendants reveal

  3. 3

    Nuclear bombs set off new geological epoch in the 1950s, scientists say

  4. 4

    Stone tools and camel tooth suggest people were in the Pacific Northwest more than 18,000 years ago

  5. 5

    $500,000 chunk of ‘floating gold’ found in dead whale



Detailed content of materials

1. Introductory part

– What knowledge and skills does this course give
– What does the 1C: Expert certificate give to its holder
– Career of specialists who received the 1C: Expert certificate
– Skills 1C: Expert for the design, development, maintenance and acceleration of large systems 1C
– Implementations in the CORP segment, large bases, high load: why is there no way without 1C: Expert
– Software architect: why does he need knowledge of 1C:Expert
– Useful materials for preparing for the exam and simply improving your level

2. Performance through the eyes of an IT manager (Project Manager, IT Director)

– Easy to say, not easy to do: full tuning or just a set of recommendations?
– Settings
– Vertical scaling: selection of equipment, obvious points when upgrading
– Horizontal scaling: clustering, base split

3. Overview of tools and techniques for monitoring and investigating performance and stability issues

4. How to objectively assess how fast a system is running

– What is Apdex
– Generic BSP tools for calculating performance index
– How fast make a list of key operations and target time
– Apdex and SLA for daily monitoring
– Apdex for a load testing project
– Apdex for an optimization project: CKTP methodology for accelerating 1C
– Reverse Apdex, DeltaApdex
– How to understand by Apdex how much you can increase the speed of work
– Examples from real projects

5. When it already slows down

– Where to start the investigation
– When it is advisable to speed up a single operation
– Regular performance measurement : when applicable and pitfalls
– When the measurement is not enough: the speed of the hidden actions of the 1C platform
– When the measurement is not enough: the time for client-server interaction
– Optimization of client-server interaction
– When it is necessary to find and eliminate bottlenecks of the entire system
– Acceleration of the whole system: tools, approaches, pitfalls
– Difference in methods of accelerating individual operations and the whole system, typical mistakes of beginners
– As from individual pieces to collect the big picture – what is happening with the system

6. Hardware performance

– Hardware performance counters on Windows and their decoding
– Interactive task: configuring hardware load analysis on Windows
– Monitoring hardware on Linux
– MS SQL Server performance counters and their decoding
– How to find out who loads the CPU, disks and uses memory inefficiently on the 1C: Enterprise server
– Memory leaks and voracious server calls: how to distinguish and how to investigate
– How to find out who is using CPU, disks and memory inefficiently on a DBMS server
– Virtual machine counters using VMWare 9 as an example0009 – Features of the operation of virtual machines on the example of VMWare
– Checklists for setting up a productive circuit for maximum performance

7. 1C and DBMS diagnostic tools ТЖ
– Dynamic views for MS SQL and Postgres
– Tracing Extended Events
– Normalization of requests from trace or ТЖ
– How to find a request from a trace or DMV in the 1C 9 configuration code0009 – A practical task of setting up tracing and investigating a problem using tracing
– How to set up Postgres logs to collect information about running queries
– In what cases does TJ and tracing affect performance
– 1C: Performance Control Center

8. We design to worked quickly: database indexes

– What is a database index
– When indexes speed up query execution and why
– What indexes are there and which ones are supported by the 1C 9 platform0009 – Benefits of a Clustered Index
– Benefits of a Covering Index
– When Indexes Are Useless
– Indexing Tips and Why the Query Optimizer May Make a Different Decision from Yours
– An Interactive Challenge on Using Indexes
– How to Know Which Indexes Are Missing
– How find out which indexes are superfluous
– Peculiarities of indexes created by the platform. Underwater rocks.

9. Analyzing query operation: query plan

– Why do we need a query plan
– What are the query plans
– How to get a query plan in MS SQL Server and Postgres
– Basic query plan operators: comparison for MS SQL Server and Postgres
– Signs of suboptimal plans: analysis of several plans from real projects
– The impact of DBMS statistics on query plan quality
– Parallelism in MS SQL Server and Postgres: performance impact and pitfalls

10. Maintaining it to run fast: maintenance of indexes and statistics for MS SQL Server and Postgres

– How MS SQL Server and Postgres automatically update statistics and when it needs to be updated additionally
– Practical task: setting up an index and statistics maintenance plan for small databases using the example of MS SQL Server
– Maintaining large databases and databases 24/7 using the example of MS SQL Server
– Maintaining Postgres databases

11. Writing queries that run fast

– Best practices for writing queries
– Common causes of suboptimal query performance
– Query optimization techniques
– Features of query development for large (highly loaded) 1C systems

12. Transactions from the point of view of 1C and DBMS

– What is a transaction
– How to start a transaction in 1C explicitly
– Examples when the platform implicitly starts transaction
– Implicit transactions for the DBMS on the example of MS SQL Server
– What is meant by the statement “1C does not support nested transactions”
– Transaction properties and their interpretation
– Protection against dirty reading in DBMS – “locker” and DBMS – “version”
– How the MVCC mechanism is implemented in MS SQL Server, Postgres and Oracle
– What are transaction isolation levels and transactional locks for
– Isolation levels in different versions 1C platform
– How to find out that an action is performed in a transaction

13. MS SQL Server and WAL transaction log for Postgres, backups and fault tolerance of DBMS

– What is the MS SQL Server and WAL transaction log for Postgres 9 for?0009 – MS SQL Server database recovery model
– Postgres WAL settings affecting performance and reliability
– Backup features for different MS SQL Server database recovery models
– Postgres backup features
– Overview of mechanisms fault tolerance for MS SQL Server and Postgres

14. Designing for high concurrency: transactional locks

– When locking is justified and when it is considered redundant
– What is automatic and managed locking mode
– How to quickly transfer the configuration to managed locks
– Difference between lock timeout and deadlock
– 1C managed lock compatibility
– MS SQL Server lock compatibility
– Postgres locks
– All ways how find out who blocked whom and find the cause
– Practical task: conflicts on 1C managed locks – how to reproduce and how to investigate
– Practical task: conflicts on DBMS locks – how to reproduce and how to investigate
– Practical task: development approaches that lead to lock conflicts and how to develop correctly
– Practical task: investigating timeout and deadlock using “1C: Performance Control Center” (PMC)
– Interactive task: analyzing the causes of lock conflicts from a real system 1C

15. Other types of locks

– Object locks

16. How to improve the reliability of the 1C 9 cluster0005

– 1C cluster capabilities for load balancing
– 1C cluster capabilities for protection against excessive memory consumption by cluster processes
– 1C cluster capabilities for protection against excessive memory and CPU consumption by server call
– 1C cluster monitoring system and thick client
– Resource consumption counters in a 1C cluster
– Restrictions on resource consumption in a 1C cluster

17. Licenses 1C

– Typical problems with 1C hardware keys and how to solve them
– Features of operating 1C software licenses

– Load testing as part of acceptance testing
– Load testing to identify unstable reproducible problems
– Load testing for equipment sizing (selection)
– Stress testing
– What is a realistic load test
– Overview of “1C: Test Center” configuration options
– An example of a simple load test
– Features of preparing, developing and running large load tests (up to several thousand users)
– How to find testing equipment, licenses for system software and 1C:Enterprise platform


System requirements for the course:

* At least 25 GB of free space to be able to deploy a test base
* 8 GB of RAM
* CPU Core i5 (4 cores) or higher

Required software:

* OS Windows 7 and above, or Windows Sever 2008 R2 and above
* Client-server version 1C:Enterprise 8. 3 (32x or 64x, server + client part)
* MS SQL Server 2012 or higher, Developer Edition version or higher. Management Studio and Profiler must be installed.
* MS Excel
* NotePad++
* The Test1CProf database is deployed and connected in the client-server version (check with the organizers for the current link to the database dt-file). The volume of the test database in expanded form is 18 GB
* In the Test1CProf database, the launch of scheduled tasks must be blocked
* There must be rights to create a database in the client-server version, restart services: cluster administrator login / password, password for sa, password to start the 1C: Enterprise and MS SQL server service

Additional software and hardware (recommended):

* Two monitors – for viewing the training and performing practical tasks
* Installed “1C: Performance Management Center”
* Installed Linux Ubuntu of the current version (You can install Linux on the free virtualization environment Oracle Virtual Box )
* Installed Git Bash or Cygwin

How to reduce the dimension of metrics in Prometheus if you are not DevOps


July 1, 2021

through trial and error she finds a non-obvious solution. This happened to us when we needed to transfer the collection of metrics from Infux to Prometheus. Their final dimension turned out to be 1.5 million, and we decided to reduce it. The infrastructure for collecting metrics (Prometheus, k8s, deploy via Helm) was created by DevOps engineers from another team who did not have the resources for our task. Therefore, we enlisted their advice, studied the documentation, and decided to reduce the dimension of metrics by development forces.

This article is not suitable for experienced DevOps engineers, but it will be useful for developers who want to reduce the metrics dimension and do not want to dive into the documentation. Or those who deliberately refuse hierarchical federation and are looking for a workaround, but do not want to step on our rake. Let’s tell:

  • how to reduce the dimension of metrics in two steps using two ServiceMonitors,
  • what is the reference way to reduce the dimension of metrics without “crutches”,
  • why you shouldn’t spend time reducing metrics with Pushgateway.

Why it was necessary to reduce the dimension of metrics

Our team is responsible for one of the Mindbox products — product recommendations on the website and in mailing lists. We collected real-time recommendation processing time in Influx, and in order to help the business evaluate the performance of the product, we also needed to calculate the Apdex (Application Performance Index). The company is gradually transferring metrics from Influx to Prometheus, so we decided to collect both metrics at once in Prometheus using histograms.

A bar chart with metrics that we wanted to create to evaluate the performance of products

Our services are deployed in Kubernetes. We collect metrics in Prometheus using ServiceMonitor. We use Prometheus.NET in the application. In the default configuration, each metric exported by a pod is appended with a pod label with the corresponding value.

Collecting metrics in Prometheus using ServiceMonitor

To display the average processing time, percentiles (p50, p95, p99) and Apdex planned to use a histogram with 20 buckets. Taking into account the fact that we wanted to receive information regarding each of the 2.5 thousand recommendation mechanics, the total dimension of the metrics was 50 thousand. Pod names change on every show and a pod label is assigned to every metric, so with a 30-day retention and a daily show, the dimension grows to 1.5 million. A metric with this dimension took up much more space in Prometheus than we wanted.

2500 * 20 * 30 = 1 500 000
(number of mechanics) * (number of histogram buckets) * (retention) = (final dimension)

We decided to get rid of the pod and instance label so that the dimension does not increase on the calculations. At the same time, we tried to find a simple and cheap solution that can be implemented and maintained without the involvement of a DevOps engineer.

An important assumption: the metric for which we wanted to reduce the dimension is collected from only one pod at a time. The pod can change only when the application is restarted, for example, when laying out.

What solutions were considered

Let’s make a reservation right away that hierarchical federation is most suitable for solving problems with dimension; the documentation for it describes in detail examples of use. We could deploy Prometheus with a low metrics retention and collect the original metrics there. Then, through the recording rules, calculate the aggregates and collect them into another Prometheus with a high data retention.

We didn’t consider federation because we wanted to find a simpler, cheaper, and faster solution. In addition, developers, not DevOps, had to work on the task, so I wanted to use familiar tools and techniques. Although practice has shown that we spent time looking for such a solution, during which it was possible to make a federation, and our implementation turned out to be a “crutch”.

We formulated two equivalent solutions:

1. Raise Pushgateway and push metrics there without labels. The company already had a helm chart for stack monitoring, including for Pushgateway.

Pros: code and charts can be reused, metrics can be transferred to the raised Pushgateway from other team servers that are outside Kubernetes and have not yet moved from Influx to Prometheus.

Cons: more expensive support.

Collecting metrics in Prometheus using Pushgateway

2. Raise the second ServiceMonitor and configure routing of metrics between them. In one, remove pod/instance labels through relaying, and in the other, leave them as they are.

Pros: is cheaper – you just need to deploy ServiceMonitor, easier to maintain.

Cons: ops implementation that the developers were not familiar with.

Collecting metrics in Prometheus using the second ServiceMonitor

How the Pushgateway solution failed

First solution. To begin with, we chose the obvious implementation through Pushgateway. We raised Pushgateway, pushed metrics there and used the instance constant as a label. The request looked something like this:

We quickly coped with the task and at first the result was pleasing – the metrics were collected, but the dimension did not grow. But soon we began to notice large gaps in the metrics of some mechanics. At the same time, a strange pattern was observed – when for some mechanics the metric was transmitted correctly and continuously, for others, failures began. Because of this, it seemed that only one group of mechanics was reporting at a single moment in time. There were several such groups, and they changed randomly.

Why didn’t it work. Those who are familiar with the Pushgateway device probably immediately realized that our solution was not working. In Pushgateway, labels are passed in two ways: through the request path or in the request body. At the same time, the set of labels and their values ​​that are passed through the path act as a key for the dictionary where the metrics are stored. Everything passed through the request body gets into the value by this key. That is, in our case, each request from the pod overwrote all the metrics that were pushed from other pods. Since Prometheus collects metrics at intervals, it only got metrics from the pod that was last pushed.

To correctly send metrics to Pushgateway, you would have to write custom C# code. But such a solution was neither simple nor cheap, so it was abandoned.

Second solution. We decided to cling to Pushgateway again: collect initial metrics and push with all labels, and then remove the pod label using ServiceMonitor, which collects metrics from Pushgateway. But already at the start they realized that the idea would not work.

Why not implemented. Pushgateway has several features that make this solution impossible. Main – data is not cleared automatically, by retention. This means that you need to track the size of the disk and write cleanup code manually. Another problem is that after relaying, metrics with the same set of labels, but with a different pod label, will conflict. As a result, only the last metric in the Pushgateway order will remain. At the same time, the metrics are sorted not by the date of the last change, but in alphabetical order. So, when uploading values ​​from new pods, they may not get into Prometheus.

How the solution worked with the second ServiceMonitor

We returned to the second original version and made two ServiceMonitors. Additionally, a special label was affixed in the code (in our case, business) for those metrics whose dimension we are reducing:

  • on one ServiceMonitor, all metrics with a special label were discarded, and the rest were left as they are;
  • on the other one, only metrics with a special label were left and the pod and instance labels were removed from them.

We did everything through relaying, the code was added to the configuration of the first ServiceMonitor:

The code was added to the configuration of the second ServiceMonitor:

What we learned from the story of finding solutions

  1. Neither Pushgateway directly nor its relabeling is suitable for metric dimensionality reduction.