Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
pkg/*
*.pyc
datadog-agent
*.lock
vendor/
bin/

.DS_Store
*.out
profile.cov
*.cov
*.lock
*.pyc
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
Datadog Agent
# Datadog Agent
The Datadog Agent faithfully collects events and metrics and brings
them to [Datadog](https://app.datadoghq.com) on your behalf so that
you can do something useful with your monitoring and performance data.

The future of dd-agent
## Getting started
Binary distributions are not provided yet, to try out the Agent you can build the `master` branch.

### Building
Just run the `build.sh` script from the repo root

### Testing
Just run the `runtests.sh` script from the repo root
11 changes: 11 additions & 0 deletions aggregator/singleton.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package aggregator

var _aggregator Aggregator

func Get() Aggregator {
return _aggregator
}

func Set(aggregatorInstance Aggregator) {
_aggregator = aggregatorInstance
}
10 changes: 10 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh -e

ORG_PATH="github.com/DataDog"
REPO_PATH="${ORG_PATH}/datadog-agent"
BIN_PATH="./bin/agent"

eval $(go env)

go build -o ${BIN_PATH}/agent ${REPO_PATH}/cmd/agent
cp -r ./pkg/py/dist/ ${BIN_PATH}/dist/
18 changes: 11 additions & 7 deletions agentmain/main.go → cmd/agent/app/main.go
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
package ddagentmain

import (
"fmt"
"time"

"github.com/DataDog/datadog-agent/aggregator"
"github.com/DataDog/datadog-agent/checks"
"github.com/DataDog/datadog-agent/checks/system"
"github.com/DataDog/datadog-agent/py"
"github.com/DataDog/datadog-agent/pkg/checks"
"github.com/DataDog/datadog-agent/pkg/checks/system"
"github.com/DataDog/datadog-agent/pkg/py"
"github.com/kardianos/osext"
"github.com/op/go-logging"
"github.com/sbinet/go-python"
)

const AGENT_VERSION = "6.0.0"
const confdPath = "py/conf.d"

var log = logging.MustGetLogger("datadog-agent")

Expand Down Expand Up @@ -44,20 +45,23 @@ func Start() {
panic(err.Error())
}
// Set the PYTHONPATH
here, _ := osext.ExecutableFolder()
distPath := fmt.Sprintf("%s/dist", here)
confdPath := fmt.Sprintf("%s/conf.d", distPath)
path := python.PySys_GetObject("path")
python.PyList_Append(path, python.PyString_FromString("py"))
python.PyList_Append(path, python.PyString_FromString(distPath))

// `python.Initialize` acquires the GIL but we don't need it, let's release it
state := python.PyEval_SaveThread()

// for now, only Python needs it, build and pass it on the fly
aggregator.InitApi(aggregator.NewUnbufferedAggregator())
py.InitApi(aggregator.NewUnbufferedAggregator())

// Get a single Runner instance, i.e. we process checks sequentially
go checks.Runner(pending)

// Get a list of Python checks we want to run
checksNames := []string{"checks.directory", "checks.go_expvar", "checks.process"}
checksNames := []string{"checks.go_expvar"}
// Search for and import all the desired Python checks
checks := py.CollectChecks(checksNames, confdPath)

Expand Down
2 changes: 1 addition & 1 deletion main.go → cmd/agent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"net/http"
_ "net/http/pprof"

"github.com/DataDog/datadog-agent/agentmain"
"github.com/DataDog/datadog-agent/cmd/agent/app"
)

func main() {
Expand Down
11 changes: 7 additions & 4 deletions glide.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
package: github.com/DataDog/datadog-agent
homepage: https://github.com/DataDog/datadog-agent
license: MIT
import:
- package: github.com/sbinet/go-python
- package: github.com/DataDog/datadog-go
subpackages:
- statsd
- package: github.com/mitchellh/reflectwalk
- package: github.com/op/go-logging
- package: github.com/sbinet/go-python
- package: github.com/shirou/gopsutil
subpackages:
- /mem
- mem
- package: gopkg.in/yaml.v2
- package: github.com/kardianos/osext
9 changes: 0 additions & 9 deletions models/check.go

This file was deleted.

6 changes: 0 additions & 6 deletions omnibus/Berksfile

This file was deleted.

47 changes: 0 additions & 47 deletions omnibus/Berksfile.lock

This file was deleted.

66 changes: 0 additions & 66 deletions omnibus/DEPENDENCY_TREE.txt

This file was deleted.

4 changes: 0 additions & 4 deletions omnibus/Gemfile

This file was deleted.

75 changes: 0 additions & 75 deletions omnibus/README.md

This file was deleted.

Loading