<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: DAVID JORDAN ANAMPA PANCCA</title>
    <description>The latest articles on Forem by DAVID JORDAN ANAMPA PANCCA (@david_jordananampapancc).</description>
    <link>https://forem.com/david_jordananampapancc</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3644680%2F8827f6af-9d53-4a9d-8c71-b3d39fb5a998.png</url>
      <title>Forem: DAVID JORDAN ANAMPA PANCCA</title>
      <link>https://forem.com/david_jordananampapancc</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/david_jordananampapancc"/>
    <language>en</language>
    <item>
      <title>Exploring Alternative Visualization Tools: Streamlit, Dash, and Bokeh</title>
      <dc:creator>DAVID JORDAN ANAMPA PANCCA</dc:creator>
      <pubDate>Fri, 05 Dec 2025 17:26:36 +0000</pubDate>
      <link>https://forem.com/david_jordananampapancc/exploring-alternative-visualization-tools-streamlit-dash-and-bokeh-19i4</link>
      <guid>https://forem.com/david_jordananampapancc/exploring-alternative-visualization-tools-streamlit-dash-and-bokeh-19i4</guid>
      <description>&lt;p&gt;In recent months, I’ve been experimenting with lightweight tools for building dashboards and interactive visual reports. Instead of relying only on traditional BI platforms, I realized that Python-based frameworks like Streamlit, Dash, and Bokeh offer a faster and more flexible way to create and share data applications.&lt;/p&gt;

&lt;p&gt;This article gives a clear explanation of each tool, includes a simple example, and shows how to deploy it to the cloud.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Streamlit&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Streamlit is one of the simplest tools for creating data applications. It feels like writing a regular Python script, but the output becomes a functional and interactive web app.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Advantages:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No need for HTML, CSS, or JavaScript&lt;/li&gt;
&lt;li&gt;Very fast prototyping&lt;/li&gt;
&lt;li&gt;Auto-refresh on save&lt;/li&gt;
&lt;li&gt;Works perfectly with data science workflows&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Limitation:&lt;/strong&gt;&lt;br&gt;
Customization is more limited compared to a full web framework.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dash&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Dash, built by Plotly, is more structured and powerful, especially for complex dashboards.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Advantages:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Production-focused&lt;/li&gt;
&lt;li&gt;Highly customizable layouts&lt;/li&gt;
&lt;li&gt;Interactive visualizations using Plotly&lt;/li&gt;
&lt;li&gt;Good for enterprise-grade dashboards&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It requires more configuration due to its callback system, but it offers deeper control.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bokeh&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Bokeh is centered around interactive visualizations rendered directly in the browser. It gives you more detailed control over graphical elements.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Advantages:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;High interactivity&lt;/li&gt;
&lt;li&gt;Can run on a Bokeh Server&lt;/li&gt;
&lt;li&gt;Integrates well with NumPy and Pandas&lt;/li&gt;
&lt;li&gt;Produces JavaScript-level visualizations without writing JS&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Perfect for scientific and research dashboards.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example: Simple Dashboard Using Streamlit&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Below is a straightforward Streamlit example that generates a line chart.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import streamlit as st
import pandas as pd
import numpy as np

st.title("Simple Dashboard Example")

data = pd.DataFrame({
    "values": np.random.randn(50).cumsum()
})

st.line_chart(data)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Run it locally:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install streamlit
streamlit run app.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;dashboard will open at:&lt;br&gt;
&lt;a href="http://localhost:8501" rel="noopener noreferrer"&gt;http://localhost:8501&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Deploying to the Cloud
&lt;/h2&gt;

&lt;p&gt;One of the best parts of using Streamlit is how simple it is to deploy a dashboard online.&lt;/p&gt;

&lt;p&gt;You can deploy for free using Streamlit Community Cloud.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Steps:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Upload your project to GitHub&lt;/li&gt;
&lt;li&gt;Go to: &lt;a href="https://streamlit.io/cloud" rel="noopener noreferrer"&gt;https://streamlit.io/cloud&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Click Deploy an app&lt;/li&gt;
&lt;li&gt;Select your repository and the app.py file&lt;/li&gt;
&lt;li&gt;Deploy&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In a few seconds, you will have a public URL to share your app.&lt;/p&gt;

