<?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>DEV Community: Nishant Modak</title>
    <description>The latest articles on DEV Community by Nishant Modak (@nishantmodak).</description>
    <link>https://dev.to/nishantmodak</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%2F417448%2Fd5e34c18-82e1-4a8d-8419-da94df7b47c4.jpeg</url>
      <title>DEV Community: Nishant Modak</title>
      <link>https://dev.to/nishantmodak</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nishantmodak"/>
    <language>en</language>
    <item>
      <title>The 6 Questions to Ask Before Adding a High-Cardinality Label</title>
      <dc:creator>Nishant Modak</dc:creator>
      <pubDate>Mon, 19 Jan 2026 20:38:17 +0000</pubDate>
      <link>https://dev.to/last9/the-6-questions-to-ask-before-adding-a-high-cardinality-label-3pef</link>
      <guid>https://dev.to/last9/the-6-questions-to-ask-before-adding-a-high-cardinality-label-3pef</guid>
      <description>&lt;p&gt;Last month, a team I was talking to added a &lt;code&gt;pod_id&lt;/code&gt; label to debug a networking issue. Seemed harmless - only 200 pods.&lt;/p&gt;

&lt;p&gt;But with 50 metrics per pod and 2-minute pod churn during deployments, they created &lt;strong&gt;150,000 new series per hour&lt;/strong&gt;. Prometheus memory climbed from 8GB to 32GB in a week. They didn't notice until it OOMKilled during a production incident.&lt;/p&gt;

&lt;p&gt;The fix took 10 minutes. The outage took 3 hours. The postmortem took a week.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Checklist
&lt;/h2&gt;

&lt;p&gt;Before adding any label that could explode, ask:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Which system stores this?
&lt;/h3&gt;

&lt;p&gt;Prometheus pays cardinality costs at write time (memory). ClickHouse pays at query time (aggregation). Know your failure mode.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Is this for alerting or investigation?
&lt;/h3&gt;

&lt;p&gt;Alerting &lt;strong&gt;must&lt;/strong&gt; be bounded. Investigation can be unbounded - but maybe shouldn't live in Prometheus.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. What's the expected cardinality?
&lt;/h3&gt;

&lt;p&gt;distinct_values × other_label_combinations = series count&lt;br&gt;
  200 pods × 50 metrics × 10 endpoints = 100,000 series. Per deployment.&lt;/p&gt;
&lt;h3&gt;
  
  
  4. What's the growth rate?
&lt;/h3&gt;

&lt;p&gt;Will this 10x in a year? Containers, request IDs, user IDs - these grow with traffic.&lt;/p&gt;
&lt;h3&gt;
  
  
  5. Is there a fallback?
&lt;/h3&gt;

&lt;p&gt;Can you drop this label via &lt;code&gt;metric_relabel_configs&lt;/code&gt; if it explodes? Test this before you need it.&lt;/p&gt;
&lt;h3&gt;
  
  
  6. Who owns this label?
&lt;/h3&gt;

&lt;p&gt;When it causes problems at 3am, who gets paged?&lt;/p&gt;
&lt;h2&gt;
  
  
  Metrics to Watch
&lt;/h2&gt;

&lt;p&gt;Before cardinality bites:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  prometheus_tsdb_head_series              # Active series count
  prometheus_tsdb_head_chunks_created_total # Rate of new chunks
  prometheus_tsdb_symbol_table_size_bytes  # Memory for interned strings
  process_resident_memory_bytes            # Actual memory usage
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If head_series grows faster than expected, you have a problem brewing.&lt;/p&gt;




&lt;p&gt;Going Deeper&lt;/p&gt;

&lt;p&gt;I wrote a full breakdown of how Prometheus and ClickHouse handle cardinality differently at the storage engine level - head blocks, posting lists, Gorilla encoding, columnar storage, GROUP BY explosions.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://last9.io/blog/high-cardinality-metrics-prometheus-clickhouse/" rel="noopener noreferrer"&gt;https://last9.io/blog/high-cardinality-metrics-prometheus-clickhouse/&lt;/a&gt; - covers why they fail in completely different ways and how to design pipelines knowing that.&lt;/p&gt;

