Skip to content

Commit

Permalink
Merge pull request #11 from observIQ/rename-repo
Browse files Browse the repository at this point in the history
Renamed relevant files to carbon
  • Loading branch information
jmwilliams89 authored Jul 8, 2020
2 parents 85b6f56 + 5432688 commit 9f42edc
Show file tree
Hide file tree
Showing 106 changed files with 321 additions and 320 deletions.
10 changes: 5 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ jobs:
name: Setup Workspace
command: mkdir {bin,out,tmp}
- run:
name: Build Log Agent
command: go get -v -t -d ./... && go build -v -o ./bin/bplogagent ./
name: Build Carbon Agent
command: go get -v -t -d ./... && go build -v -o ./bin/carbon ./
- run:
name: Build Log Bench
command: GOPROXY=direct go get github.com/observiq/amazon-log-agent-benchmark-tool/cmd/logbench/ &&
Expand Down Expand Up @@ -173,7 +173,7 @@ jobs:
- run:
name: Setup VM Workspace
command: gcloud compute ssh << parameters.instance >> --ssh-key-file=~/.ssh/key --ssh-flag="-o LogLevel=QUIET" -- 'mkdir -p ~/benchmark/out' &&
gcloud compute scp --ssh-key-file=~/.ssh/key ./bin/bplogagent << parameters.instance >>:~/benchmark/ &&
gcloud compute scp --ssh-key-file=~/.ssh/key ./bin/carbon << parameters.instance >>:~/benchmark/ &&
gcloud compute scp --ssh-key-file=~/.ssh/key ./bin/logbench << parameters.instance >>:~/benchmark/ &&
gcloud compute scp --ssh-key-file=~/.ssh/key ./.circleci/testdata/benchmark.yaml << parameters.instance >>:~/benchmark/config.yaml &&
gcloud compute ssh << parameters.instance >> --ssh-key-file=~/.ssh/key --ssh-flag="-o LogLevel=QUIET" -- 'chmod -R 777 ~/benchmark'
Expand All @@ -187,7 +187,7 @@ jobs:
gcloud compute ssh << parameters.instance >> --ssh-key-file=~/.ssh/key --ssh-flag="-o LogLevel=QUIET" -- \
'~/benchmark/logbench -log $(echo stream{1..<< parameters.files >>}.log | tr " " ,) \
-rate << parameters.rate >> -t << parameters.duration >> -r 30s -f 2s -out ~/benchmark/out/results.json \
~/benchmark/bplogagent --database ~/benchmark/logagent.db --config ~/benchmark/config.yaml --cpu_profile ~/benchmark/out/cpu.pprof --cpu_profile_duration 30s \
~/benchmark/carbon --database ~/benchmark/logagent.db --config ~/benchmark/config.yaml --cpu_profile ~/benchmark/out/cpu.pprof --cpu_profile_duration 30s \
--mem_profile ~/benchmark/out/mem.pprof --mem_profile_delay 10s > ~/benchmark/out/notes 2>&1'
- unless:
condition: << parameters.profile >>
Expand All @@ -198,7 +198,7 @@ jobs:
gcloud compute ssh << parameters.instance >> --ssh-key-file=~/.ssh/key --ssh-flag="-o LogLevel=QUIET" -- \
'~/benchmark/logbench -log $(echo stream{1..<< parameters.files >>}.log | tr " " ,) \
-rate << parameters.rate >> -t << parameters.duration >> -r 30s -f 2s -out ~/benchmark/out/results.json \
~/benchmark/bplogagent --database ~/benchmark/logagent.db --config ~/benchmark/config.yaml > ~/benchmark/out/notes 2>&1'
~/benchmark/carbon --database ~/benchmark/logagent.db --config ~/benchmark/config.yaml > ~/benchmark/out/notes 2>&1'
- run:
name: Retrieve Results
Expand Down
1 change: 1 addition & 0 deletions .circleci/testdata/benchmark.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ pipeline:
type: google_cloud_output
project_id: bplogagent-benchmark
# credentials found automatically on gce instance
# TODO: replace project with carbon-benchmark?
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Description

If reporting a bug, please fill out the following additional information:
- Version (`bplogagent version`):
- Version (`carbon version`):
- OS version:
- Config file:
- Debug logs (use `--debug` flag):
16 changes: 8 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
# Contributing to bplogagent
# Contributing to Carbon

## Development

You can view and edit the source code by cloning this repository:

```bash
git clone https://github.com/observiq/bplogagent.git
git clone https://github.com/observiq/carbon.git
```
## Pull Requests

