Skip to content

Commit bc53c7c

Browse files
authored
Changes for adding Datadog provider (#76)
Co-authored-by: lawwong <[email protected]>
1 parent 500faea commit bc53c7c

File tree

9 files changed

+1062
-118
lines changed

9 files changed

+1062
-118
lines changed

Dockerfile

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
FROM golang:1.16
1+
ARG BUILD_SPEC="build.amd64"
2+
FROM golang:1.22
3+
24
WORKDIR /go/src/github.com/paypal/load-watcher
35
COPY . .
4-
RUN make build
6+
RUN make ${BUILD_SPEC}
57

68
FROM alpine:3.12
79

Makefile

+9-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

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

1817
.PHONY: all
@@ -21,7 +20,15 @@ all: build
2120

2221
.PHONY: build
2322
build:
24-
$(COMMONENVVAR) $(BUILDENVVAR) go build -o bin/load-watcher main.go
23+
GOOS=linux $(BUILDENVVAR) GOARCH=arm64 go build -o bin/load-watcher main.go
24+
25+
.PHONY: build.amd64
26+
build.amd64:
27+
GOOS=darwin $(BUILDENVVAR) GOARCH=amd64 go build -o bin/load-watcher main.go
28+
29+
.PHONY: build.arm64
30+
build.arm64:
31+
GOOS=linux $(BUILDENVVAR) GOARCH=arm64 go build -o bin/load-watcher main.go
2532

2633
.PHONY: clean
2734
clean:

go.mod

+44-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
module github.com/paypal/load-watcher
22

3-
go 1.22.0
3+
go 1.22
44

55
require (
6+
github.com/DataDog/datadog-api-client-go/v2 v2.31.0
67
github.com/francoispqt/gojay v1.2.13
78
github.com/prometheus/client_golang v1.19.1
89
github.com/prometheus/common v0.55.0
@@ -62,3 +63,45 @@ require (
6263
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
6364
sigs.k8s.io/yaml v1.4.0 // indirect
6465
)
66+
67+
require (
68+
github.com/DataDog/zstd v1.5.2 // indirect
69+
github.com/beorn7/perks v1.0.1 // indirect
70+
github.com/cespare/xxhash/v2 v2.1.1 // indirect
71+
github.com/davecgh/go-spew v1.1.1 // indirect
72+
github.com/go-logr/logr v0.4.0 // indirect
73+
github.com/goccy/go-json v0.10.2 // indirect
74+
github.com/gogo/protobuf v1.3.2 // indirect
75+
github.com/golang/protobuf v1.5.3 // indirect
76+
github.com/google/go-cmp v0.5.9 // indirect
77+
github.com/google/gofuzz v1.1.0 // indirect
78+
github.com/google/uuid v1.5.0 // indirect
79+
github.com/googleapis/gnostic v0.5.5 // indirect
80+
github.com/imdario/mergo v0.3.5 // indirect
81+
github.com/jpillora/backoff v1.0.0 // indirect
82+
github.com/json-iterator/go v1.1.11 // indirect
83+
github.com/konsorten/go-windows-terminal-sequences v1.0.3 // indirect
84+
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
85+
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
86+
github.com/modern-go/reflect2 v1.0.1 // indirect
87+
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect
88+
github.com/pmezard/go-difflib v1.0.0 // indirect
89+
github.com/prometheus/client_model v0.2.0 // indirect
90+
github.com/prometheus/procfs v0.6.0 // indirect
91+
github.com/spf13/pflag v1.0.5 // indirect
92+
golang.org/x/net v0.17.0 // indirect
93+
golang.org/x/oauth2 v0.10.0 // indirect
94+
golang.org/x/sys v0.27.0 // indirect
95+
golang.org/x/term v0.13.0 // indirect
96+
golang.org/x/text v0.13.0 // indirect
97+
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
98+
google.golang.org/appengine v1.6.7 // indirect
99+
google.golang.org/protobuf v1.31.0 // indirect
100+
gopkg.in/inf.v0 v0.9.1 // indirect
101+
gopkg.in/yaml.v2 v2.4.0 // indirect
102+
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
103+
k8s.io/api v0.22.3 // indirect
104+
k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a // indirect
105+
sigs.k8s.io/structured-merge-diff/v4 v4.1.2 // indirect
106+
sigs.k8s.io/yaml v1.2.0 // indirect
107+
)

go.sum

+475-112
Large diffs are not rendered by default.

pkg/watcher/api/client.go

+2
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ func NewLibraryClient(opts watcher.MetricsProviderOpts) (Client, error) {
5353
client.fetcherClient, err = metricsprovider.NewPromClient(opts)
5454
case watcher.SignalFxClientName:
5555
client.fetcherClient, err = metricsprovider.NewSignalFxClient(opts)
56+
case watcher.DatadogClientName:
57+
client.fetcherClient, err = metricsprovider.NewDatadogClient(opts)
5658
default:
5759
client.fetcherClient, err = metricsprovider.NewMetricsServerClient()
5860
}

0 commit comments

Comments
 (0)