</description>
      <category>analytics</category>
      <category>monitoring</category>
      <category>prometheus</category>
      <category>devops</category>
    </item>
    <item>
      <title>Debugging Microservices Like a Pro: How Trace IDs Saved My Production Incident</title>
      <dc:creator>Nishant Modak</dc:creator>
      <pubDate>Mon, 19 Jan 2026 06:39:26 +0000</pubDate>
      <link>https://dev.to/nishantmodak/debugging-microservices-like-a-pro-how-trace-ids-saved-my-production-incident-7o6</link>
      <guid>https://dev.to/nishantmodak/debugging-microservices-like-a-pro-how-trace-ids-saved-my-production-incident-7o6</guid>
      <description>&lt;p&gt;Last week, our checkout service started timing out randomly. 2% of requests, no pattern, no obvious cause. Here's how I tracked it down using trace IDs.&lt;/p&gt;

&lt;p&gt;## The Problem&lt;/p&gt;

&lt;p&gt;Our architecture:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;API Gateway → Auth Service → Cart Service → Payment Service → Notification Service&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Users reported "payment failed" but logs showed success everywhere. Classic distributed systems nightmare.&lt;/p&gt;

&lt;p&gt;## The Fix: Following the Trace ID&lt;/p&gt;

&lt;p&gt;Every request gets a unique trace ID at the gateway. I grep'd for a failing request's trace ID across all services:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="s2"&gt;"trace_id=abc123"&lt;/span&gt; /var/log/&lt;span class="k"&gt;*&lt;/span&gt;.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Found it: Cart Service was returning 200, but with an empty response body. Payment Service treated empty as "no items" and silently skipped.&lt;/p&gt;

&lt;p&gt;Without trace IDs, I'd still be searching.&lt;/p&gt;

&lt;p&gt;Trace ID vs Correlation ID&lt;/p&gt;

&lt;p&gt;One thing that confused me early on: what's the difference between a trace ID and correlation ID?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://last9.io/blog/correlation-id-vs-trace-id/" rel="noopener noreferrer"&gt;https://last9.io/blog/correlation-id-vs-trace-id/&lt;/a&gt; - they follow a request across service boundaries with parent-child span relationships. Correlation IDs are simpler - just a shared identifier without the hierarchy.&lt;/p&gt;

&lt;p&gt;For debugging microservices, trace IDs give you the full picture.&lt;/p&gt;

&lt;p&gt;Quick Implementation (Node.js)&lt;/p&gt;

&lt;p&gt;`const { trace } = require('@opentelemetry/api');&lt;/p&gt;

&lt;p&gt;app.use((req, res, next) =&amp;gt; {&lt;br&gt;
    const span = trace.getActiveSpan();&lt;br&gt;
    const traceId = span?.spanContext().traceId;&lt;br&gt;
    req.traceId = traceId;&lt;br&gt;
    console.log(&lt;code&gt;[${traceId}] ${req.method} ${req.path}&lt;/code&gt;);&lt;br&gt;
    next();&lt;br&gt;
  });`&lt;/p&gt;

&lt;p&gt;Key Takeaways&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Always propagate trace IDs across services&lt;/li&gt;
&lt;li&gt;Log the trace ID with every log line&lt;/li&gt;
&lt;li&gt;Use distributed tracing tools (Jaeger, Tempo, Last9) to visualize&lt;/li&gt;
&lt;li&gt;When debugging, start with the trace ID and follow it&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;What's your go-to debugging strategy for microservices? Drop a comment!&lt;/p&gt;

