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

optimize: unify multiple protocols into one suite; upgrade dependency version #3

Merged
merged 4 commits into from
Jun 2, 2022
Merged
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
14 changes: 14 additions & 0 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,19 @@ jobs:
restore-keys: |
${{ runner.os }}-go-

- name: Check License Header
uses: apache/skywalking-eyes@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Lint
run: |
go vet -stdmethods=false $(go list ./...)
go install mvdan.cc/gofumpt@v0.2.0
test -z "$(gofumpt -l -extra .)"

- name: Unit Test
run: go test -v -race -covermode=atomic -coverprofile=coverage.out ./...

- name: Benchmark
run: go test -bench=. -benchmem -run=none ./...
58 changes: 18 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,28 +90,6 @@ func main(){

```



## Kitex Multi Protocol
> Kitex supports multiple protocols, we can use different suites to initialize opentelemetry observability suites.
#### Thrift + TTHeader
```go
// server
server.WithSuite(tracing.NewServerSuite())
// client
client.WithSuite(tracing.NewClientSuite())
```

#### GRPC + HTTP2
```go
// server
server.WithSuite(tracing.NewGRPCServerSuite())
// client
client.WithSuite(tracing.NewGRPCClientSuite())
```



## Tracing associated Logs

#### set logger impl
Expand Down Expand Up @@ -206,19 +184,19 @@ sum(rate(rpc_server_duration_count{}[5m])) by (service_name, peer_service)
### Runtime Metrics
| Name | Instrument | Unit | Unit (UCUM)) | Description |
|------|------------|------|-------------------------------------------|-------------|
| `runtime.go.cgo.calls` | Sum | - | - | Number of cgo calls made by the current process. |
| `runtime.go.gc.count` | Sum | - | - | Number of completed garbage collection cycles. |
| `runtime.go.gc.pause_ns` | Histogram | nanosecond | `ns` | Amount of nanoseconds in GC stop-the-world pauses. |
| `runtime.go.gc.pause_total_ns` | Histogram | nanosecond | `ns` | Cumulative nanoseconds in GC stop-the-world pauses since the program started. |
| `runtime.go.goroutines` | Gauge | - | - | measures duration of outbound RPC. |
| `runtime.go.lookups` | Sum | - | - | Number of pointer lookups performed by the runtime. |
| `runtime.go.mem.heap_alloc` | Gauge | bytes | `bytes` | Bytes of allocated heap objects. |
| `runtime.go.mem.heap_idle` | Gauge | bytes | `bytes` | Bytes in idle (unused) spans. |
| `runtime.go.mem.heap_inuse` | Gauge | bytes | `bytes` | Bytes in in-use spans. |
| `runtime.go.mem.heap_objects` | Gauge | - | - | Number of allocated heap objects. |
| `runtime.go.mem.live_objects` | Gauge | - | - | Number of live objects is the number of cumulative Mallocs - Frees. |
| `runtime.go.mem.heap_released` | Gauge | bytes | `bytes` | Bytes of idle spans whose physical memory has been returned to the OS. |
| `runtime.go.mem.heap_sys` | Gauge | bytes | `bytes` | Bytes of idle spans whose physical memory has been returned to the OS. |
| `process.runtime.go.cgo.calls` | Sum | - | - | Number of cgo calls made by the current process. |
| `process.runtime.go.gc.count` | Sum | - | - | Number of completed garbage collection cycles. |
| `process.runtime.go.gc.pause_ns` | Histogram | nanosecond | `ns` | Amount of nanoseconds in GC stop-the-world pauses. |
| `process.runtime.go.gc.pause_total_ns` | Histogram | nanosecond | `ns` | Cumulative nanoseconds in GC stop-the-world pauses since the program started. |
| `process.runtime.go.goroutines` | Gauge | - | - | measures duration of outbound RPC. |
| `process.runtime.go.lookups` | Sum | - | - | Number of pointer lookups performed by the runtime. |
| `process.runtime.go.mem.heap_alloc` | Gauge | bytes | `bytes` | Bytes of allocated heap objects. |
| `process.runtime.go.mem.heap_idle` | Gauge | bytes | `bytes` | Bytes in idle (unused) spans. |
| `process.runtime.go.mem.heap_inuse` | Gauge | bytes | `bytes` | Bytes in in-use spans. |
| `process.runtime.go.mem.heap_objects` | Gauge | - | - | Number of allocated heap objects. |
| `process.runtime.go.mem.live_objects` | Gauge | - | - | Number of live objects is the number of cumulative Mallocs - Frees. |
| `process.runtime.go.mem.heap_released` | Gauge | bytes | `bytes` | Bytes of idle spans whose physical memory has been returned to the OS. |
| `process.runtime.go.mem.heap_sys` | Gauge | bytes | `bytes` | Bytes of idle spans whose physical memory has been returned to the OS. |
| `runtime.uptime` | Sum | ms | `ms` | Milliseconds since application was initialized. |


Expand All @@ -232,11 +210,11 @@ maintained by: [CoderPoet](https://github.com/CoderPoet)
## Dependencies
| **Library/Framework** | **Versions** | **Notes** |
| --- | --- | --- |
| go.opentelemetry.io/otel | v1.4.1 | ​<br /> |
| go.opentelemetry.io/otel/trace | v1.4.1 | ​<br /> |
| go.opentelemetry.io/otel/metric | v0.27.0 | ​<br /> |
| go.opentelemetry.io/otel | v1.7.0 | ​<br /> |
| go.opentelemetry.io/otel/trace | v1.7.0 | ​<br /> |
| go.opentelemetry.io/otel/metric | v0.30.0 | ​<br /> |
| go.opentelemetry.io/otel/semconv | v1.7.0 | |
| go.opentelemetry.io/contrib/instrumentation/runtime | v0.29.0 | |
| kitex | v0.2.0 | |
| go.opentelemetry.io/contrib/instrumentation/runtime | v0.30.0 | |
| kitex | v0.3.1 | |


71 changes: 53 additions & 18 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,23 +1,58 @@
module github.com/kitex-contrib/obs-opentelemetry

go 1.16
go 1.17

require (
github.com/bytedance/gopkg v0.0.0-20210910103821-e4efae9c17c3
github.com/cloudwego/kitex v0.2.0
github.com/stretchr/testify v1.7.0
go.opentelemetry.io/contrib/instrumentation/runtime v0.29.0
go.opentelemetry.io/contrib/propagators/b3 v1.4.0
go.opentelemetry.io/contrib/propagators/jaeger v1.4.0
go.opentelemetry.io/contrib/propagators/opencensus v0.29.0
go.opentelemetry.io/contrib/propagators/ot v1.4.0
go.opentelemetry.io/otel v1.4.1
go.opentelemetry.io/otel/exporters/otlp/otlpmetric v0.27.0
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.27.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.4.1
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.4.1
go.opentelemetry.io/otel/metric v0.27.0
go.opentelemetry.io/otel/sdk v1.4.1
go.opentelemetry.io/otel/sdk/metric v0.27.0
go.opentelemetry.io/otel/trace v1.4.1
github.com/bytedance/gopkg v0.0.0-20220531084716-665b4f21126f
github.com/cloudwego/kitex v0.3.1
github.com/stretchr/testify v1.7.1
go.opentelemetry.io/contrib/instrumentation/runtime v0.32.0
go.opentelemetry.io/contrib/propagators/b3 v1.7.0
go.opentelemetry.io/contrib/propagators/jaeger v1.7.0
go.opentelemetry.io/contrib/propagators/opencensus v0.32.0
go.opentelemetry.io/contrib/propagators/ot v1.7.0
go.opentelemetry.io/otel v1.7.0
go.opentelemetry.io/otel/exporters/otlp/otlpmetric v0.30.0
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.30.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.7.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.7.0
go.opentelemetry.io/otel/metric v0.30.0
go.opentelemetry.io/otel/sdk v1.7.0
go.opentelemetry.io/otel/sdk/metric v0.30.0
go.opentelemetry.io/otel/trace v1.7.0
)

require (
github.com/apache/thrift v0.13.0 // indirect
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
github.com/choleraehyq/pid v0.0.13 // indirect
github.com/cloudwego/netpoll v0.2.2 // indirect
github.com/cloudwego/thriftgo v0.1.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/tidwall/gjson v1.9.3 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.0 // indirect
go.opencensus.io v0.22.6-0.20201102222123-380f4078db9f // indirect
go.opentelemetry.io/otel/bridge/opencensus v0.30.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.7.0 // indirect
go.opentelemetry.io/proto/otlp v0.16.0 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
golang.org/x/net v0.0.0-20210614182718-04defd469f4e // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
golang.org/x/sys v0.0.0-20220110181412-a018aaa089fe // indirect
golang.org/x/text v0.3.6 // indirect
google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1 // indirect
google.golang.org/grpc v1.46.0 // indirect
google.golang.org/protobuf v1.28.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
)
Loading