Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add datadog tracing decorator template #63

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@
# Goreleaser artifacts
/dist
/.gh_token

.idea
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ With GoWrap you can easily add metrics, tracing, fallbacks, pools, and many othe
## Installation

```
go get -u github.com/hexdigest/gowrap/cmd/gowrap
go install github.com/hexdigest/gowrap/cmd/gowrap@latest
```

## Usage of gowrap
Expand Down Expand Up @@ -69,6 +69,7 @@ List of available templates:
- [opencensus](https://github.com/hexdigest/gowrap/tree/master/templates/opencensus) instruments the source interface with opencensus spans
- [opentelemetry](https://github.com/hexdigest/gowrap/tree/master/templates/opentelemetry) instruments the source interface with opentelemetry spans
- [opentracing](https://github.com/hexdigest/gowrap/tree/master/templates/opentracing) instruments the source interface with opentracing spans
- [datadog\_tracing](https://github.com/hexdigest/gowrap/tree/master/templates/datadog_tracing) instruments the source interface with datadog spans
- [prometheus](https://github.com/hexdigest/gowrap/tree/master/templates/prometheus) instruments the source interface with prometheus metrics
- [ratelimit](https://github.com/hexdigest/gowrap/tree/master/templates/ratelimit) instruments the source interface with RPS limit and concurrent calls limit
- [retry](https://github.com/hexdigest/gowrap/tree/master/templates/retry) instruments the source interface with retries
Expand Down
3 changes: 2 additions & 1 deletion cmd_generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ import (
"unicode"

"github.com/Masterminds/sprig/v3"
"github.com/pkg/errors"

"github.com/hexdigest/gowrap/generator"
"github.com/hexdigest/gowrap/pkg"
"github.com/pkg/errors"
)

// GenerateCommand implements Command interface
Expand Down
5 changes: 3 additions & 2 deletions cmd_generate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ import (
"testing"
"time"

minimock "github.com/gojuno/minimock/v3"
"github.com/hexdigest/gowrap/generator"
"github.com/gojuno/minimock/v3"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"

"github.com/hexdigest/gowrap/generator"
)

func TestNewGenerateCommand(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions cmd_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ func (gc *TemplateCommand) list(w io.Writer) error {
return errNoTemplatesFound
}

fmt.Fprintln(w, "List of available remote templates:")
_, _ = fmt.Fprintln(w, "List of available remote templates:")
for _, t := range templates {
fmt.Fprintf(w, " %s\n", t)
_, _ = fmt.Fprintf(w, " %s\n", t)
}

return nil
Expand All @@ -96,6 +96,6 @@ func (gc *TemplateCommand) fetch(w io.Writer, wf writeFileFunc, args []string) e
return err
}

fmt.Fprintf(w, "successfully copied from %s\n", url)
_, _ = fmt.Fprintf(w, "successfully copied from %s\n", url)
return nil
}
38 changes: 28 additions & 10 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,60 +3,78 @@ module github.com/hexdigest/gowrap
require (
github.com/Masterminds/sprig/v3 v3.2.2
github.com/gojuno/minimock/v3 v3.0.10
github.com/opentracing/opentracing-go v1.1.0
github.com/opentracing/opentracing-go v1.2.0
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.12.1
github.com/sirupsen/logrus v1.8.1
github.com/stretchr/testify v1.7.1
github.com/twitchtv/twirp v5.8.0+incompatible
github.com/stretchr/testify v1.8.1
github.com/twitchtv/twirp v8.1.1+incompatible
go.elastic.co/apm/v2 v2.2.0
go.opencensus.io v0.23.0
go.opentelemetry.io/otel v1.0.1
go.opentelemetry.io/otel/trace v1.0.1
golang.org/x/tools v0.1.11-0.20220316014157-77aa08bb151a
golang.org/x/tools v0.4.0
google.golang.org/grpc v1.45.0
gopkg.in/DataDog/dd-trace-go.v1 v1.47.0
)

require (
github.com/DataDog/datadog-agent/pkg/obfuscate v0.0.0-20211129110424-6491aa3bf583 // indirect
github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.42.0-rc.1 // indirect
github.com/DataDog/datadog-go v4.8.2+incompatible // indirect
github.com/DataDog/datadog-go/v5 v5.0.2 // indirect
github.com/DataDog/go-tuf v0.3.0--fix-localmeta-fork // indirect
github.com/DataDog/sketches-go v1.2.1 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver/v3 v3.1.1 // indirect
github.com/Microsoft/go-winio v0.5.1 // indirect
github.com/armon/go-radix v1.0.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dgraph-io/ristretto v0.1.0 // indirect
github.com/dustin/go-humanize v1.0.0 // indirect
github.com/elastic/go-licenser v0.4.0 // indirect
github.com/elastic/go-sysinfo v1.7.1 // indirect
github.com/elastic/go-windows v1.0.1 // indirect
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/go-cmp v0.5.7 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/huandu/xstrings v1.3.2 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/jcchavezs/porto v0.1.0 // indirect
github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/kr/pretty v0.3.0 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/mitchellh/copystructure v1.1.2 // indirect
github.com/mitchellh/reflectwalk v1.0.1 // indirect
github.com/philhofer/fwd v1.1.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.32.1 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/rogpeppe/go-internal v1.8.1 // indirect
github.com/santhosh-tekuri/jsonschema v1.2.4 // indirect
github.com/secure-systems-lab/go-securesystemslib v0.4.0 // indirect
github.com/shopspring/decimal v1.2.0 // indirect
github.com/spf13/cast v1.4.1 // indirect
github.com/tinylib/msgp v1.1.6 // indirect
go.elastic.co/fastjson v1.1.0 // indirect
go4.org/intern v0.0.0-20211027215823-ae77deb06f29 // indirect
go4.org/unsafe/assume-no-moving-gc v0.0.0-20220617031537-928513b29760 // indirect
golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 // indirect
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 // indirect
golang.org/x/net v0.0.0-20220412020605-290c469a71a5 // indirect
golang.org/x/sys v0.0.0-20220422013727-9388b58f7150 // indirect
golang.org/x/mod v0.7.0 // indirect
golang.org/x/sys v0.3.0 // indirect
golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11 // indirect
golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f // indirect
google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac // indirect
google.golang.org/protobuf v1.28.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
howett.net/plist v1.0.0 // indirect
inet.af/netaddr v0.0.0-20220617031823-097006376321 // indirect
)

go 1.17
go 1.19
Loading