</description>
      <category>observability</category>
      <category>microservices</category>
    </item>
    <item>
      <title>Is Bun Production-Ready in 2026? A Practical Assessment</title>
      <dc:creator>Nishant Modak</dc:creator>
      <pubDate>Fri, 16 Jan 2026 22:00:00 +0000</pubDate>
      <link>https://dev.to/last9/is-bun-production-ready-in-2026-a-practical-assessment-181h</link>
      <guid>https://dev.to/last9/is-bun-production-ready-in-2026-a-practical-assessment-181h</guid>
      <description>&lt;h1&gt;
  
  
  Is Bun Production-Ready in 2026? A Practical Assessment
&lt;/h1&gt;

&lt;p&gt;Bun has come a long way since its initial release. With the &lt;a href="https://www.anthropic.com/news/anthropic-acquires-bun-as-claude-code-reaches-usd1b-milestone" rel="noopener noreferrer"&gt;Anthropic acquisition in December 2025&lt;/a&gt;, the project now has significant backing and a clear path forward. But is it ready for your production workloads?&lt;/p&gt;

&lt;h2&gt;
  
  
  What's Changed Recently
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Bun 1.3+ Features
&lt;/h3&gt;

&lt;p&gt;The recent releases have focused on developer experience:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Zero-config frontend dev&lt;/strong&gt;: Run &lt;code&gt;bun index.html&lt;/code&gt; directly — it handles hot reloading, ES modules, React transpilation. No Vite or Webpack config needed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Built-in database clients&lt;/strong&gt;: &lt;code&gt;Bun.SQL&lt;/code&gt; supports PostgreSQL, MySQL, and SQLite natively.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Package security&lt;/strong&gt;: &lt;code&gt;bun pm check&lt;/code&gt; integrates with Socket.dev for vulnerability scanning.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  The Anthropic Factor
&lt;/h3&gt;

&lt;p&gt;The acquisition signals long-term investment. Bun powers Claude Code (which hit $1B ARR), so Anthropic has strong incentive to keep it stable and performant. The team remains the same, and it stays MIT-licensed.&lt;/p&gt;

&lt;h2&gt;
  
  
  When Bun Makes Sense
&lt;/h2&gt;

&lt;p&gt;Based on production experience, here's where Bun shines:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Good fits:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;APIs and microservices (fast cold starts matter)&lt;/li&gt;
&lt;li&gt;CLI tools and scripts (native TypeScript, fast startup)&lt;/li&gt;
&lt;li&gt;Internal tooling (speed up dev cycles)&lt;/li&gt;
&lt;li&gt;SSR apps with React/Vue (built-in bundling)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Proceed with caution:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Apps heavily dependent on native Node modules&lt;/li&gt;
&lt;li&gt;Workloads requiring every Node.js API to match exactly&lt;/li&gt;
&lt;li&gt;Mission-critical systems without thorough dependency testing&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Practical Considerations
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Pin your versions&lt;/strong&gt; — Bun's patch releases sometimes include new features&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Test your dependencies&lt;/strong&gt; — Most npm packages work, but edge cases exist&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check Node.js API coverage&lt;/strong&gt; — Some APIs have gaps or behave slightly differently&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Getting Started
&lt;/h2&gt;

&lt;p&gt;If you're evaluating Bun for a new project, check out this &lt;a href="https://last9.io/blog/getting-started-with-bun-js/" rel="noopener noreferrer"&gt;comprehensive getting started guide&lt;/a&gt; that covers installation, configuration, and use cases in detail.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bottom Line
&lt;/h2&gt;

&lt;p&gt;Bun is production-viable for many workloads in 2026. The Anthropic backing reduces abandonment risk, and the tooling has matured. Start with lower-stakes projects, validate your specific dependencies, and scale from there.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;What's your experience with Bun in production? Drop a comment below.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>bunjs</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Why High-Cardinality Metrics Break Everything</title>
      <dc:creator>Nishant Modak</dc:creator>
      <pubDate>Thu, 01 Jan 2026 20:56:38 +0000</pubDate>
      <link>https://dev.to/last9/why-high-cardinality-metrics-break-everything-36d</link>
      <guid>https://dev.to/last9/why-high-cardinality-metrics-break-everything-36d</guid>
      <description>&lt;p&gt;High-cardinality metrics are one of those ideas that sound obviously right—until you try to use them in production.&lt;/p&gt;