### How to Send Pull Requests

Everyone is welcome to contribute code to `bplogagent` via
Everyone is welcome to contribute code to `carbon` via
GitHub pull requests (PRs).

To create a new PR, fork the project in GitHub and clone the upstream
repo:

```sh
$ go get -d github.com/observiq/bplogagent
$ go get -d github.com/observiq/carbon
```

This will put the project in `${GOPATH}/src/github.com/observiq/bplogagent`. You
This will put the project in `${GOPATH}/src/github.com/observiq/carbon`. You
can alternatively use `git` directly with:

```sh
$ git clone https://github.com/observiq/bplogagent
$ git clone https://github.com/observiq/carbon
```

This would put the project in the `bplogagent` directory in
This would put the project in the `carbon` directory in
current working directory.

Enter the newly created directory and add your fork as a new remote:
Expand All @@ -49,7 +49,7 @@ $ git commit
$ git push <YOUR_FORK> <YOUR_BRANCH_NAME>
```

Open a pull request against the main `bplogagent` repo.
Open a pull request against the main `carbon` repo.

### How to Receive Comments

Expand Down
16 changes: 8 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM ubuntu:bionic

RUN mkdir -p /bplogagent_home/plugins
ENV BPLOGAGENT_HOME=/bplogagent_home
RUN echo "pipeline:\n" >> /bplogagent_home/config.yaml
RUN mkdir -p /carbon_home/plugins
ENV CARBON_HOME=/carbon_home
RUN echo "pipeline:\n" >> /carbon_home/config.yaml

COPY ./artifacts/bplogagent_linux_amd64 /bplogagent_home/bplogagent
ENTRYPOINT /bplogagent_home/bplogagent \
--config /bplogagent_home/config.yaml \
--database /bplogagent_home/bplogagent.db \
--plugin_dir /bplogagent_home/plugins
COPY ./artifacts/carbon_linux_amd64 /carbon_home/carbon
ENTRYPOINT /carbon_home/carbon \
--config /carbon_home/config.yaml \
--database /carbon_home/carbon.db \
--plugin_dir /carbon_home/plugins
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ GOARCH=$(shell go env GOARCH)

GIT_SHA=$(shell git rev-parse --short HEAD)

BUILD_INFO_IMPORT_PATH=github.com/observiq/bplogagent/internal/version
BUILD_INFO_IMPORT_PATH=github.com/observiq/carbon/internal/version
BUILD_X1=-X $(BUILD_INFO_IMPORT_PATH).GitHash=$(GIT_SHA)
ifdef VERSION
BUILD_X2=-X $(BUILD_INFO_IMPORT_PATH).Version=$(VERSION)
Expand All @@ -30,7 +30,7 @@ generate:

.PHONY: build
build:
CGO_ENABLED=0 go build -o ./artifacts/observiq_logagent_$(GOOS)_$(GOARCH) $(BUILD_INFO) .
CGO_ENABLED=0 go build -o ./artifacts/carbon_$(GOOS)_$(GOARCH) $(BUILD_INFO) .

.PHONY: install
install:
Expand Down
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
[![<observIQ>](https://circleci.com/gh/observIQ/observiq-logagent.svg?style=shield&circle-token=980a514f9dc5a48ac2b8e61a4cdb7555ea5646ca)](https://app.circleci.com/pipelines/github/observIQ/observiq-logagent)
[![codecov](https://codecov.io/gh/observIQ/observiq-logagent/branch/master/graph/badge.svg?token=i50h3UFXLg)](https://codecov.io/gh/observIQ/observiq-logagent)
[![<observIQ>](https://circleci.com/gh/observIQ/carbon.svg?style=shield&circle-token=980a514f9dc5a48ac2b8e61a4cdb7555ea5646ca)](https://app.circleci.com/pipelines/github/observIQ/carbon)
[![codecov](https://codecov.io/gh/observIQ/carbon/branch/master/graph/badge.svg?token=i50h3UFXLg)](https://codecov.io/gh/observIQ/carbon)

# observIQ Log Agent
# Carbon Log Agent

## How do I install the agent?
#### Golang Project
```shell
go get github.com/observiq/observiq-logagent
go get github.com/observiq/carbon
```
#### Linux
```shell
sh -c "$(curl -fsSl https://github.com/observiq/observiq-logagent/releases/latest/download/unix-install.sh)" unix-install.sh
sh -c "$(curl -fsSl https://github.com/observiq/carbon/releases/latest/download/unix-install.sh)" unix-install.sh
```
#### Darwin
```shell
sh -c "$(curl -fsSl https://github.com/observiq/observiq-logagent/releases/latest/download/unix-install.sh)" unix-install.sh
sh -c "$(curl -fsSl https://github.com/observiq/carbon/releases/latest/download/unix-install.sh)" unix-install.sh
```
#### Windows
```pwsh
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; Invoke-Expression ((New-Object net.webclient).DownloadString('https://github.com/observiq/observiq-logagent/releases/latest/download/windows-install.ps1')); Log-Agent-Install
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; Invoke-Expression ((New-Object net.webclient).DownloadString('https://github.com/observiq/carbon/releases/latest/download/windows-install.ps1')); Log-Agent-Install
```

## How do I run the agent?
#### Manual
```shell
# Example Command
observiq_logagent --config ./config.yaml --plugin_dir ./plugins
carbon --config ./config.yaml --plugin_dir ./plugins

