Skip to content

Commit

Permalink
Changes for adding Datadog provider (#76)
Browse files Browse the repository at this point in the history
Co-authored-by: lawwong <lawwong@paypal.com>
  • Loading branch information
lawwong1 and lawwong authored Dec 10, 2024
1 parent 500faea commit bc53c7c
Show file tree
Hide file tree
Showing 9 changed files with 1,062 additions and 118 deletions.
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
FROM golang:1.16
ARG BUILD_SPEC="build.amd64"
FROM golang:1.22

WORKDIR /go/src/github.com/paypal/load-watcher
COPY . .
RUN make build
RUN make ${BUILD_SPEC}

FROM alpine:3.12

Expand Down
11 changes: 9 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

COMMONENVVAR=GOOS=$(shell uname -s | tr A-Z a-z) GOARCH=$(subst x86_64,amd64,$(patsubst i%86,386,$(shell uname -m)))
BUILDENVVAR=CGO_ENABLED=0

.PHONY: all
Expand All @@ -21,7 +20,15 @@ all: build

.PHONY: build
build:
$(COMMONENVVAR) $(BUILDENVVAR) go build -o bin/load-watcher main.go
GOOS=linux $(BUILDENVVAR) GOARCH=arm64 go build -o bin/load-watcher main.go

.PHONY: build.amd64
build.amd64:
GOOS=darwin $(BUILDENVVAR) GOARCH=amd64 go build -o bin/load-watcher main.go

.PHONY: build.arm64
build.arm64:
GOOS=linux $(BUILDENVVAR) GOARCH=arm64 go build -o bin/load-watcher main.go

.PHONY: clean
clean:
Expand Down
45 changes: 44 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
module github.com/paypal/load-watcher

go 1.22.0
go 1.22

require (
github.com/DataDog/datadog-api-client-go/v2 v2.31.0
github.com/francoispqt/gojay v1.2.13
github.com/prometheus/client_golang v1.19.1
github.com/prometheus/common v0.55.0
Expand Down Expand Up @@ -62,3 +63,45 @@ require (
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
)

require (
github.com/DataDog/zstd v1.5.2 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/go-logr/logr v0.4.0 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/uuid v1.5.0 // indirect
github.com/googleapis/gnostic v0.5.5 // indirect
github.com/imdario/mergo v0.3.5 // indirect
github.com/jpillora/backoff v1.0.0 // indirect
github.com/json-iterator/go v1.1.11 // indirect
github.com/konsorten/go-windows-terminal-sequences v1.0.3 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/procfs v0.6.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/oauth2 v0.10.0 // indirect
golang.org/x/sys v0.27.0 // indirect
golang.org/x/term v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
k8s.io/api v0.22.3 // indirect
k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.1.2 // indirect
sigs.k8s.io/yaml v1.2.0 // indirect
)
587 changes: 475 additions & 112 deletions go.sum

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions pkg/watcher/api/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ func NewLibraryClient(opts watcher.MetricsProviderOpts) (Client, error) {
client.fetcherClient, err = metricsprovider.NewPromClient(opts)
case watcher.SignalFxClientName:
client.fetcherClient, err = metricsprovider.NewSignalFxClient(opts)
case watcher.DatadogClientName:
client.fetcherClient, err = metricsprovider.NewDatadogClient(opts)
default:
client.fetcherClient, err = metricsprovider.NewMetricsServerClient()
}
Expand Down
Loading

0 comments on commit bc53c7c

Please sign in to comment.