&lt;p&gt;In theory, they promise precision. Instead of averages and rollups, you get specificity: &lt;code&gt;per-request&lt;/code&gt;, &lt;code&gt;per-user ID&lt;/code&gt;, &lt;code&gt;per-container&lt;/code&gt;, &lt;code&gt;per-feature&lt;/code&gt; insights. The kind of detail engineers instinctively want when something is on fire.&lt;/p&gt;

&lt;p&gt;And then things start breaking.&lt;/p&gt;

&lt;p&gt;Not immediately. Not loudly. But quietly—often in ways that feel like mysterious bugs until you realize the system itself was never designed for this shape of data.&lt;/p&gt;

&lt;p&gt;What makes high-cardinality failures especially painful is that nothing crashes. Dashboards still load. Alerts still fire. Deploys continue as usual. The only early signal is often an unexplainable cost spike or queries that suddenly feel sluggish during incidents.&lt;/p&gt;

&lt;p&gt;Under the hood, the reason is mechanical. Every unique label combination creates a new time series. Each series needs storage, index entries, memory during ingestion, and ongoing compaction work. As cardinality grows, cost and query complexity don’t scale linearly—they multiply.&lt;/p&gt;

&lt;p&gt;At query time, the problem gets worse. Filters that once narrowed the search space stop being selective. Queries fan out across hundreds of thousands—or millions—of sparse, short-lived series. The query engine isn’t broken; it’s doing exactly what it was asked to do, across far more data than anyone realized they’d created.&lt;/p&gt;

&lt;p&gt;The most dangerous failure mode isn’t cost or performance—it’s trust. Charts flicker. Series appear and disappear. Queries return inconsistent shapes. Engineers stop believing what they see and quietly fall back to logs, not because logs are better, but because they’re predictable.&lt;/p&gt;

&lt;p&gt;The takeaway isn’t that high cardinality is bad. It’s that unbounded, accidental cardinality shows up later as cost surprises, slow queries, and trust erosion unless systems are explicitly designed for it.&lt;/p&gt;

&lt;p&gt;If this sounds familiar, the full post walks through: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;why these failures are hard to detect early&lt;/li&gt;
&lt;li&gt;the systems-level mechanics behind them and&lt;/li&gt;
&lt;li&gt;the patterns teams use to make high-cardinality metrics survivable in practice&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Complete article here&lt;br&gt;
&lt;a href="https://last9.io/blog/why-high-cardinality-metrics-break/" rel="noopener noreferrer"&gt;https://last9.io/blog/why-high-cardinality-metrics-break/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>analytics</category>
      <category>timeseries</category>
      <category>monitoring</category>
      <category>devops</category>
    </item>
    <item>
      <title>Log Anything vs Log Everything</title>
      <dc:creator>Nishant Modak</dc:creator>
      <pubDate>Wed, 16 Oct 2024 02:37:07 +0000</pubDate>
      <link>https://dev.to/last9/log-anything-vs-log-everything-2c50</link>
      <guid>https://dev.to/last9/log-anything-vs-log-everything-2c50</guid>
      <description>&lt;p&gt;Log Everything vs. Log Anything  ⚡️&lt;/p&gt;

&lt;p&gt;&lt;a href="https://last9.io/blog/log-anything-vs-log-everything/" rel="noopener noreferrer"&gt;https://last9.io/blog/log-anything-vs-log-everything/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Log Everything: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Structured, consistent logging across services&lt;/li&gt;
&lt;li&gt;High-cardinality data that adds context&lt;/li&gt;
&lt;li&gt;Events that tell a story about system behavior&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Fine wine, complex yet clear. Helps future you debug at 3 AM.&lt;/p&gt;

