Index ¦ Archives ¦ Atom

Brief overview of using consul tags

consul allows a service to associate itself with tags. These are arbitrary metadata that can be associated with the service and can be used for different purposes. Below I outline a few examples of making use of tags and discuss some related topics.

Use case #1: Dedicated service instances based …


Add an additional host entry to docker container

Problem

Let's say a program in a container should be able to resolve a custom hostname.

Solution

When using docker run:

$ sudo docker run --add-host myhost.name:127.0.0.1 -ti python bash
Unable to find image 'python:latest' locally
latest: Pulling from library/python
Digest: sha256:eb20fd0c13d2c57fb602572f27f05f7f1e87f606045175c108a7da1af967313e
Status …

User-defined networks in Docker for inter-container communication

Problem

Let's say a program in a container wants to communicate with a service running in another docker container on the same host. The current recommended approach to do so is using a user-defined network and avoid using links.

Solution

Docker user defined network

Create an user-defined network and run both (or as many …


Getting started with gRPC and Python

My article on getting started with gRPC in Python is up on the codeship blog:

The demos can be found in the python-grpc-demo repository.


Monitoring Python applications with Prometheus

I recently wrote two articles on Python application monitoring with Prometheus:

The demos can be found in the python-prometheus-demo repository.

Also checkout aiohttp-prometheus.


Dissecting golang's HandlerFunc, Handle and DefaultServeMux

My aim in this post is to discuss three "concepts" in Golang that I come across while writing HTTP servers. Through this post, my aim to get rid of my own lack of understanding (at least to a certain degree) about these. Hopefully, it will be of use to others …


Doing Math with Python Humble Bundle

Humble bundle


Introducing distributed tracing in your Python application via Zipkin

Distributed tracing is the idea of tracing a network request as it travels through your services, as it would be in a microservices based architecture. The primary reason you may want to do is to troubleshoot or monitor the latency of a request as it travels through the different services …


Notes on using Golang to write gitbackup

gitbackup is a tool to backup your git repositories from GitHub and GitLab. I wrote the initial version as a project for a golang article which is in review for publication in a Linux magazine. It supports GitHub enterprise installations and custom GitLab installations in addition to repositories on github …


QueueLogger and Python JSON Logger

Using QueueLogger with Python JSON Logger

When logging from multiple processes (via multiprocessing module), using QueueHandler is one approach with Python 2.

QueueHandler however sets exc_info attribute of a LogRecord to None since it is not "pickleable" (more on this later). This becomes a problem when you use python-json-logger to …

© Amit Saha. Built using Pelican. Theme by Giulio Fidente on github.