&lt;p&gt;Other services you can use for deployment:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Render&lt;/li&gt;
&lt;li&gt;Railway&lt;/li&gt;
&lt;li&gt;Fly.io&lt;/li&gt;
&lt;li&gt;AWS / Azure / Google Cloud&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All of them support Python-based web apps.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Tools like Streamlit, Dash, and Bokeh offer powerful alternatives to heavy BI systems. They allow you to create dashboards quickly, write minimal code, and deploy them easily to the cloud.&lt;/p&gt;

&lt;p&gt;If you're working on data analytics, machine learning demos, or internal dashboards, these tools are excellent options to explore.&lt;/p&gt;

</description>
      <category>datascience</category>
      <category>python</category>
      <category>tooling</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Design Principles of Software: How I Apply Them in Python</title>
      <dc:creator>DAVID JORDAN ANAMPA PANCCA</dc:creator>
      <pubDate>Fri, 05 Dec 2025 00:02:54 +0000</pubDate>
      <link>https://forem.com/david_jordananampapancc/design-principles-of-software-how-i-apply-them-in-python-3mmd</link>
      <guid>https://forem.com/david_jordananampapancc/design-principles-of-software-how-i-apply-them-in-python-3mmd</guid>
      <description>&lt;p&gt;When I first started coding, I thought writing software was just about making it work. But soon I realized that &lt;strong&gt;making it work is only half the battle&lt;/strong&gt;—making it clean, flexible, and maintainable is just as important. That’s where &lt;strong&gt;software design principles&lt;/strong&gt; come in.&lt;/p&gt;

&lt;p&gt;These principles are like a roadmap for writing code that doesn’t turn into a nightmare as your project grows. In this article, I’ll explain some key principles and show a real example in Python.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Design Principles Are Important
&lt;/h2&gt;

&lt;p&gt;Imagine you’ve built a small project, and six months later you come back to fix a bug or add a feature. If your code is messy, you’ll spend more time &lt;strong&gt;figuring out what’s happening&lt;/strong&gt; than actually solving the problem. Good design principles make your code:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Easy to read&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Easy to maintain&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Flexible for future changes&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The most common set of design principles is &lt;strong&gt;SOLID&lt;/strong&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Single Responsibility Principle (SRP)&lt;/strong&gt; – Each class or function should have only one job.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Open/Closed Principle (OCP)&lt;/strong&gt; – Classes should be open for extension but closed for modification.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Liskov Substitution Principle (LSP)&lt;/strong&gt; – Subclasses should be able to replace parent classes without breaking the program.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Interface Segregation Principle (ISP)&lt;/strong&gt; – Don’t force classes to implement methods they don’t need.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dependency Inversion Principle (DIP)&lt;/strong&gt; – High-level modules should depend on abstractions, not on concrete low-level modules.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  A Real Example in Python
&lt;/h2&gt;

&lt;p&gt;To make this concrete, let’s say I’m building a &lt;strong&gt;notification system&lt;/strong&gt; where users can receive alerts via email or SMS. Here’s how I apply the design principles:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;abc&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;ABC&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;abstractmethod&lt;/span&gt;

&lt;span class="c1"&gt;# Interface defining what a Notifier should do
&lt;/span&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Notifier&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ABC&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="nd"&gt;@abstractmethod&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;pass&lt;/span&gt;

&lt;span class="c1"&gt;# SRP: Each notifier has a single responsibility
&lt;/span&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;EmailNotifier&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Notifier&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Sending email: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;SMSNotifier&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Notifier&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Sending SMS: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# OCP &amp;amp; DIP: NotificationService works with any notifier
&lt;/span&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;NotificationService&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;notifiers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Notifier&lt;/span&gt;&lt;span class="p"&gt;]):&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;notifiers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;notifiers&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;notify_all&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;notifier&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;notifiers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;notifier&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Using the system
&lt;/span&gt;&lt;span class="n"&gt;email&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;EmailNotifier&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;sms&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;SMSNotifier&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;service&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;NotificationService&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sms&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;span class="n"&gt;service&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;notify_all&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Your order has been shipped!&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  How the Principles Are Applied
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;SRP:&lt;/strong&gt; Each class has one job (sending email or SMS).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;OCP:&lt;/strong&gt; I can add new notifiers (like WhatsApp) without changing &lt;code&gt;NotificationService&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DIP &amp;amp; ISP:&lt;/strong&gt; &lt;code&gt;NotificationService&lt;/code&gt; depends on the &lt;code&gt;Notifier&lt;/code&gt; interface, not specific classes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This structure keeps the system &lt;strong&gt;flexible&lt;/strong&gt;, &lt;strong&gt;easy to extend&lt;/strong&gt;, and &lt;strong&gt;clean&lt;/strong&gt;, even as it grows.&lt;/p&gt;




