Skip to content

Commit

Permalink
Add client wrapper for MongoDB Atlas support (#5386)
Browse files Browse the repository at this point in the history
* client wrapper for MongoDB Atlas support

Adds pagination, error handling, will be extended to manage metric
transformation.

* address review comments

MongoDB Atlas wrapper returns errors rather than logging
change resource attributes to use conventions
modify error handling

* fix capitalization on error messages

* go mod tidy

* poll should return an error, not log

* changes to work with scraperhelper
  • Loading branch information
zenmoto authored Oct 25, 2021
1 parent 03e55a5 commit 4e2bc90
Show file tree
Hide file tree
Showing 6 changed files with 569 additions and 25 deletions.
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ require (
github.com/prometheus/prometheus v1.8.2-0.20210621150501-ff58416a0b02
github.com/stretchr/testify v1.7.0
go.opentelemetry.io/collector v0.37.1-0.20211015233822-bd87fb628058
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6
golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac
)

require github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mongodbatlasreceiver v0.37.1
Expand Down Expand Up @@ -355,16 +355,16 @@ require (
go.uber.org/zap v1.19.1 // indirect
golang.org/x/crypto v0.0.0-20210920023735-84f357641f63 // indirect
golang.org/x/net v0.0.0-20210927181540-4e4d966f7476 // indirect
golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f // indirect
golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1 // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
gonum.org/v1/gonum v0.9.3 // indirect
google.golang.org/api v0.58.0 // indirect
google.golang.org/api v0.59.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20210927142257-433400c27d05 // indirect
google.golang.org/genproto v0.0.0-20211008145708-270636b82663 // indirect
google.golang.org/grpc v1.41.0 // indirect
google.golang.org/protobuf v1.27.1 // indirect
gopkg.in/DataDog/dd-trace-go.v1 v1.33.0 // indirect
Expand Down
15 changes: 10 additions & 5 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 9 additions & 3 deletions receiver/mongodbatlasreceiver/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,28 @@ go 1.17

require (
github.com/mongodb-forks/digest v1.0.3
github.com/pkg/errors v0.9.1
go.mongodb.org/atlas v0.13.0
go.opentelemetry.io/collector v0.37.1-0.20211015233822-bd87fb628058
go.opentelemetry.io/collector/model v0.37.1-0.20211015233822-bd87fb628058
go.uber.org/zap v1.19.1
google.golang.org/api v0.59.0
)

require (
cloud.google.com/go v0.97.0 // indirect
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/googleapis/gax-go/v2 v2.1.1 // indirect
github.com/knadh/koanf v1.2.4 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/mapstructure v1.4.2 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/openlyinc/pointy v1.1.2 // indirect
github.com/pelletier/go-toml v1.9.3 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/rogpeppe/go-internal v1.6.1 // indirect
github.com/spf13/cast v1.4.1 // indirect
go.opencensus.io v0.23.0 // indirect
Expand All @@ -31,9 +35,11 @@ require (
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.7.0 // indirect
golang.org/x/net v0.0.0-20210614182718-04defd469f4e // indirect
golang.org/x/sys v0.0.0-20210902050250-f475640dd07b // indirect
golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1 // indirect
golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac // indirect
golang.org/x/text v0.3.6 // indirect
google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20211008145708-270636b82663 // indirect
google.golang.org/grpc v1.41.0 // indirect
google.golang.org/protobuf v1.27.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
Expand Down
Loading

0 comments on commit 4e2bc90

Please sign in to comment.