profile
viewpoint

knyar/nginx-lua-prometheus 907

Prometheus metric library for Nginx written in Lua

kenhub/giraffe 785

Giraffe - a graphite dashboard with a long neck

cossacklabs/acra 658

Database security suite. Database proxy with field-level encryption, search through encrypted data, SQL injections prevention, intrusion detection, honeypots. Supports client-side and proxy-side ("transparent") encryption. SQL, NoSQL.

cossacklabs/hermes-core 54

Security framework for building multi-user end-to-end encrypted data storage and sharing/processing with zero leakage risks from storage and transport infrastructure.

knyar/apache2gelf 36

Scripts to deliver apache/php log files to graylog2

knyar/kittens 35

Django app that shows a random image from Flickr

google/ts-bridge 28

Time Series Bridge: a tool to import metrics from one monitoring system to another

knyar/railsweb-rvm-init 27

Debian init script for unicorn supporting multiple RVM hosts

cloudfoundry-community/stackdriver-tools 22

Stackdriver Nozzle for Cloud Foundry Loggregator, Host Monitoring Agents BOSH Release

knyar/mongoclusterscripts 22

Various scripts for your MongoDB sharded cluster

PR opened google/ts-bridge

Reviewers
Add Prometheus Exporter for internal metrics.
+355 -27

0 comment

7 changed files

pr created time in 6 hours

push eventgoogle/ts-bridge

Artem Yakimenko

commit sha 2abed8cc768a3f003b47fd779b39abfb3a5c8df7

Fix terminal examples line characters

view details

push time in a day

PR opened google/ts-bridge

Fixup small errors in README
+210 -6

0 comment

13 changed files

pr created time in a day

push eventgoogle/ts-bridge

Artem Yakimenko

commit sha 2d69b5e12263d93c91c84976259300ee8f86f6d9

Expand k8s docs to add a workload identity example

view details

push time in a day

Pull request review commentgoogle/ts-bridge

Expand k8s docs to add a workload identity example

 This provides an extremely basic "bare-bones" GKE deployment example for K8s usi  ## Quickstart -1) Edit the configuration in `config_map.yaml`+For convenience, `ts-bridge` provides 2 example deployments:++- Using GKE workload identity, avoiding service account key management. (recommended)+- Using standard Kubernetes `Secret`, which can be adapted further for different secret storage mechanisms.++### GKE Workload Identity (recommended)++#### Setting up workload identity++1) This tutorial assumes that you have:++   - [Enabled GKE workload identity](https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity#enable_on_cluster)+   - Created a dedicated namespace for the app, in this example it will be `ts-bridge`++1) Create a service account for ts-bridge:++    ```+    gcloud iam service-accounts create ts-bridge-sa \+        --description="TSBridge service account"+    +    ```++1) Assign it the `Monitoring.Editor` role:++    ```+    λ gcloud projects add-iam-policy-binding PROJECT \                                                                                                                                                               (1)+        --member="serviceAccount:ts-bridge-sa@PROJECT.iam.gserviceaccount.com" \+        --role="roles/monitoring.editor"+    ```++1)  Allow GKE service account to impersonate this service account:

Probably worth mentioning that PROJECT and GKE_SERVICE_ACCOUNT_NAME need to be replaced

Temikus

comment created time in a day

Pull request review commentgoogle/ts-bridge

Expand k8s docs to add a workload identity example

+apiVersion: v1+kind: Namespace+metadata:+  name: ts-bridge

nit: newline

Temikus

comment created time in a day

Pull request review commentgoogle/ts-bridge

Expand k8s docs to add a workload identity example

 This provides an extremely basic "bare-bones" GKE deployment example for K8s usi  ## Quickstart -1) Edit the configuration in `config_map.yaml`+For convenience, `ts-bridge` provides 2 example deployments:++- Using GKE workload identity, avoiding service account key management. (recommended)+- Using standard Kubernetes `Secret`, which can be adapted further for different secret storage mechanisms.++### GKE Workload Identity (recommended)++#### Setting up workload identity++1) This tutorial assumes that you have:++   - [Enabled GKE workload identity](https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity#enable_on_cluster)+   - Created a dedicated namespace for the app, in this example it will be `ts-bridge`++1) Create a service account for ts-bridge:++    ```+    gcloud iam service-accounts create ts-bridge-sa \+        --description="TSBridge service account"+    +    ```++1) Assign it the `Monitoring.Editor` role:++    ```+    λ gcloud projects add-iam-policy-binding PROJECT \                                                                                                                                                               (1)

I think a few characters from your terminal came across here

Temikus

comment created time in a day

PR opened google/ts-bridge

Expand k8s docs to add a workload identity example
+209 -6

0 comment

13 changed files

pr created time in a day

fork krasnoukhov/ember-cli

The Ember.js command line utility

http://ember-cli.com/

fork in 2 days

startedknyar/nginx-lua-prometheus

started time in 2 days

startedknyar/nginx-lua-prometheus

started time in 5 days

startedknyar/nginx-lua-prometheus

started time in 5 days

created taggoogle/ts-bridge

tag0.1.1

Time Series Bridge: a tool to import metrics from one monitoring system to another

created time in 6 days

issue closedgoogle/ts-bridge

Investigate memory usage

Looks like we may have a memory leak, some investigation is required with a profiler: 6jCwjZXQGp4hgNQ

closed time in 7 days

Temikus

issue commentgoogle/ts-bridge

Investigate memory usage

Looks much better now: Screen Shot 2020-11-19 at 10 12 39 am

Temikus

comment created time in 7 days

fork ady1981/nginx-lua-prometheus

Prometheus metric library for Nginx written in Lua

fork in 7 days

push eventgoogle/ts-bridge

Artem Yakimenko

commit sha 31dfe2159e0538ec1c6411e878c64958beb5d32d

Add Google Cloud Profiler

view details

Artem Yakimenko

commit sha caa5765b1488a04b84c6a697d35461d57c3c17f2

Perform config/SD/Stats client initialisation only once during sync Stops the app from leaking goroutines due to instantiating clients over and over Bump version

view details

push time in 7 days

PR merged google/ts-bridge

Fixing the goroutine leak

Plus improved memory usage by instantiating configs, etc. only once.

Additionally:

  • Bump to 0.1.1
  • Add Google Cloud Profiler support

Fixing #52

+60 -37

0 comment

5 changed files

Temikus

pr closed time in 7 days

Pull request review commentgoogle/ts-bridge