&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Applying design principles is not just a recommendation—it is an investment in the quality and longevity of your code. Following SRP, OCP, DIP, and other SOLID principles makes your code easier to understand, safer to modify, and more scalable.&lt;/p&gt;

&lt;p&gt;The goal is not just to make your software work today, but to build something that can grow and adapt tomorrow without complications. Adopting these principles from the start ensures cleaner projects, simpler changes, and smoother collaboration.&lt;/p&gt;

</description>
      <category>python</category>
      <category>architecture</category>
      <category>design</category>
      <category>softwareengineering</category>
    </item>
    <item>
      <title>Observability Practices: Implementing Real-World Monitoring With Python and Prometheus</title>
      <dc:creator>DAVID JORDAN ANAMPA PANCCA</dc:creator>
      <pubDate>Thu, 04 Dec 2025 02:19:31 +0000</pubDate>
      <link>https://forem.com/david_jordananampapancc/observability-practices-implementing-real-world-monitoring-with-python-and-prometheus-3kca</link>
      <guid>https://forem.com/david_jordananampapancc/observability-practices-implementing-real-world-monitoring-with-python-and-prometheus-3kca</guid>
      <description>&lt;p&gt;Modern applications don’t just need to run — they need to be understood. When something goes wrong in production, teams must be able to detect issues, diagnose the root cause, and monitor the system’s behavior in real time.&lt;br&gt;
This is where observability becomes essential.&lt;/p&gt;

&lt;p&gt;In this article, I explain what observability is, why it matters, and how I implemented a real-world example using Python, Prometheus, and FastAPI. You can use this code to build your own monitoring pipeline.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What Is Observability?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Observability is the ability to understand the internal state of a system based on the data it produces.&lt;/p&gt;

&lt;p&gt;It is built around three core pillars:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Metrics&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Numeric values that reflect system state.&lt;br&gt;
Examples: request latency, CPU usage, memory consumption.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Logs&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Detailed event records generated by applications and systems.&lt;br&gt;
Examples: authentication messages, errors, warnings.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Traces&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;End-to-end tracking of requests across services.&lt;br&gt;
Useful in microservices and distributed systems.&lt;/p&gt;

&lt;p&gt;Together, these help answer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What is happening?&lt;/li&gt;
&lt;li&gt;Why is it happening?&lt;/li&gt;
&lt;li&gt;Where is it failing?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Why Observability Matters&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Observability helps teams:&lt;/li&gt;
&lt;li&gt;Detect issues earlier&lt;/li&gt;
&lt;li&gt;Reduce downtime&lt;/li&gt;
&lt;li&gt;Improve performance&lt;/li&gt;
&lt;li&gt;Understand user impact&lt;/li&gt;
&lt;li&gt;Monitor applications at scale&lt;/li&gt;
&lt;li&gt;Make data-driven decisions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Without observability, debugging becomes slow, reactive, and inconsistent.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Real-World Example: Observability With Python + Prometheus&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For this example, I implemented observability on a small API using:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Python&lt;/li&gt;
&lt;li&gt;FastAPI&lt;/li&gt;
&lt;li&gt;Prometheus (metrics collection)&lt;/li&gt;
&lt;li&gt;Grafana (optional dashboards)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This setup is commonly used in startups and cloud-native environments.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Install Dependencies&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;First, install the required packages:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;pip install fastapi uvicorn prometheus-client&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Python API With Prometheus Metrics&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Below is a simple FastAPI application that exposes metrics at /metrics.&lt;br&gt;
Prometheus will scrape this endpoint every few seconds.&lt;/p&gt;

&lt;p&gt;__from fastapi import FastAPI&lt;br&gt;
from prometheus_client import Counter, Histogram, generate_latest&lt;br&gt;
from fastapi.responses import Response&lt;br&gt;
import time&lt;br&gt;
import random&lt;/p&gt;

&lt;p&gt;app = FastAPI()&lt;/p&gt;

&lt;p&gt;REQUEST_COUNT = Counter("api_requests_total", "Total number of API requests received")&lt;br&gt;
REQUEST_LATENCY = Histogram("api_request_latency_seconds", "API request latency")&lt;/p&gt;

&lt;p&gt;@app.get("/")&lt;br&gt;
def home():&lt;br&gt;
    REQUEST_COUNT.inc()&lt;br&gt;
    with REQUEST_LATENCY.time():&lt;br&gt;
        time.sleep(random.uniform(0.1, 0.5))&lt;br&gt;
        return {"message": "API is running successfully"}_&lt;/p&gt;

&lt;p&gt;@app.get("/metrics")&lt;br&gt;
def metrics():&lt;br&gt;
    return Response(generate_latest(), media_type="text/plain")_&lt;/p&gt;

&lt;p&gt;What this code does:&lt;br&gt;
Metric                          Description&lt;br&gt;
api_requests_total          Counts all incoming requests&lt;br&gt;
api_request_latency_seconds Measures request duration&lt;/p&gt;

&lt;p&gt;These metrics help determine whether the API is fast, overloaded, or failing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Prometheus Configuration&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Create a file named prometheus.yml:&lt;/p&gt;

&lt;p&gt;_global:&lt;br&gt;
  scrape_interval: 5s&lt;/p&gt;

&lt;p&gt;scrape_configs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;job_name: "python-api"
static_configs:

&lt;ul&gt;
&lt;li&gt;targets: ["localhost:8000"]_&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;Prometheus will scrape the metrics endpoint at:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="http://localhost:8000/metrics" rel="noopener noreferrer"&gt;http://localhost:8000/metrics&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Run Prometheus&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Download Prometheus, then run it:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;./prometheus --config.file=prometheus.yml&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Open the Prometheus UI at:&lt;br&gt;
_&lt;br&gt;
&lt;a href="http://localhost:9090_" rel="noopener noreferrer"&gt;http://localhost:9090_&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Query metrics like:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;api_requests_total&lt;br&gt;
rate(api_requests_total[1m])&lt;br&gt;
api_request_latency_seconds_bucket&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Optional: Grafana Dashboard&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Grafana can visualize your Prometheus metrics with modern dashboards.&lt;/p&gt;

&lt;p&gt;Typical graphs include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Request rate&lt;/li&gt;
&lt;li&gt;CPU and memory usage&lt;/li&gt;
&lt;li&gt;Error percentage&lt;/li&gt;
&lt;li&gt;Latency (p95, p99)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is valuable when demonstrating observability to teams or stakeholders.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Observability Best Practices&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To implement observability professionally:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;✔ Instrument every major endpoint&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Expose metrics for performance-critical APIs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;✔ Standardize metric names&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Avoid random or unstructured naming.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;✔ Include labels (tags)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Labels such as status_code, endpoint, or method add context.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;✔ Use alerts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
“95th percentile latency exceeds 500ms for 3 minutes.”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;✔ Visualize everything&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Dashboards make patterns obvious.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;✔ Combine logs, metrics, and traces&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Observability works best when all three pillars are present.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Observability allows teams to deeply understand how their systems behave.&lt;br&gt;
Using Prometheus + FastAPI, I demonstrated how to expose useful metrics that support:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Faster debugging&lt;/li&gt;
&lt;li&gt;Better performance insights&lt;/li&gt;
&lt;li&gt;Safer deployments&lt;/li&gt;
&lt;li&gt;Scalable system monitoring&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This example can be expanded with tracing (OpenTelemetry), log pipelines (ELK Stack), or full cloud observability platforms like AWS CloudWatch, Datadog, or Azure Monitor.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Prometheus Documentation – &lt;a href="https://prometheus.io/docs" rel="noopener noreferrer"&gt;https://prometheus.io/docs&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Grafana Documentation – &lt;a href="https://grafana.com/docs" rel="noopener noreferrer"&gt;https://grafana.com/docs&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;FastAPI – &lt;a href="https://fastapi.tiangolo.com" rel="noopener noreferrer"&gt;https://fastapi.tiangolo.com&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;OpenTelemetry – &lt;a href="https://opentelemetry.io" rel="noopener noreferrer"&gt;https://opentelemetry.io&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>monitoring</category>
      <category>devops</category>
      <category>tutorial</category>
      <category>python</category>
    </item>
    <item>
      <title>Building a Remote MCP Server and Connecting It to Any MCP Client</title>
      <dc:creator>DAVID JORDAN ANAMPA PANCCA</dc:creator>
      <pubDate>Thu, 04 Dec 2025 02:01:52 +0000</pubDate>
      <link>https://forem.com/david_jordananampapancc/building-a-remote-mcp-server-and-connecting-it-to-any-mcp-client-51f1</link>
      <guid>https://forem.com/david_jordananampapancc/building-a-remote-mcp-server-and-connecting-it-to-any-mcp-client-51f1</guid>
      <description>&lt;ol&gt;