&lt;p&gt;Log Anything:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Random console.log("here") sprinkled like confetti&lt;/li&gt;
&lt;li&gt;Unstructured text that's a pain to parse&lt;/li&gt;
&lt;li&gt;Non-thoughtful severity levels.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Mystery juice, might be tasty, might be toxic. Future you curses past you at 3 AM.&lt;/p&gt;

</description>
      <category>logging</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Log Models</title>
      <dc:creator>Nishant Modak</dc:creator>
      <pubDate>Sat, 28 Sep 2024 04:29:41 +0000</pubDate>
      <link>https://dev.to/nishantmodak/log-models-55</link>
      <guid>https://dev.to/nishantmodak/log-models-55</guid>
      <description>&lt;p&gt;If LLM Models are all the rage, can we use them for understanding our telemetry data and in particular, logs?&lt;/p&gt;

&lt;p&gt;What models are available so we can use that?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://nishantmodak.github.io/engineering/2024/09/27/log-models.html" rel="noopener noreferrer"&gt;https://nishantmodak.github.io/engineering/2024/09/27/log-models.html&lt;/a&gt;&lt;/p&gt;

</description>
      <category>logging</category>
      <category>observability</category>
    </item>
    <item>
      <title>Logging in Python: Best Practices</title>
      <dc:creator>Nishant Modak</dc:creator>
      <pubDate>Fri, 20 Sep 2024 17:47:59 +0000</pubDate>
      <link>https://dev.to/nishantmodak/logging-in-python-best-practices-21n8</link>
      <guid>https://dev.to/nishantmodak/logging-in-python-best-practices-21n8</guid>
      <description>&lt;p&gt;Today we're going to talk about something that's about as exciting as watching paint dry, but twice as important: Python logging. &lt;/p&gt;

&lt;p&gt;Now, I know what you're thinking. "Nishant, I'd rather stick a fork in my eye than deal with logging." Well, tough noodles, because if you want to be a real programmer - you know, the kind that doesn't spend their weekends hunting for that one bug that's been driving the entire dev team insane - you need to master the art of logging.&lt;/p&gt;

&lt;p&gt;You see, &lt;a href="https://last9.io/blog/radar-and-black-boxes-for-software-observability/" rel="noopener noreferrer"&gt;logging is like the black box&lt;/a&gt; in an airplane. When everything's going smoothly, nobody gives a hoot about it. But the moment your code decides to take a nosedive into the Pacific Ocean of runtime errors, you'll be thanking your lucky stars for every log message you wrote. It's the difference between spending five minutes identifying the problem and spending five days growing a beard while you comb through your entire codebase.&lt;/p&gt;