Fixing the goroutine leak

 func Sync(ctx context.Context, config *tsbridge.Config) error { 		return err 	} -	sd, err := stackdriver.NewAdapter(ctx, config.Options.SDLookBackInterval)-	if err != nil {-		return err-	}-	defer sd.Close()+	sdClientOnce.Do(func() {+		sdClient, err = stackdriver.NewAdapter(ctx, config.Options.SDLookBackInterval)+		if err != nil {+			errSync = append(errSync, fmt.Errorf("Unable to initialize stackdriver adapter: %v", err))

Fixed!

Temikus

comment created time in 7 days

Pull request review commentgoogle/ts-bridge

Fixing the goroutine leak

 import ( 	"context" 	"errors" 	"fmt"+	"strings"+	"sync"+ 	"github.com/google/ts-bridge/boltdb" 	"github.com/google/ts-bridge/datastore" 	"github.com/google/ts-bridge/env" 	"github.com/google/ts-bridge/stackdriver" 	"github.com/google/ts-bridge/storage" 	"github.com/google/ts-bridge/tsbridge"-	"strings"+)++var (+	sdClient     *stackdriver.Adapter+	sdClientOnce sync.Once++	statsCollector     *tsbridge.StatsCollector+	statsCollectorOnce sync.Once++	errSync []error

Agreed. Moved.

Temikus

comment created time in 7 days

Pull request review commentgoogle/ts-bridge

Fixing the goroutine leak

 func Sync(ctx context.Context, config *tsbridge.Config) error { 		return err 	} -	sd, err := stackdriver.NewAdapter(ctx, config.Options.SDLookBackInterval)-	if err != nil {-		return err-	}-	defer sd.Close()+	sdClientOnce.Do(func() {+		sdClient, err = stackdriver.NewAdapter(ctx, config.Options.SDLookBackInterval)+		if err != nil {+			errSync = append(errSync, fmt.Errorf("Unable to initialize stackdriver adapter: %v", err))

readability nit: error strings should not be capitalized. same for other error strings in this func.

https://github.com/golang/go/wiki/CodeReviewComments#error-strings

Temikus

comment created time in 7 days

Pull request review commentgoogle/ts-bridge

Fixing the goroutine leak

 import ( 	"context" 	"errors" 	"fmt"+	"strings"+	"sync"+ 	"github.com/google/ts-bridge/boltdb" 	"github.com/google/ts-bridge/datastore" 	"github.com/google/ts-bridge/env" 	"github.com/google/ts-bridge/stackdriver" 	"github.com/google/ts-bridge/storage" 	"github.com/google/ts-bridge/tsbridge"-	"strings"+)++var (+	sdClient     *stackdriver.Adapter+	sdClientOnce sync.Once++	statsCollector     *tsbridge.StatsCollector+	statsCollectorOnce sync.Once++	errSync []error

nit: errors should be localized to the func that's returning it.

I'd suggest creating this var right before you call sdClientOnce.Do(func() instead of a global var.

Temikus

comment created time in 7 days

Pull request review commentgoogle/ts-bridge

Fixing the goroutine leak

 func Sync(ctx context.Context, config *tsbridge.Config) error { 	} 	defer store.Close() -	metrics, err := tsbridge.NewMetricConfig(ctx, config, store)-	if err != nil {-		return err-	}+	metricConfigOnce.Do(func() {+		metricConfig, err = tsbridge.NewMetricConfig(ctx, config, store)+		if err != nil {+			log.Fatalf("Unable to initialize metric config: %v", err)

That's a good point. Fixed. Can you PTAL?

Temikus

comment created time in 7 days

Pull request review commentgoogle/ts-bridge

Fixing the goroutine leak

 func Sync(ctx context.Context, config *tsbridge.Config) error { 	} 	defer store.Close() -	metrics, err := tsbridge.NewMetricConfig(ctx, config, store)-	if err != nil {-		return err-	}+	metricConfigOnce.Do(func() {+		metricConfig, err = tsbridge.NewMetricConfig(ctx, config, store)+		if err != nil {+			log.Fatalf("Unable to initialize metric config: %v", err)

hmm, I'm not sure log.Fatal is the right call here, as it'll call os.Exit right after, and does not allow for clean closure of open handlers.

Might be cleaner to return an error instead, which allows for handlers such as store.Close() etc to be executed.

Same for the other log.Fatal's below.

Temikus

comment created time in 7 days

Pull request review commentgoogle/ts-bridge

Fixing the goroutine leak

 import ( 	"github.com/google/ts-bridge/stackdriver" 	"github.com/google/ts-bridge/storage" 	"github.com/google/ts-bridge/tsbridge"+	"log" 	"strings"+	"sync"+)++var (

readability:

convention is to have a single var declaration, instead of multiple groups.

var (
	sdClient     *stackdriver.Adapter
	sdClientOnce sync.Once

	metricConfig     *tsbridge.MetricConfig
	metricConfigOnce sync.Once

	statsCollector     *tsbridge.StatsCollector
	statsCollectorOnce sync.Once
)
Temikus

comment created time in 7 days

PR opened google/ts-bridge

Fixing the goroutine leak \
+71 -46

0 comment

5 changed files

pr created time in 7 days

Pull request review commentknyar/nginx-lua-prometheus

Feature/allow utf8 lable value

 local function full_metric_name(name, label_names, label_values)   end   local label_parts = {}   for idx, key in ipairs(label_names) do-    local label_value = (string.format("%s", label_values[idx])-      :gsub("[^\032-\126]", "")  -- strip non-printable characters-      :gsub("\\", "\\\\")-      :gsub('"', '\\"'))+    local label_value = ""+    if type(label_values[idx]) == "string" then+      local valid, pos = validate_utf8_string(label_values[idx])+      label_value = (valid and label_values[idx] or string.sub(label_values[idx], 1, pos - 1))

Thanks, I just made things more complicated.

Gerrard-YNWA

comment created time in 7 days

Pull request review commentknyar/nginx-lua-prometheus

Feature/allow utf8 lable value

 local function full_metric_name(name, label_names, label_values)   end   local label_parts = {}   for idx, key in ipairs(label_names) do-    local label_value = (string.format("%s", label_values[idx])-      :gsub("[^\032-\126]", "")  -- strip non-printable characters-      :gsub("\\", "\\\\")-      :gsub('"', '\\"'))+    local label_value = ""+    if type(label_values[idx]) == "string" and validate_utf8_string(label_values[idx]) then

Yep, luajit is the common scene

Gerrard-YNWA

comment created time in 7 days

more