&lt;li&gt;Introduction&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The Model Context Protocol (MCP) is a new standard that allows AI models—such as Claude, ChatGPT, or Gemini—to connect with external tools, APIs, and systems in a secure and controlled way. Instead of being limited to conversation, the AI can interact with real-world environments and perform useful actions.&lt;/p&gt;

&lt;p&gt;In this article, I explain how to build a simple MCP Server, how it works internally, how to connect it to any MCP Client, and why this technology is becoming essential for developers and small teams who want to integrate AI into their workflows.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What Is an MCP Server?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;An MCP Server is a small application that exposes tools, functions, or resources to an AI model through the MCP protocol.&lt;br&gt;
It works like a bridge:&lt;/p&gt;

&lt;p&gt;AI Model → MCP Client → Your MCP Server → Tools / APIs / Files / Databases&lt;/p&gt;

&lt;p&gt;An MCP Server can provide:&lt;/p&gt;

&lt;p&gt;File access (read/write)&lt;/p&gt;

&lt;p&gt;API calls&lt;/p&gt;

&lt;p&gt;Automation scripts&lt;/p&gt;

&lt;p&gt;Database query tools&lt;/p&gt;

&lt;p&gt;Cloud integrations&lt;/p&gt;

&lt;p&gt;Custom business logic&lt;/p&gt;

&lt;p&gt;Any MCP-compatible client can communicate with it, including:&lt;/p&gt;

&lt;p&gt;Claude Desktop&lt;/p&gt;

&lt;p&gt;MCP plugins for VSCode&lt;/p&gt;

&lt;p&gt;Custom MCP Clients&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;How MCP Architecture Works&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The general architecture looks like this:&lt;/p&gt;

&lt;p&gt;AI Model → MCP Client → WebSocket/STDIO → MCP Server → Your Tools&lt;/p&gt;

&lt;p&gt;The key idea:&lt;/p&gt;

&lt;p&gt;The client handles the communication&lt;/p&gt;

&lt;p&gt;The server exposes the tools&lt;/p&gt;

&lt;p&gt;The AI model decides when to use them&lt;/p&gt;

&lt;p&gt;This separation keeps everything secure and modular.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Why Build Your Own MCP Server?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Building an MCP Server lets your AI assistant interact directly with your environment.&lt;/p&gt;

&lt;p&gt;Benefits:&lt;/p&gt;

&lt;p&gt;Automate repetitive tasks&lt;/p&gt;

&lt;p&gt;Trigger scripts or system actions&lt;/p&gt;

&lt;p&gt;Query databases&lt;/p&gt;

&lt;p&gt;Access real-time information&lt;/p&gt;

&lt;p&gt;Build personalized developer tools&lt;/p&gt;

&lt;p&gt;Create AI-powered copilots for your workspace&lt;/p&gt;

&lt;p&gt;It transforms the AI into a hands-on assistant, not just a chatbot.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Building a Simple MCP Server (Step-by-Step)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here is the simplest structure for an MCP Server using Node.js.&lt;/p&gt;

&lt;p&gt;Step 1 — Create a new project&lt;br&gt;
npm init -y&lt;br&gt;
npm install @modelcontextprotocol/sdk typescript ts-node&lt;br&gt;
npx tsc --init&lt;/p&gt;

&lt;p&gt;Step 2 — Create the server file&lt;/p&gt;

