From 587e7df52530d05ebbb6fcc38b9417cd17227fa8 Mon Sep 17 00:00:00 2001 From: Sorin Buliarca Date: Thu, 20 Sep 2018 14:42:26 +0300 Subject: [PATCH] Removed Graphite integration --- Gopkg.lock | 8 +---- Gopkg.toml | 4 --- README.md | 3 -- app.go | 32 ------------------- .../templates/deployment.yaml | 7 ---- 5 files changed, 1 insertion(+), 53 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index bc3f8c2..f8dba3c 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -41,12 +41,6 @@ revision = "df2f00c734957c9dd651ce23ab0e0902504c7636" version = "v0.2.0" -[[projects]] - branch = "master" - name = "github.com/cyberdelia/go-metrics-graphite" - packages = ["."] - revision = "39f87cc3b432bbb898d7c643c0e93cac2bc865ad" - [[projects]] name = "github.com/davecgh/go-spew" packages = ["spew"] @@ -133,6 +127,6 @@ [solve-meta] analyzer-name = "dep" analyzer-version = 1 - inputs-digest = "9c84699a9013142b86173091444ef57f7c8430f6c819cf9204b97df43f9fdfff" + inputs-digest = "3278ebea59d0d9649ef17c42991ba860d646a8c9d35a7fa09a28165c93c66e90" solver-name = "gps-cdcl" solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml index 1cc2cca..e995372 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -45,10 +45,6 @@ name = "github.com/Financial-Times/transactionid-utils-go" version = "0.2.0" -[[constraint]] - branch = "master" - name = "github.com/cyberdelia/go-metrics-graphite" - [[constraint]] branch = "master" name = "github.com/stretchr/testify" diff --git a/README.md b/README.md index 8916c15..d8479f7 100644 --- a/README.md +++ b/README.md @@ -32,9 +32,6 @@ Options: --app-name Application name (env $APP_NAME) (default "Public People API") --log-level App log level (env $LOG_LEVEL) (default "info") --port Port to listen on (env $PORT) (default 8080) - --graphiteTCPAddress Graphite TCP address (default: "") - --graphitePrefix Prefix to use. Should start with content, include the environment, and the host name. e.g. content.test.public.people.api. (default: "") - --logMetrics Whether to log metrics. Set to true if running locally and you want metrics output (default: false) --cache-duration Duration Get requests should be cached for. e.g. 2h45m would set the max-age value to '7440' seconds (default:30s) --requestLoggingEnabled Whether to log requests (env $REQUEST_LOGGING_ENABLED) (default true) --publicConceptsApiURL Public concepts API endpoint URL. ($CONCEPTS_API) (default: "http://localhost:8080") diff --git a/app.go b/app.go index 75123be..e40d5bc 100644 --- a/app.go +++ b/app.go @@ -11,17 +11,14 @@ import ( "github.com/Financial-Times/public-people-api/people" - standardLog "log" "net" "os/signal" "syscall" "github.com/Financial-Times/go-fthealth/v1_1" "github.com/Financial-Times/go-logger" - "github.com/cyberdelia/go-metrics-graphite" "github.com/gorilla/mux" "github.com/jawher/mow.cli" - "github.com/rcrowley/go-metrics" ) const appDescription = "This service reads people from Neo4j" @@ -52,24 +49,6 @@ func main() { Desc: "Port to listen on", EnvVar: "APP_PORT", }) - graphiteTCPAddress := app.String(cli.StringOpt{ - Name: "graphiteTCPAddress", - Value: "", - Desc: "Graphite TCP address, e.g. graphite.ft.com:2003. Leave as default if you do NOT want to output to graphite (e.g. if running locally)", - EnvVar: "GRAPHITE_ADDRESS", - }) - graphitePrefix := app.String(cli.StringOpt{ - Name: "graphitePrefix", - Value: "", - Desc: "Prefix to use. Should start with content, include the environment, and the host name. e.g. content.test.public.content.by.concept.api.ftaps59382-law1a-eu-t", - EnvVar: "GRAPHITE_PREFIX", - }) - logMetrics := app.Bool(cli.BoolOpt{ - Name: "logMetrics", - Value: false, - Desc: "Whether to log metrics. Set to true if running locally and you want metrics output", - EnvVar: "LOG_METRICS", - }) cacheDuration := app.String(cli.StringOpt{ Name: "cache-duration", Value: "30s", @@ -95,17 +74,6 @@ func main() { app.Action = func() { logger.Infof("System code: %s, App Name: %s, Port: %s", *appSystemCode, *appName, *port) - // This will send metrics to Graphite if a non-empty graphiteTCPAddress is passed in, or to the standard log if logMetrics is true. - // Make sure a sensible graphitePrefix that will uniquely identify your service is passed in, e.g. "content.test.people.rw.neo4j.ftaps58938-law1a-eu-t - if *graphiteTCPAddress != "" { - addr, _ := net.ResolveTCPAddr("tcp", *graphiteTCPAddress) - go graphite.Graphite(metrics.DefaultRegistry, 5*time.Second, *graphitePrefix, addr) - } - if *logMetrics { //useful locally - //messy use of the 'standard' log package here as this method takes the log struct, not an interface, so can't use logrus.Logger - go metrics.Log(metrics.DefaultRegistry, 60*time.Second, standardLog.New(os.Stdout, "metrics", standardLog.Lmicroseconds)) - } - appConfig := people.HealthConfig{ AppName: *appName, AppSystemCode: *appSystemCode, diff --git a/helm/public-people-api/templates/deployment.yaml b/helm/public-people-api/templates/deployment.yaml index fc231f0..09e8685 100644 --- a/helm/public-people-api/templates/deployment.yaml +++ b/helm/public-people-api/templates/deployment.yaml @@ -37,13 +37,6 @@ spec: env: - name: CACHE_DURATION value: {{ .Values.cache_duration }} - - name: GRAPHITE_ADDRESS - valueFrom: - configMapKeyRef: - name: global-config - key: graphite.address - - name: GRAPHITE_PREFIX - value: coco.services.k8s.public-people-api - name: CONCEPTS_API value: "http://public-concepts-api:8080" ports: