An In-Depth Guide to Nginx Metrics

In our guides Zen and the Art of System Monitoring and How to Monitor Nginx: The Essential Guide, we cover our monitoring philosophy. We also recommend a specific set of metrics to monitor and alerts to set for maximum Nginx happiness.

Here, we’d like to dive into the nitty-gritty of those essential Nginx metrics. We’ll discuss what exactly they mean and why they’re important. This will also serve as a primer for some of the (perhaps esoteric) terminology associated with web servers.

You can think of this as a companion the official Nginx documentation and as an appendix to our Nginx monitoring guide.

For now, this guide covers only the metrics available via ngx_http_stub_status_module, plus those associated with the F/OSS version of Nginx. More comprehensive metrics are available atngx_http_status_module. (This is included with the commercial version, Nginx Plus.)

So roll up your sleeves, grab your Slanket or Snuggie, and let’s talk Nginx metrics.

Read More

Getting Started Quickly With Angular Logging

The previous articles in this series covered the basics of logging in C#, Java, Python, Ruby, Node.js, and JavaScript. In this article, I’ll show you how to quickly get started logging in one of the most popular front-end development frameworks: Angular.

“But wait!” you might be thinking. “Do you mean Angular or AngularJS?” I mean both. After a bit of Angular history, we’ll look at logging with AngularJS first, and then we’ll use the current Angular version to show you logging in action.

Read More

Azure Functions Tutorial: Creating Your First Function

Azure Functions is the function-as-a-service (FaaS) offering from Azure—the equivalent of AWS Lambda from Amazon. FaaS is simply a platform to upload the application code, run, and manage the application without having to think about setting up any servers. You only pay for the time the application runs, and there’s also a free tier every month. Initially, a cup of coffee could be more expensive than running your function.

Today’s post is a tutorial on how to get started using Azure Functions. By the end of this post, you’ll be able to develop and run the app locally, then publish it to Azure to start using it. It’s going to be a straightforward app, but after you’ve finished the tutorial, you’ll be ready to create more complex applications.

Read More

Zen and the Art of System Monitoring

System monitoring is an essential but often-overlooked part of production software deployment. It’s as critical as security but rarely given the same attention.

By overlooked, we don’t necessarily mean ignored. Novice operations folks know that monitoring is needed, and most environments do have some basic alarms in place. Even if it’s just the sales department screaming “The website’s down!”—which can be effective, but perhaps not optimal.

There isn’t (yet) a standard methodology for monitoring, and there really ought to be.

So let’s change that.

Read More

Kubernetes Tutorial: Learn the Basics and Get Started

It’s been over three years since Google open-sourced the Kubernetes project. Even so, you might still be wondering what Kubernetes is and how you can get started using it. Well, you’re in the right place! In this post, I’m going to explain the basics you need to know to get started with Kubernetes. And I won’t just be throwing concepts at you—I’ll give you real code examples that will help you get a better idea of why you might need to use Kubernetes if you’re thinking about using containers.

Read More

Getting Started Quickly With Django Logging

Django is one of the most popular Python web application frameworks, used by numerous organizations. Since it employs the built-in Python logging facility, logging in Django is a snap.

Still, there are a few specific Django configuration options to keep in mind. In this article, we’ll

  • create a Python virtual environment,
  • set up a small Django project to work with,
  • write a basic logging example,
  • configure the Django logger, and
  • explore the Django logging extensions.

If you want to skip writing code, you can find all of the code in this article over on GitHub.

Also, note that this article won’t go into details on the specifics of Python logging. If you want a primer on those, check out this previous post, Get Started Quickly With Python Logging, which covers the basics.

Now ready, set, log!

Read More

A Guide to Container Lifecycle Management

Containers have changed the way we develop and maintain applications. One of the main promises of containers is that you’ll be able to ship software faster. But sometimes how this happens seems a bit obscure. If you want to understand the benefits of containers, you first need to know what the lifecycle management is. Once you understand that, it’s going to be easier to connect all the points; then the aha moment will come naturally.

In this guide, I’ll use the Docker container engine—that way it’s easier to understand the lifecycle management behind it. Commands might be different in other container engines, but the concept is still valid. I’ll start with the application development, and I’ll finish with how to ship application changes. A container’s lifecycle only takes minutes to complete and is a reusable process.

Read More

Get Started Quickly With Scala Logging

We’ve covered how to log in eight different languages so far: C#, Java, Python, Ruby, Go, JavaScript, PHP, and Swift We’ve also included a few libraries and platforms, like Log4J, Node.js, Spring Boot, and Rails. Now, it’s time to show how you can get started quickly with Scala logging.

First, I’ll show you with a quick example of manual logging with Scala. I’ll use IntelliJ IDEA to create and run a Scala project, using sbt to build the code. So, you can use the application to get started on any platform that supports Scala and Java.

Then, I’ll discuss details of how and why logging matters. Finally, I’ll move on to using the Scala Logging wrapper in an application and how it can improve your ability to monitor your applications and issues.

Let’s get started!

Scala logging logo with Scalyr colors
Read More

Getting Started Quickly With Swift Logging

We’ve covered how to log in seven different languages so far: C#, Java, Python, Ruby, Go, JavaScript, and PHP. We’ve also included a few libraries and platforms, like Log4J, Node.js, Spring Boot, and Rails.

Now, it’s time to talk about Apple’s Swift language. Swift has been slowly gaining in popularity, especially with since its open source release.

I’ll start with a quick example of manual logging in Swift. Then I’ll discuss details of how and why logging matters. Finally, I’ll move on to using Apple’s Unified Logger in a Swift application and how it can improve your ability to monitor applications and track down issues

The code example will be for MacOS, but you can easily adapt it for any Apple platform.

Let’s get to work!

Read More

How to Merge Log Files

You have log files from two or more applications, and you need to see them together. Viewing the data together in proper sequence will make it easier to correlate events, and listing them side-by-side in windows or tabs isn’t cutting it.

You need to merge log files by timestamps.

But just merging them by timestamp isn’t the only thing you need. Many log files have entries with more than one line, and not all of those lines have timestamps on them.

Read More