&lt;p&gt;src/server.ts&lt;/p&gt;

&lt;p&gt;import {&lt;br&gt;
  Server,&lt;br&gt;
  Tool,&lt;br&gt;
  StdioServerTransport,&lt;br&gt;
} from "@modelcontextprotocol/sdk";&lt;/p&gt;

&lt;p&gt;const server = new Server(&lt;br&gt;
  {&lt;br&gt;
    name: "example-mcp-server",&lt;br&gt;
    version: "1.0.0",&lt;br&gt;
  },&lt;br&gt;
  {&lt;br&gt;
    capabilities: { tools: {} },&lt;br&gt;
  }&lt;br&gt;
);&lt;/p&gt;

&lt;p&gt;server.tool("getDate", new Tool(async () =&amp;gt; {&lt;br&gt;
  return { now: new Date().toISOString() };&lt;br&gt;
}));&lt;/p&gt;

&lt;p&gt;server.connect(new StdioServerTransport());&lt;/p&gt;

&lt;p&gt;Step 3 — Build and run&lt;br&gt;
npm run build&lt;br&gt;
node dist/server.js&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Connecting the Server to Claude Desktop&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Edit the Claude config file:&lt;/p&gt;

&lt;p&gt;Windows:&lt;br&gt;
%APPDATA%/Claude/claude_desktop_config.json&lt;/p&gt;

&lt;p&gt;Mac:&lt;br&gt;
~/Library/Application Support/Claude/claude_desktop_config.json&lt;/p&gt;

&lt;p&gt;Add:&lt;/p&gt;

&lt;p&gt;{&lt;br&gt;
  "mcpServers": {&lt;br&gt;
    "myServer": {&lt;br&gt;
      "command": "node",&lt;br&gt;
      "args": ["path/to/dist/server.js"]&lt;br&gt;
    }&lt;br&gt;
  }&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;Restart Claude — the tool will appear automatically.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Optional: Deploying to the Cloud&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You can deploy your MCP Server to:&lt;/p&gt;

&lt;p&gt;Google Cloud Run&lt;/p&gt;

&lt;p&gt;Cloudflare Workers&lt;/p&gt;

&lt;p&gt;Vercel Edge Functions&lt;/p&gt;

&lt;p&gt;Any container-based system&lt;/p&gt;

&lt;p&gt;This allows AI tools to access your server remotely and securely.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Example Use Cases
✔ Developer automation&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Let Claude run scripts, lint code, or review PRs using local tools.&lt;/p&gt;

&lt;p&gt;✔ Internal business tools&lt;/p&gt;

&lt;p&gt;Let AI access internal APIs, inventory systems, or customer data (safely).&lt;/p&gt;

&lt;p&gt;✔ File automation&lt;/p&gt;

&lt;p&gt;Automatically generate documents, update logs, and manage repositories.&lt;/p&gt;

&lt;p&gt;✔ Cloud operations&lt;/p&gt;

&lt;p&gt;Interact with cloud services via API integrations.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Good Practices&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Do not expose tools without authentication&lt;/p&gt;

&lt;p&gt;Log all interactions for auditing&lt;/p&gt;

&lt;p&gt;Validate all input schemas&lt;/p&gt;

&lt;p&gt;Apply rate limiting&lt;/p&gt;

&lt;p&gt;Keep the server’s environment isolated&lt;/p&gt;

&lt;p&gt;These prevent unsafe use and keep the MCP server secure.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Building an MCP Server is a powerful way to connect AI models with real-world systems. With only a few lines of code, you can expose tools, automate workflows, and create intelligent assistants that work directly with your environment. Whether you deploy it locally or in the cloud, MCP opens the door to the next generation of AI-powered automation.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;References&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Cloudflare Agents Docs (2024). Build a Remote MCP Server.&lt;/p&gt;

&lt;p&gt;Google Cloud Blog (2024). Deploy a Remote MCP Server to Cloud Run.&lt;/p&gt;

&lt;p&gt;Composio (2024). MCP Server: Step-by-Step Guide to Building from Scratch.&lt;/p&gt;

&lt;p&gt;Anthropic (2024). Model Context Protocol Specification.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>tutorial</category>
      <category>architecture</category>
    </item>
  </channel>
</rss>
