Skip to content
This repository has been archived by the owner on Aug 18, 2023. It is now read-only.

Commit

Permalink
Merge pull request #164 from signalfx/rename
Browse files Browse the repository at this point in the history
Rename metricproxy to gateway
  • Loading branch information
mdubbyap committed Dec 14, 2018
2 parents f82cad7 + f39f400 commit db4d26c
Show file tree
Hide file tree
Showing 43 changed files with 166 additions and 260 deletions.
10 changes: 4 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 2.0
jobs:
build:

working_directory: ~/signalfx/metricproxy
working_directory: ~/signalfx/gateway
parallelism: 1
shell: /bin/bash --login

Expand All @@ -26,11 +26,11 @@ jobs:
docker_layer_caching: true

- run:
working_directory: ~/signalfx/metricproxy
working_directory: ~/signalfx/gateway
command: echo 'DOCKER_OPTS="${DOCKER_OPTS} -H tcp://127.0.0.1:2375 -H unix:///var/run/docker.sock"' | sudo tee -a /etc/default/docker

- run:
working_directory: ~/signalfx/metricproxy
working_directory: ~/signalfx/gateway
command: 'sudo docker info >/dev/null 2>&1 || sudo service docker start; '

- restore_cache:
Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:

machine:
enabled: true
working_directory: ~/signalfx/metricproxy
working_directory: ~/signalfx/gateway
environment:
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
Expand All @@ -92,8 +92,6 @@ workflows:
jobs:
- build
- deploy:
requires:
- buildtest
filters:
branches:
only:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
metricproxy.pid
gateway.pid
/.arcconfig
/*.iml
/sfproxytest.json
/metricproxy
/gateway
/sf
/.go
/.idea
82 changes: 0 additions & 82 deletions CHANGELOG.md

This file was deleted.

8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ FROM scratch
MAINTAINER Matthew Pound <mwp@signalfx.com>

COPY ca-bundle.crt /etc/pki/tls/certs/ca-bundle.crt
COPY metricproxy /metricproxy
COPY gateway /gateway
COPY buildInfo.json /buildInfo.json

VOLUME /var/log/sfproxy
VOLUME /var/config/sfproxy
VOLUME /var/log/gateway
VOLUME /var/config/gateway

CMD ["/metricproxy", "-configfile", "/var/config/sfproxy/sfdbproxy.conf"]
CMD ["/gateway", "-configfile", "/var/config/gateway/gateway.conf"]
67 changes: 48 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# metricproxy [![Circle CI](https://circleci.com/gh/signalfx/metricproxy.svg?style=svg)](https://circleci.com/gh/signalfx/metricproxy)
# Gateway [![Circle CI](https://circleci.com/gh/signalfx/gateway.svg?style=svg)](https://circleci.com/gh/signalfx/gateway)

The SignalFx Metricproxy lets you aggregate metrics and send them to
The SignalFx Gateway lets you aggregate metrics and send them to
SignalFx. It is a multilingual datapoint demultiplexer that can accept
time series data from the carbon (Graphite), collectd or SignalFx protocols
and emit those datapoints to a series of servers using the carbon, collectd
Expand All @@ -12,18 +12,47 @@ is already receiving datapoints, such as Graphite's carbon database.

```
$ curl -s \
https://raw.githubusercontent.com/signalfx/metricproxy/master/install.sh\
https://raw.githubusercontent.com/signalfx/gateway/master/install.sh\
| sudo sh
# Config at /etc/sfdbconfig.conf
# Binary at /opt/sfproxy/bin/metricproxy
# Logs at /var/log/sfproxy
# PID file at /var/run/metricproxy.pid
# Config at /etc/gateway.conf
# Binary at /opt/gateway/bin/gateway
# Logs at /var/log/gateway
# PID file at /var/run/gateway.pid
```

### Migration from metricproxy

Additional steps are required if you're upgrading from a version that was from
the metricproxy repo. You'll want to do the following renaming:

```
/etc/sfdbconfig.conf -> /etc/gateway.conf
/var/log/sfproxy -> /var/log/gateway
```

You'll also want to expect that some files will also have changed names:

```
/var/log/sfprpoxy/metricproxy.log -> /var/log/gateway/gateway.log
/var/run/metricproxy.pid -> /var/run/gateway.pid
```

If you were running the metricproxy using our docker container, you'll want
to notice that the paths and filenames have also changed there, so you'll
want to update any infrastructure you have around that:

```
/var/log/sfproxy -> /var/log/gateway
/var/config/sfproxy -> /var/config/gateway
/var/config/sfproxy/sfdbproxy.conf -> /var/config/gateway/gateway.conf
```

No changes to the contents of the gateway.conf are required.

### Go Dependency

Additional Steps are required to install the metricproxy on Ubuntu machines
Additional Steps are required to install the gateway on Ubuntu machines
because the golang package in Ubuntu is not up to date. The following steps
to [update](https://github.com/golang/go/wiki/Ubuntu) the golang package on
Ubuntu must be executed before running the install script.
Expand All @@ -49,19 +78,19 @@ sudo cp /usr/lib/go-1.11.1/bin/go /usr/bin/go
## Running

```
/etc/init.d/metricproxy start
/etc/init.d/gateway start
```

## Stopping the daemon

```
/etc/init.d/metricproxy stop
/etc/init.d/gateway stop
```

## Debugging

```
cd /var/log/sfproxy
cd /var/log/gateway
tail -F *
```

Expand All @@ -77,7 +106,7 @@ server.
## Http Proxy Support

The go http code supports the use of an http proxy through the environment
variable `HTTP_PROXY="http://proxyhost:proxyport"`. With this the metricproxy
variable `HTTP_PROXY="http://proxyhost:proxyport"`. With this the gateway
will proxy all http connections through that host and port. This can be put
into the start script, or as part of the environment sent into the container
if using a container solution like maestro.
Expand Down Expand Up @@ -122,9 +151,9 @@ env variable is set correctly.
## Docker

The proxy comes with a [docker image](Dockerfile) that is built and deployed
to [quay.io](https://quay.io/repository/signalfx/metricproxy). It assumes
you will have a sfdbproxy.conf file cross mounted to
/var/config/sfproxy/sfdbproxy.conf for the docker container.
to [quay.io](https://quay.io/repository/signalfx/gateway). It assumes
you will have a gateway.conf file cross mounted to
/var/config/gateway/gateway.conf for the docker container.

## Config file format

Expand Down Expand Up @@ -196,7 +225,7 @@ to the default of TCP).

#### prometheus

You can use the metricproxy as prometheus remote storage. To do this, you will
You can use the gateway as prometheus remote storage. To do this, you will
need to specify the port to bind to. An example config:

```
Expand Down Expand Up @@ -360,7 +389,7 @@ to signalfx at 1s intervals
```
{
"StatsDelay": "1s",
"LogDir": "/var/log/sfproxy",
"LogDir": "/var/log/gateway",
"ListenFrom": [
{
"Type": "carbon",
Expand Down Expand Up @@ -719,7 +748,7 @@ simultaniously with each thread sending no more than 5,000 points in a single
call.

StatsDelay being set to 1s means every 1s we'll emit metrics out all forwarders
about the running metric proxy. These metrics are emitted with a host dimension
about the running Gateway. These metrics are emitted with a host dimension
that will be set to the value of the ServerName set in the config file or to
the hostname of the machine by default.

Expand All @@ -732,7 +761,7 @@ data that was late or in the future respectively.
```
{
"StatsDelay": "1s",
"ServerName": "metricproxy-us-east1",
"ServerName": "gateway-us-east1",
"LateThreshold": "1s",
"FutureThreshold": "1s",
"ListenFrom": [
Expand Down
32 changes: 0 additions & 32 deletions circle.yml

This file was deleted.

8 changes: 4 additions & 4 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import (

"expvar"
"github.com/quentin-m/etcd-cloud-operator/pkg/etcd"
"github.com/signalfx/gateway/logkey"
"github.com/signalfx/gateway/protocol/filtering"
"github.com/signalfx/gateway/sampling"
"github.com/signalfx/gohelpers/stringhelper"
"github.com/signalfx/golib/errors"
"github.com/signalfx/golib/log"
"github.com/signalfx/golib/pointer"
"github.com/signalfx/metricproxy/logkey"
"github.com/signalfx/metricproxy/protocol/filtering"
"github.com/signalfx/metricproxy/sampling"
"github.com/signalfx/xdgbasedir"
"os"
)
Expand Down Expand Up @@ -111,7 +111,7 @@ type ProxyConfig struct {

// DefaultProxyConfig is default values for the proxy config
var DefaultProxyConfig = &ProxyConfig{
PidFilename: pointer.String("metricproxy.pid"),
PidFilename: pointer.String("gateway.pid"),
LogDir: pointer.String(os.TempDir()),
LogMaxSize: pointer.Int(100),
LogMaxBackups: pointer.Int(10),
Expand Down
16 changes: 8 additions & 8 deletions config/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ package config

import (
"context"
"github.com/signalfx/gateway/protocol"
"github.com/signalfx/gateway/protocol/carbon"
"github.com/signalfx/gateway/protocol/carbon/metricdeconstructor"
"github.com/signalfx/gateway/protocol/collectd"
"github.com/signalfx/gateway/protocol/csv"
"github.com/signalfx/gateway/protocol/prometheus"
"github.com/signalfx/gateway/protocol/signalfx"
"github.com/signalfx/gateway/protocol/wavefront"
"github.com/signalfx/golib/datapoint/dpsink"
"github.com/signalfx/golib/errors"
"github.com/signalfx/golib/log"
"github.com/signalfx/golib/web"
"github.com/signalfx/metricproxy/protocol"
"github.com/signalfx/metricproxy/protocol/carbon"
"github.com/signalfx/metricproxy/protocol/carbon/metricdeconstructor"
"github.com/signalfx/metricproxy/protocol/collectd"
"github.com/signalfx/metricproxy/protocol/csv"
"github.com/signalfx/metricproxy/protocol/prometheus"
"github.com/signalfx/metricproxy/protocol/signalfx"
"github.com/signalfx/metricproxy/protocol/wavefront"
)

type forwarderLoader interface {
Expand Down
4 changes: 2 additions & 2 deletions config/loader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ package config

import (
"context"
"github.com/signalfx/gateway/protocol/carbon"
"github.com/signalfx/gateway/sampling"
"github.com/signalfx/golib/datapoint"
"github.com/signalfx/golib/datapoint/dpsink"
"github.com/signalfx/golib/datapoint/dptest"
"github.com/signalfx/golib/log"
"github.com/signalfx/golib/nettest"
"github.com/signalfx/golib/pointer"
"github.com/signalfx/golib/web"
"github.com/signalfx/metricproxy/protocol/carbon"
"github.com/signalfx/metricproxy/sampling"
. "github.com/smartystreets/goconvey/convey"
"os"
"testing"
Expand Down
Loading

0 comments on commit db4d26c

Please sign in to comment.