Skip to content

Commit

Permalink
Merge pull request #32 from Financial-Times/deploy-on-push/k8s/remove…
Browse files Browse the repository at this point in the history
…-graphite-integration

Removed Graphite integration
  • Loading branch information
sbuliarca committed Sep 20, 2018
2 parents 6922393 + 587e7df commit d22dace
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 53 deletions.
8 changes: 1 addition & 7 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
32 changes: 0 additions & 32 deletions app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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",
Expand All @@ -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,
Expand Down
7 changes: 0 additions & 7 deletions helm/public-people-api/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit d22dace

Please sign in to comment.