&lt;p&gt;So buckle up. We're about to embark on a magical journey through the land of &lt;a href="https://last9.io/blog/python-logging-best-practices/" rel="noopener noreferrer"&gt;Python logging&lt;/a&gt;. By the end of this article, you'll be logging like a lumberjack on steroids. And who knows? You might even enjoy it. (Okay, that's a stretch, but at least you won't hate it as much.)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; What is Python logging?&lt;/li&gt;
&lt;li&gt; Python logging module&lt;/li&gt;
&lt;li&gt;Printing vs logging&lt;/li&gt;
&lt;li&gt;Python logging examples&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Snippet 1: Creating a logger with a handler and a formatter&lt;br&gt;
Snippet 2: Logging to a file&lt;br&gt;
Snippet 3: Using logging in a class&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Types of Python logging methods&lt;/li&gt;
&lt;li&gt;How to get started with Python logging&lt;/li&gt;
&lt;li&gt;Advantages and disadvantages of Python logging&lt;/li&gt;
&lt;li&gt;Python logging platforms&lt;/li&gt;
&lt;li&gt;Basic Python logging concepts&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Python logging configuration&lt;br&gt;
Configuring the library&lt;br&gt;
Customizing via factory functions&lt;br&gt;
Configuring using Configparse-Format Files&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Python logging performance&lt;br&gt;
Configuration-based considerations&lt;br&gt;
Code-based considerations&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Advanced logging techniques&lt;br&gt;
Contextual logging with extra parameter&lt;br&gt;
Using LoggerAdapter for adding context&lt;br&gt;
Logging exceptions&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Best practices for Python logging&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now that we've got our roadmap, let's dive into the nitty-gritty of Python logging. Trust me, it's going to be a wild ride. Well, as wild as logging can be, which is about as wild as a sloth on sedatives. But hey, you're here to learn, not to party, right? &lt;a href="https://last9.io/blog/python-logging-best-practices/" rel="noopener noreferrer"&gt;https://last9.io/blog/python-logging-best-practices/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>programming</category>
      <category>logging</category>
    </item>
    <item>
      <title>Logging in Python: Best Practices</title>
      <dc:creator>Nishant Modak</dc:creator>
      <pubDate>Fri, 20 Sep 2024 17:47:59 +0000</pubDate>
      <link>https://dev.to/nishantmodak/logging-in-python-best-practices-48dg</link>
      <guid>https://dev.to/nishantmodak/logging-in-python-best-practices-48dg</guid>
      <description>&lt;p&gt;Today we're going to talk about something that's about as exciting as watching paint dry, but twice as important: Python logging. &lt;/p&gt;

&lt;p&gt;Now, I know what you're thinking. "Nishant, I'd rather stick a fork in my eye than deal with logging." Well, tough noodles, because if you want to be a real programmer - you know, the kind that doesn't spend their weekends hunting for that one bug that's been driving the entire dev team insane - you need to master the art of logging.&lt;/p&gt;

&lt;p&gt;You see, &lt;a href="https://last9.io/blog/radar-and-black-boxes-for-software-observability/" rel="noopener noreferrer"&gt;logging is like the black box&lt;/a&gt; in an airplane. When everything's going smoothly, nobody gives a hoot about it. But the moment your code decides to take a nosedive into the Pacific Ocean of runtime errors, you'll be thanking your lucky stars for every log message you wrote. It's the difference between spending five minutes identifying the problem and spending five days growing a beard while you comb through your entire codebase.&lt;/p&gt;

&lt;p&gt;So buckle up. We're about to embark on a magical journey through the land of &lt;a href="https://last9.io/blog/python-logging-best-practices/" rel="noopener noreferrer"&gt;Python logging&lt;/a&gt;. By the end of this article, you'll be logging like a lumberjack on steroids. And who knows? You might even enjoy it. (Okay, that's a stretch, but at least you won't hate it as much.)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; What is Python logging?&lt;/li&gt;
&lt;li&gt; Python logging module&lt;/li&gt;
&lt;li&gt;Printing vs logging&lt;/li&gt;
&lt;li&gt;Python logging examples&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Snippet 1: Creating a logger with a handler and a formatter&lt;br&gt;
Snippet 2: Logging to a file&lt;br&gt;
Snippet 3: Using logging in a class&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Types of Python logging methods&lt;/li&gt;
&lt;li&gt;How to get started with Python logging&lt;/li&gt;
&lt;li&gt;Advantages and disadvantages of Python logging&lt;/li&gt;
&lt;li&gt;Python logging platforms&lt;/li&gt;
&lt;li&gt;Basic Python logging concepts&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Python logging configuration&lt;br&gt;
Configuring the library&lt;br&gt;
Customizing via factory functions&lt;br&gt;
Configuring using Configparse-Format Files&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Python logging performance&lt;br&gt;
Configuration-based considerations&lt;br&gt;
Code-based considerations&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Advanced logging techniques&lt;br&gt;
Contextual logging with extra parameter&lt;br&gt;
Using LoggerAdapter for adding context&lt;br&gt;
Logging exceptions&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Best practices for Python logging&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now that we've got our roadmap, let's dive into the nitty-gritty of Python logging. Trust me, it's going to be a wild ride. Well, as wild as logging can be, which is about as wild as a sloth on sedatives. But hey, you're here to learn, not to party, right? &lt;a href="https://last9.io/blog/python-logging-best-practices/" rel="noopener noreferrer"&gt;https://last9.io/blog/python-logging-best-practices/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>programming</category>
      <category>logging</category>
    </item>
    <item>
      <title>Prometheus Remote Write</title>
      <dc:creator>Nishant Modak</dc:creator>
      <pubDate>Mon, 16 Sep 2024 23:33:57 +0000</pubDate>
      <link>https://dev.to/last9/prometheus-remote-write-51n6</link>
      <guid>https://dev.to/last9/prometheus-remote-write-51n6</guid>
      <description>&lt;p&gt;Ever felt like your Prometheus setup is about to burst at the seams? You're not alone. We've all been there, watching our monitoring system groan under the weight of a million time series.&lt;/p&gt;

