Posts

In Short: SLI, SLO and SLA (and Error Budget)

Image
Let's take an analogy that you are a toy-maker and you deliver toys to many customers on monthly basis. Customers want some kind of agreement of deliveries so they get confidence in your service. You agree with your customers that you will deliver at least 95 toys per month. The number 95 becomes your SLO. A service level objective (SLO), which is measurable and agreed with the customer. This agreement will be called an SLA - Service Level Agreement . So, " SLA is an agreement with your customers that says the SLO will be met on a monthly/weekly/daily basis ." You know you can make 4 toys per day and capable of delivering 120 toys per month. This is something that is measurable on daily basis by metrics you collect from your production house. This metric is something that tells exactly about your deliverables. Thus this becomes your Service Level Indicator. Base on the commitment you made to your customers i.e., 95 toys per month, which is 3.1 toys per day, knowing

Effectively Use "cbt" command to get Google Cloud BigTable Data

Image
Google Cloud BigTable is a NO-SQL time series storage. Unlike SQL or my SQL, it doesn't have a standard user interface to see data (as of 2020 Nov). Instead, it provides a command-line tool.  Thus this blog will describe how to effectively query Google Cloud BigTable instance , to view and filter rows using the cbt command-line tool. This blog expects you to have a fair understanding of: Google Cloud BigTable Row keys, columns, column qualifier in BigTable Proper access rights to query BigTable Cloud BigTable Command line tool (cbt) provided by Google helps you perform various actions on your BigTable instance. The most common purpose I have been using it is for reading rows from my BigTable instance. 'cbt' command-line tool provides you the following reading options 1. Read: Read rows between the range of keys. cbt -instance <BIGTABLE_INSTANCE_ID> -project <GCP_PROJECT_ID> read <TABLE_NAME> start=<ROW_KEY_1> end=<ROW_KEY_2> 2. Read from: S

How To See Kubernetes Secret Data?

Image
Kubernetes secrets are data in key-value format stored secretly for your applications deployed in a Kubernetes system. If you have proper rights and, for debugging purposes you wish to see the secret data then this post will help you.  To see Kubernetes secret data you must have proper rights to see its pods/deployments/secrets. This post assumes you have basic knowledge of Kubernetes and understand how to get access to a Kubernetes instance and you can run commands like kubectl get pod/deployments/secrets successfully. Steps involved: 1. Get Kubernetes secret in details 2. Decode the secret data Get Kubernetes Secret in Detail You can normally get any resource list in Kubernetes by command 'kubectl get pods/deployments/secrets'. Similarly `secret` is also a resource. You get secret list by command: >> kubectl get secrets NAME                   TYPE                                 DATA           AGE default -token-kctfm    kubernetes.io/service-account-token    3       

Quickly Setup Golang pprof and debugging for Memory Leak

Image
This post gives you quick steps for debugging memory leak using pprof in Go lang microservices built with Gorilla Mux: Setting up pprof in Go lang Running and viewing the memory profile Pinpointing the code culprit line Setting up pprof in Go lang First, you have to include pprof package in your Go file. Go file is the place where you declare your routes: import ( "encoding/json" "errors" "fmt" "net/http" _ "net/http/pprof" "github.com/gorilla/mux" ) Then you need to add a path prefix 'debug'. PathPrefix registers a new route with a matcher for the URL path prefix. We do this to see the memory profiler on the browser. router := mux.NewRouter() router.PathPrefix("/debug/").Handler(http.DefaultServeMux) router.Path("/healthCheck").Methods("GET").HandlerFunc(s.HealthCheck) Do not be confused since pprof package not being used anywhe

Unit testing of typescript in visual studio (mocha + chai)

Image
  You will need following things to do unit test on typescript: Mocha : Its a testing framework, which will help us identify unit tests in Test explorer of VS Chai : Chai is the assertion library which works well with 'mocha' NodeJs tools for Visual Studio : This tool is needed to create NodeJs project in Visual studio. * I am using Visual Studio 2015 and assuming you have NodeJs environment setup on your machine To begin, open Visual Studio and add a ' Blank Node.js Web Application ' project. Then add ' TypeScript Mocha Unit Test file ' file into the project. (say UnitTest1.ts) Get ' mocha ' definitely typed file from the following location: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/mocha/mocha.d.ts and include it in your project at:   Project  |  |_Scripts  |  |__typings  |  |___mocha (folder)  |  |____ mocha.d.ts   Similarly, add ' chai ' definitely typed file from this link https://github.com/DefinitelyTyped/DefinitelyTyp