Skip to content

Commit

Permalink
chore(easy_note): collector as receiver (#56)
Browse files Browse the repository at this point in the history
* chore(easy_note): collector as receiver

Signed-off-by: rogerogers <rogers@rogerogers.com>

* fix: some err

Signed-off-by: rogerogers <rogers@rogerogers.com>

* fix: pass context

Signed-off-by: rogerogers <rogers@rogerogers.com>

---------

Signed-off-by: rogerogers <rogers@rogerogers.com>
  • Loading branch information
rogerogers authored Jan 27, 2024
1 parent a0d0dad commit b0b8482
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 31 deletions.
2 changes: 1 addition & 1 deletion easy_note/api_request/api_service/hertz_client.go

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

10 changes: 5 additions & 5 deletions easy_note/cmd/api/hertz_handler/demoapi/api_service.go

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

10 changes: 10 additions & 0 deletions easy_note/cmd/api/main.go

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

9 changes: 0 additions & 9 deletions easy_note/cmd/api/rpc/note.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"github.com/cloudwego/biz-demo/easy_note/pkg/mw"
"github.com/cloudwego/kitex/client"
"github.com/cloudwego/kitex/pkg/rpcinfo"
"github.com/kitex-contrib/obs-opentelemetry/provider"
"github.com/kitex-contrib/obs-opentelemetry/tracing"
etcd "github.com/kitex-contrib/registry-etcd"
)
Expand All @@ -37,14 +36,6 @@ func initNote() {
if err != nil {
panic(err)
}
p := provider.NewOpenTelemetryProvider(
provider.WithServiceName(consts.ApiServiceName),
provider.WithExportEndpoint(consts.ExportEndpoint),
provider.WithInsecure(),
)
defer func(ctx context.Context, p provider.OtelProvider) {
_ = p.Shutdown(ctx)
}(context.Background(), p)
c, err := noteservice.NewClient(
consts.NoteServiceName,
client.WithResolver(r),
Expand Down
9 changes: 0 additions & 9 deletions easy_note/cmd/api/rpc/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"github.com/cloudwego/biz-demo/easy_note/pkg/mw"
"github.com/cloudwego/kitex/client"
"github.com/cloudwego/kitex/pkg/rpcinfo"
"github.com/kitex-contrib/obs-opentelemetry/provider"
"github.com/kitex-contrib/obs-opentelemetry/tracing"
etcd "github.com/kitex-contrib/registry-etcd"
)
Expand All @@ -37,14 +36,6 @@ func initUser() {
if err != nil {
panic(err)
}
p := provider.NewOpenTelemetryProvider(
provider.WithServiceName(consts.ApiServiceName),
provider.WithExportEndpoint(consts.ExportEndpoint),
provider.WithInsecure(),
)
defer func(ctx context.Context, p provider.OtelProvider) {
_ = p.Shutdown(ctx)
}(context.Background(), p)
c, err := userservice.NewClient(
consts.UserServiceName,
client.WithResolver(r),
Expand Down
3 changes: 2 additions & 1 deletion easy_note/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ services:
- "8888" # Prometheus metrics exposed by the collector
- "8889:8889" # Prometheus exporter metrics
- "13133:13133" # health_check extension
- "4317:4317" # OTLP gRPC receiver
- "55679" # zpages extension
depends_on:
- jaeger-all-in-one
Expand All @@ -48,7 +49,7 @@ services:
- "14268"
- "14250:14250"
- "6831:6831"
- "4317:4317" # OTLP gRPC receiver
- "4317" # OTLP gRPC receiver

# Victoriametrics
victoriametrics:
Expand Down
1 change: 0 additions & 1 deletion easy_note/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ require (
github.com/nyaruka/phonenumbers v1.1.6 // indirect
github.com/oleiade/lane v1.0.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/savsgio/gotils v0.0.0-20220530130905-52f3993e8d6d // indirect
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/stretchr/testify v1.8.4 // indirect
github.com/tidwall/gjson v1.14.4 // indirect
Expand Down
5 changes: 0 additions & 5 deletions easy_note/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,6 @@ github.com/hertz-contrib/obs-opentelemetry/logging/logrus v0.1.1 h1:4KR/JoIc8PSb
github.com/hertz-contrib/obs-opentelemetry/logging/logrus v0.1.1/go.mod h1:dLQsSFKUVF4pya7kLlF6l1T69+mOPObotXGJO8ptbho=
github.com/hertz-contrib/obs-opentelemetry/tracing v0.2.0 h1:EmcIT5yqkXoytKJikihwFbIYFZJ0g66s8xZEDi1XNYE=
github.com/hertz-contrib/obs-opentelemetry/tracing v0.2.0/go.mod h1:vTSOuQfZdcPbe7RMZ1n6eQrevVqmPiWD/bW9kcXt5ME=
github.com/hertz-contrib/pprof v0.1.0 h1:yES6PQ5AJZRKiUQem1cpXU2gskO4cHdPMiXu9qSGS7E=
github.com/hertz-contrib/pprof v0.1.0/go.mod h1:4vgREcobBOExepQdEt/EMD/Nc1u01rpXXaQa2TNjA4A=
github.com/hertz-contrib/pprof v0.1.1 h1:x7kOFUtqkveXbDbiISIFE3x02cAtcb6/DBjHgsJmYcM=
github.com/hertz-contrib/pprof v0.1.1/go.mod h1:9g23VQrcC4AjW++VA2relquyMXPVfs/s+t5FBIjIIOs=
github.com/hertz-contrib/requestid v1.1.0 h1:+y1cuNlNX2KUoEC1SnBJ6M55/TlMTx3M9yxkqi0oTkk=
Expand Down Expand Up @@ -520,8 +518,6 @@ github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD
github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w=
github.com/ruudk/golang-pdf417 v0.0.0-20201230142125-a7e3863a1245/go.mod h1:pQAZKsJ8yyVxGRWYNEm9oFB8ieLgKFnamEyDmSA0BRk=
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/savsgio/gotils v0.0.0-20220530130905-52f3993e8d6d h1:Q+gqLBOPkFGHyCJxXMRqtUgUbTjI8/Ze8vu8GGyNFwo=
github.com/savsgio/gotils v0.0.0-20220530130905-52f3993e8d6d/go.mod h1:Gy+0tqhJvgGlqnTF8CVGP0AaGRjwBtXs/a5PA0Y3+A4=
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
Expand Down Expand Up @@ -589,7 +585,6 @@ github.com/uber/jaeger-lib v2.4.1+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6
github.com/v2pro/plz v0.0.0-20221028024117-e5f9aec5b631/go.mod h1:3gacX+hQo+xvl0vtLqCMufzxuNCwt4geAVOMt2LQYfE=
github.com/v2pro/quokka v0.0.0-20171201153428-382cb39c6ee6/go.mod h1:0VP5W9AFNVWU8C1QLNeVg8TvzoEkIHWZ4vxtxEVFWUY=
github.com/v2pro/wombat v0.0.0-20180402055224-a56dbdcddef2/go.mod h1:wen8nMxrRrUmXnRwH+3wGAW+hyYTHcOrTNhMpxyp/i0=
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8=
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
Expand Down

0 comments on commit b0b8482

Please sign in to comment.