&lt;p&gt;But fear not! I've just penned an epic saga on taming the beast that is &lt;a href="https://last9.io/blog/what-is-prometheus-remote-write/" rel="noopener noreferrer"&gt;Prometheus remote write&lt;/a&gt;. We're talking queue wizardry, cardinality kung-fu, and relabeling magic that'll make your metrics flow like butter.&lt;br&gt;
Oh, and there's a juicy example where we turned a metric firehose into a well-behaved garden sprinkler. Spoiler: It involves a 60% CPU diet and a 70% latency liposuction.&lt;/p&gt;

&lt;p&gt;Curious? Hop over to the blogpost for the full scoop.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://last9.io/blog/optimizing-prometheus-remote-write-performance-guide/" rel="noopener noreferrer"&gt;Optimizing remote write performance&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Happy optimizing, and may your dashboards be ever green! 🚀📉&lt;/p&gt;

</description>
      <category>monitoring</category>
      <category>promql</category>
      <category>prometheus</category>
    </item>
    <item>
      <title>Logging in Golang</title>
      <dc:creator>Nishant Modak</dc:creator>
      <pubDate>Sat, 14 Sep 2024 05:44:52 +0000</pubDate>
      <link>https://dev.to/last9/logging-in-golang-40k2</link>
      <guid>https://dev.to/last9/logging-in-golang-40k2</guid>
      <description>&lt;p&gt;Practical insights into Golang logging, including how to use the log package, popular third-party libraries, and tips for structured logging.&lt;/p&gt;

&lt;p&gt;Table of Contents&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Introduction to Golang Logging&lt;/li&gt;
&lt;li&gt;The Standard Library: log Package
&lt;em&gt;How I Learned to Stop Worrying and Love fmt.Println()&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;Popular Third-Party Logging Libraries
&lt;em&gt;Because Reinventing the wheel is so 2000s&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;Structured Logging in Go
&lt;em&gt;JSON: Its whats for dinner&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;Configuring Log Levels and Output Formats
&lt;em&gt;Choosing your adventure&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;Integrating with Observability Platforms
&lt;em&gt;Because logs are lonely without metrics and traces&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;Best Practices and Performance Considerations
&lt;em&gt;How to not shoot yourself in the foot&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;Real-World Examples
&lt;em&gt;I really have used this stuff myself&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;Conclusion
&lt;em&gt;Log everything; but log it right with a schema (Otel)&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://last9.io/blog/golang-logging-guide-for-developers/" rel="noopener noreferrer"&gt;Golang logging guide&lt;/a&gt; for developers &lt;/p&gt;

</description>
      <category>logging</category>
      <category>go</category>
      <category>programming</category>
    </item>
    <item>
      <title>Watermelon Metrics</title>
      <dc:creator>Nishant Modak</dc:creator>
      <pubDate>Tue, 13 Jul 2021 04:38:42 +0000</pubDate>
      <link>https://dev.to/last9/watermelon-metrics-23pf</link>
      <guid>https://dev.to/last9/watermelon-metrics-23pf</guid>
      <description>&lt;p&gt;Watermelon Metrics; A situation where individual dashboards look green, but the overall performance is broken and red inside.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://blog.last9.io/need-for-systems-observability/"&gt;https://blog.last9.io/need-for-systems-observability/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>devops</category>
      <category>monitoring</category>
      <category>sre</category>
    </item>
    <item>
      <title>Nobody likes to wait in a Queue</title>
      <dc:creator>Nishant Modak</dc:creator>
      <pubDate>Fri, 24 Jul 2020 07:25:21 +0000</pubDate>
      <link>https://dev.to/nishantmodak/nobody-likes-to-wait-in-a-queue-2f2m</link>
      <guid>https://dev.to/nishantmodak/nobody-likes-to-wait-in-a-queue-2f2m</guid>
      <description>&lt;p&gt;Nobody likes to wait in a queue. Almost everyone in a queue at immigration or in a road traffic has considered&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What if I move to the other queue? Thats going faster&lt;/li&gt;
&lt;li&gt;Why haven't they added more servers / units / lanes to service?&lt;/li&gt;
&lt;li&gt;This is just the bad time of the day. Should have started early.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Its a science! These things can be answered by formulas and you can study these systems formally.&lt;/p&gt;

&lt;p&gt;The mathematical field of studying queues is called Queueing Theory.&lt;/p&gt;

&lt;h2&gt;
  
  
  Queueing Theory 101
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Definitions
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fnd0me6l7c48klaejbnm8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fnd0me6l7c48klaejbnm8.png" alt="Queueing Theory Terminology"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  System Structures
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fgk6b0umtt6fq43fdr3r2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fgk6b0umtt6fq43fdr3r2.png" alt="Queueing Systems"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Concepts
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Arrivals&lt;br&gt;
How things arrive? Stream, Batch&lt;br&gt;
Is there a normal arrival distribution?&lt;br&gt;
Are the arrival times finite / infinite?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Service&lt;br&gt;
Kind of resources needed to service&lt;br&gt;
How long does it take ?&lt;br&gt;
Number of servers available&lt;br&gt;
How many can be serviced?&lt;br&gt;
Parallel / Serial?&lt;br&gt;
Single / Multiple Queues &lt;br&gt;
Preemption (Priority)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Queue Characteristics&lt;br&gt;
Balking (people/things don't join, if queue is long)&lt;br&gt;
Reneging (queue too long, leave mid way)&lt;br&gt;
Jockeying (switch queue)&lt;br&gt;
Finite / Infinite (queue lengths)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Questions we are interested in
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;How long does a customer (*request) have to wait&lt;/li&gt;
&lt;li&gt;What is the probability of customer having to wait longer&lt;/li&gt;
&lt;li&gt;Average length of queue&lt;/li&gt;
&lt;li&gt;Expected utilisation of the server at any given point&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  To Decide
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Is it worthwhile to improve on service times&lt;/li&gt;
&lt;li&gt;‘Auto Scale!’&lt;/li&gt;
&lt;li&gt;Should we introduce priorities&lt;/li&gt;
&lt;li&gt;Is waiting area adequate&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Little's Law
&lt;/h3&gt;

&lt;p&gt;L = ƛW&lt;/p&gt;

&lt;p&gt;ƛ = Arrival Rate&lt;br&gt;
W = Waiting times&lt;br&gt;
L = Total being serviced&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.google.com/presentation/d/13rJWsZzPdDBfZr-alKFQZ10UcijVOsefe2bOq8Ibcx8/edit?usp=sharing" rel="noopener noreferrer"&gt;Presentation&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://blog.last9.io" rel="noopener noreferrer"&gt;SRE Platform&lt;/a&gt;&lt;/p&gt;

</description>
      <category>sre</category>
      <category>devops</category>
      <category>productivity</category>
      <category>computerscience</category>
    </item>
  </channel>
</rss>
