Cloud-oriented Life

Cloud Native Technology Improves Lives

Redis client for Golang

go-redis is a Type-safe Redis client for Golang.

Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache, and message broker. Redis provides data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs, geospatial indexes, and streams. Redis has built-in replication, Lua scripting, LRU eviction, transactions, and different levels of on-disk persistence, and provides high availability via Redis Sentinel and automatic partitioning with Redis Cluster.

Read more »

error

In error handling in the Go language, errors are an important part of the software package API and application user interface. Errors are returned as a normal return value.

In this article, we are going to explore error handling before Go 1.13.

Read more »

panic(v interface{}) and recover() interface{}

In the Go language, an error is considered an expected result, but an exception is an unexpected result. An exception may indicate that there is a Bug in the program or other uncontrollable problems have occurred.

If an error is encountered during internal recursive code, an exception will be thrown to quickly jump out of the deeply nested function call, and then the outermost interface will capture panic through recover, and then return the corresponding error message.

Read more »

rack-mini-profiler

rack-mini-profiler gem is a middleware that displays speed badge for every html page. Designed to work both in production and in development.

Features

  • Database profiling - Currently supports Mysql2, Postgres, Oracle (oracle_enhanced ~> 1.5.0) and Mongoid3 (with fallback support to ActiveRecord)

  • Call-stack profiling - Flame graphs showing time spent by gem

  • Memory profiling - Per-request memory usage, GC stats, and global allocation metrics

Read more »

col-nightscount-docker

Nightscout (also known as “CGM in the Cloud”) is an open-source cloud application used by people with diabetes and parents of kids with diabetes to visualize, store and share the data from their Continuous Glucose Monitoring sensors in real-time. Once setup, Nightscout acts as a central repository of blood glucose and insulin dosing/treatment data for a single person, allowing you to view the CGM graph and treatment data anywhere using just a web browser connected to the internet.

Read more »

Webhooks

Rocket.Chat keep the workflow going by centralizing all your tools and touchpoints in one platform. Made for teamcollaboration, DevOps and customer engagement.

Rocket.Chat supports WebHooks to integrate tools and services you like into the platform. WebHooks are simple event-notifications via HTTP POST. This way any application implementing a WebHook is able to POST a message to a Rocket.Chat instance and much more.

Read more »

Sentry

Sentry is a service that helps you monitor and fix crashes in realtime. The server is in Python, but it contains a full API for sending events from any language, in any application.

This article is about how to use Helm to install Sentry 9.x on Kubernetes (K8S).

Read more »

PostHog

PostHog provides open-source product analytics, built for developers. Automate the collection of every event on your website or app, with no need to send data to 3rd parties. With just 1 click you can deploy on your own infrastructure, having full API/SQL access to the underlying data.

This article is about how to use Helm to install PostHog on Kubernetes (K8S).

Read more »

elastic-apm

elastic-apm gem is the official Elastic APM agent for Ruby and Ruby on Rails.

The APM Server receives data from APM agents and transforms them into Elasticsearch documents. It does this by exposing an HTTP server endpoint to which agents stream the APM data they collect. After the APM Server has validated and processed events from the APM agents, the server transforms the data into Elasticsearch documents and stores them in corresponding Elasticsearch indices.

The APM Server works in conjunction with APM agents, Elasticsearch, and Kibana. Please view the APM Overview for details on how these components work together.

Prerequisites

Make sure Elastic APM Server Application Performance Monitoring (APM) with Elasticsearch | Elastic - https://www.elastic.co/apm is running before you start implementing the APM agents.

Installation

You can install it as a gem:

1
$ gem install elastic-apm

or add it into a Gemfile (Bundler):

1
2
3
4
5
6
7
# Gemfile

# Getting started with Rails | APM Ruby Agent Reference [3.x] | Elastic
# https://www.elastic.co/guide/en/apm/agent/ruby/current/getting-started-rails.html
# elastic/apm-agent-ruby: Elastic APM agent for Ruby
# https://github.com/elastic/apm-agent-ruby
gem 'elastic-apm'

Then, run bundle install.

1
$ bundle install

Config

1
2
3
4
5
6
7
8
9
10
11
12
13
# config/elastic_apm.yml:

enabled: true # false

# Set service name - allowed characters: a-z, A-Z, 0-9, -, _ and space
# Defaults to the name of your Rails app
service_name: 'col-rails-elastic-apm-example'

# Use if APM Server requires a token
# secret_token: <%= ENV['VERY_SECRET_TOKEN'] %>

# Set custom APM Server URL (default: http://localhost:8200)
server_url: 'http://localhost:8200'

See the documentation Configuration | APM Ruby Agent Reference [3.x] | Elastic - https://www.elastic.co/guide/en/apm/agent/ruby/current/configuration.html for configuration options and advanced usage.

Run

APM is automatically started when your app boots. Configure the agent, by creating the config file config/elastic_apm.yml.

Then, you can visit your Elastic Kibana Web UI to see Transactions, Errors and Metrics.

References

[1] Configuration | APM Ruby Agent Reference [3.x] | Elastic - https://www.elastic.co/guide/en/apm/agent/ruby/current/configuration.html

[2] elastic/apm-agent-ruby: Elastic APM agent for Ruby - https://github.com/elastic/apm-agent-ruby

[3] Application Performance Monitoring (APM) with Elasticsearch | Elastic - https://www.elastic.co/apm

0%