# Supported flags:
--config The location of the agent config file
Expand All @@ -37,18 +37,18 @@ observiq_logagent --config ./config.yaml --plugin_dir ./plugins
#### Linux
```shell
# systemd
systemctl start observiq_logagent
systemctl start carbon_log_agent

# sysv
service observiq_logagent start
service carbon_log_agent start
```
#### Darwin
```shell
launchctl start com.observiq.observiq_logagent
launchctl start com.observiq.carbon_log_agent
```
#### Windows
```pwsh
Start-Service -Name "observiq-logagent"
Start-Service -Name "carbon_log_agent"
```

## How do I configure the agent?
Expand All @@ -73,7 +73,7 @@ pipeline:
If you have [`graphviz`](https://graphviz.org/) installed, you can view the plugin graph with a command like:
```bash
observiq_logagent graph --config './config.yaml' | dot -Tsvg -o /tmp/graph.svg && open /tmp/graph.svg
carbon graph --config './config.yaml' | dot -Tsvg -o /tmp/graph.svg && open /tmp/graph.svg
```

## What is a plugin?
Expand Down
10 changes: 5 additions & 5 deletions agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (
"path/filepath"
"time"

"github.com/observiq/bplogagent/errors"
"github.com/observiq/bplogagent/pipeline"
pg "github.com/observiq/bplogagent/plugin"
_ "github.com/observiq/bplogagent/plugin/builtin" // register plugins
"github.com/observiq/carbon/errors"
"github.com/observiq/carbon/pipeline"
pg "github.com/observiq/carbon/plugin"
_ "github.com/observiq/carbon/plugin/builtin" // register plugins
"go.etcd.io/bbolt"
"go.uber.org/zap"
)
Expand Down Expand Up @@ -103,7 +103,7 @@ func OpenDatabase(file string) (pg.Database, error) {
return bbolt.Open(file, 0666, options)
}

// NewLogAgent creates a new log agent.
// NewLogAgent creates a new carbon log agent.
func NewLogAgent(cfg *Config, logger *zap.SugaredLogger, pluginDir, databaseFile string) *LogAgent {
return &LogAgent{
Config: cfg,
Expand Down
2 changes: 1 addition & 1 deletion agent/agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"runtime"
"testing"

"github.com/observiq/bplogagent/internal/testutil"
"github.com/observiq/carbon/internal/testutil"
"github.com/stretchr/testify/require"
)

Expand Down
4 changes: 2 additions & 2 deletions agent/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import (
"io/ioutil"
"path/filepath"

"github.com/observiq/bplogagent/pipeline"
"github.com/observiq/carbon/pipeline"
yaml "gopkg.in/yaml.v2"
)

// Config is the configuration of a log agent.
// Config is the configuration of the carbon log agent.
type Config struct {
Pipeline pipeline.Config `json:"pipeline" yaml:"pipeline"`
}
Expand Down
2 changes: 1 addition & 1 deletion commands/default_paths.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"strings"
)

var agentName = "bplogagent"
var agentName = "carbon"

func defaultPluginDir() string {
if stat, err := os.Stat("./plugins"); err == nil {
Expand Down
2 changes: 1 addition & 1 deletion commands/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"testing"
"time"

"github.com/observiq/bplogagent/plugin/builtin/output"
"github.com/observiq/carbon/plugin/builtin/output"
"github.com/stretchr/testify/require"
)

Expand Down
6 changes: 3 additions & 3 deletions commands/graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package commands
import (
"os"

"github.com/observiq/bplogagent/agent"
"github.com/observiq/bplogagent/plugin"
pg "github.com/observiq/bplogagent/plugin"
"github.com/observiq/carbon/agent"
"github.com/observiq/carbon/plugin"
pg "github.com/observiq/carbon/plugin"
"github.com/spf13/cobra"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
Expand Down
6 changes: 3 additions & 3 deletions commands/offsets.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"io"
"os"

agent "github.com/observiq/bplogagent/agent"
"github.com/observiq/bplogagent/plugin/helper"
agent "github.com/observiq/carbon/agent"
"github.com/observiq/carbon/plugin/helper"
"github.com/spf13/cobra"
"go.etcd.io/bbolt"
)
Expand All @@ -19,7 +19,7 @@ func NewOffsetsCmd(rootFlags *RootFlags) *cobra.Command {
Short: "Manage input plugin offsets",
Args: cobra.NoArgs,
Run: func(command *cobra.Command, args []string) {
stdout.Write([]byte("No offsets subcommand specified. See `bplogagent offsets help` for details\n"))
stdout.Write([]byte("No offsets subcommand specified. See `carbon offsets help` for details\n"))
},
}

Expand Down
4 changes: 2 additions & 2 deletions commands/offsets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"path/filepath"
"testing"

agent "github.com/observiq/bplogagent/agent"
"github.com/observiq/bplogagent/plugin/helper"
agent "github.com/observiq/carbon/agent"
"github.com/observiq/carbon/plugin/helper"
"github.com/stretchr/testify/require"
"go.etcd.io/bbolt"
)
Expand Down
6 changes: 3 additions & 3 deletions commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"sync"
"time"

agent "github.com/observiq/bplogagent/agent"
agent "github.com/observiq/carbon/agent"
"github.com/spf13/cobra"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
Expand All @@ -36,7 +36,7 @@ func NewRootCmd() *cobra.Command {
rootFlags := &RootFlags{}

root := &cobra.Command{
Use: "bplogagent [-c ./config.yaml]",
Use: "carbon [-c ./config.yaml]",
Short: "A log parser and router",
Long: "A log parser and router",
Args: cobra.NoArgs,
Expand All @@ -47,7 +47,7 @@ func NewRootCmd() *cobra.Command {
rootFlagSet.StringVar(&rootFlags.LogFile, "log_file", "", "write logs to configured path rather than stderr")
rootFlagSet.StringSliceVarP(&rootFlags.ConfigFiles, "config", "c", []string{defaultConfig()}, "path to a config file")
rootFlagSet.StringVar(&rootFlags.PluginDir, "plugin_dir", defaultPluginDir(), "path to the plugin directory")
rootFlagSet.StringVar(&rootFlags.DatabaseFile, "database", "", "path to the log agent offset database")
rootFlagSet.StringVar(&rootFlags.DatabaseFile, "database", "", "path to the carbon offset database")
rootFlagSet.BoolVar(&rootFlags.Debug, "debug", false, "debug logging")

// Profiling flags
Expand Down
12 changes: 6 additions & 6 deletions commands/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"syscall"

"github.com/kardianos/service"
"github.com/observiq/bplogagent/agent"
"github.com/observiq/carbon/agent"
"go.uber.org/zap"
)

Expand All @@ -19,17 +19,17 @@ type AgentService struct {

// Start will start the log agent.
func (a *AgentService) Start(s service.Service) error {
a.agent.Info("Starting log agent")
a.agent.Info("Starting carbon log agent")
if err := a.agent.Start(); err != nil {
a.agent.Errorw("Failed to start log agent", zap.Any("error", err))
a.agent.Errorw("Failed to start carbon log agent", zap.Any("error", err))
a.cancel()
}
return nil
}

// Stop will stop the log agent.
func (a *AgentService) Stop(s service.Service) error {
a.agent.Info("Stopping log agent")
a.agent.Info("Stopping carbon log agent")
a.agent.Stop()
a.cancel()
return nil
Expand All @@ -39,8 +39,8 @@ func (a *AgentService) Stop(s service.Service) error {
func newAgentService(agent *agent.LogAgent, ctx context.Context, cancel context.CancelFunc) (service.Service, error) {
agentService := &AgentService{cancel, agent}
config := &service.Config{
Name: "bplogagent",
DisplayName: "bplogagent",
Name: "carbon_log_agent",
DisplayName: "carbon_log_agent",
Description: "Monitors and processes log entries",
Option: service.KeyValue{
"RunWait": func() {
Expand Down
Loading

0 comments on commit 9f42edc

Please sign in to comment.