Observability Done Right: Best Practices and Anti-Patterns for Effective System Monitoring

Image
  WHAT Observability is a concept that refers to the ability to gain insights into the behavior and performance of complex systems. In the context of software engineering, observability involves the collection, analysis, and visualization of data from software applications, infrastructure, and other components of a system. In the animal kingdom, observability plays a critical role in survival, allowing animals to monitor their surroundings, detect threats, and find food. Dolphins use echolocation to observe their surroundings. They emit high-frequency sounds that bounce off objects, allowing them to create a 3D map of their environment. Thanks for reading Knowledge Cafe! Subscribe for free to receive new posts and support my work. Subscribed WHY In today's era, architectures are becoming increasingly large, complex, and fast-paced due to the faster development and deployment of software by distributed teams with the help of DevOps, continuous delivery, and agile development methodo...

Java Thread Life Cycle

When you are programming with threads, understanding the life cycle of thread is very valuable. While a thread is alive, it is in one of several states.

thread life cycle

  1. New state: After the creations of Thread instance the thread is in this state but before the start() method invocation. At this point, the thread is considered not alive.

  2. Runnable (Ready-to-run) state : A thread start its life from Runnable state. A thread first enters runnable state after the invoking of start() method but a thread can return to this state after either running, waiting, sleeping or coming back from blocked state also. On this state a thread is waiting for a turn on the processor.

  3. Running state : A thread is in running state that means the thread is currently executing. There are several ways to enter in Runnable state but there is only one way to enter in Running state: the scheduler select a thread from runnable pool.

  4. Dead state: A thread can be considered dead when its run() method completes. If any thread comes on this state that means it cannot ever run again.

  5. Blocked - A thread can enter in this state because of waiting the resources that are hold by another thread.

  6. Sleeping : On this state, the thread is still alive but it is not runnable, it might be return to runnable state later, if a particular event occurs. On this state a thread sleeps for a specified amount of time. You can use the method sleep( ) to stop the running state of a thread. It can throw Intterupted exception.

  7. Waiting for Notification:  A thread waits for notification from another thread. The thread sends back to runnable state after sending notification from another thread.

  8. Blocked on I/O : The thread waits for completion of blocking operation. A thread can enter on this state because of waiting I/O resource. In that case the thread sends back to runnable state after availability of resources.

  9. Blocked for join completion: The thread can come on this state because of waiting the completion of another thread.

  10. Blocked for lock acquisition: The thread can come on this state because of waiting to acquire the lock of an object.

Popular posts from this blog

Chain of responsibility using Spring @Autowired List

Iterate Through a HashMap

Under the Hood: Understanding the Gossip Protocol in Apache Cassandra