Skip to content

Commit

Permalink
bugfix: fix typo and workflow issue, before replease version published
Browse files Browse the repository at this point in the history
  • Loading branch information
hanyuancheung committed Oct 25, 2023
1 parent 6a0f869 commit b566eb8
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 19 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ plugins:
enabled: true # default true
enable_register: true # register metrics endpoint to etcd, default true
registry_endpoints: ["your.own.registry.addr:port"]
server_owner: # server owners seperated by ;.
server_owner: # server owners separated by ;.
client_histogram_buckets: [.005, .01, .1, .5, 1, 5] # optional config for client histogram buckets(Requires incrementing values, with a maximum length of 10 elements, and the data type should be float64.)
server_histogram_buckets: [.005, .01, .025, .05, .1, .25, .5, 1, 5] # optional config for server histogram buckets(Requires incrementing values, with a maximum length of 10 elements, and the data type should be float64.)
disable_rpc_method_mapping: false # Optional configuration (default false). When set to true, the original interface name will be reported as-is when reporting metrics.
Expand Down Expand Up @@ -140,8 +140,8 @@ plugins:
enable_zpage: false # Default false, when enabled, the processor exports span locally and can be viewed at /debug/tracez
```
3. metrcs plugin setup
default registerd to etcd cluster, can be turned off.
3. metrics plugin setup
default registered to etcd cluster, can be turned off.
support prometheus gateway, require program sending delete request to push gateway before exit, add defer metric.DeletePrometheusPush() in main function, e.g.,
```go
package main
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ go 1.18

require (
github.com/cenkalti/backoff/v4 v4.2.1
github.com/golang/protobuf v1.5.3
github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0
github.com/guillermo/go.procmeminfo v0.0.0-20131127224636-be4355a9fb0e
github.com/json-iterator/go v1.1.12
Expand Down Expand Up @@ -45,6 +44,7 @@ require (
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v4 v4.4.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/btree v1.0.1 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions oteltrpc/README_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* caller_service: 主调方服务名,取msg.CallerServiceName()
* caller_method: 主调方方法名,取msg.CallerMethod()
* callee_service: 被调方服务名,取msg.CalleeServiceName()
* callee_method: 被调方方法名,取msg.CalleMethod()
* callee_method: 被调方方法名,取msg.CalleeMethod()

### 被调

Expand Down Expand Up @@ -108,7 +108,7 @@
* tps.tenant.id: 租户id
* telemetry.sdk.language: SDK语言,hardcode "go"
* telemetry.sdk.name: SDK名, hardcode "opentelemetry"
* service.name(optional): service名,trpc.yaml中第一个serivce的name
* service.name(optional): service名,trpc.yaml中第一个service的name


#### common attributes
Expand Down
2 changes: 1 addition & 1 deletion oteltrpc/metrics/prometheus/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func calcMetaDataSize(md codec.MetaData) int {
// monitorRequestSize monitor request size
func monitorRequestSize(req interface{}, md codec.MetaData) {
ObserveRequestBodyBytes(calcBodySize(req))
ObserveRequestMataDataBytes(calcMetaDataSize(md))
ObserveRequestMetaDataBytes(calcMetaDataSize(md))
}

type serverFilterOption struct {
Expand Down
6 changes: 3 additions & 3 deletions oteltrpc/metrics/prometheus/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ var (

requestMetaDataBodyBytes = promauto.NewHistogram(prometheus.HistogramOpts{
Subsystem: "rpc",
Name: "request_matadata_bytes",
Name: "request_metadata_bytes",
Help: "Request Metadata Bytes",
Buckets: []float64{1024, 10240, 102400, 1024_000, 10240_000},
})
Expand Down Expand Up @@ -83,8 +83,8 @@ func ObserveRequestBodyBytes(s int) {
requestBodyBytes.Observe(float64(s))
}

// ObserveRequestMataDataBytes observe request metadata bytes
func ObserveRequestMataDataBytes(s int) {
// ObserveRequestMetaDataBytes observe request metadata bytes
func ObserveRequestMetaDataBytes(s int) {
requestMetaDataBodyBytes.Observe(float64(s))
}

Expand Down
4 changes: 2 additions & 2 deletions otelzap/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ import (
"sync/atomic"
"time"

v1proto "github.com/golang/protobuf/proto"
jsoniter "github.com/json-iterator/go"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/sdk/resource"
commonproto "go.opentelemetry.io/proto/otlp/common/v1"
logsproto "go.opentelemetry.io/proto/otlp/logs/v1"
resourceproto "go.opentelemetry.io/proto/otlp/resource/v1"
"go.uber.org/zap/zapcore"
"google.golang.org/protobuf/proto"

"trpc-system/go-opentelemetry/pkg/metrics"
sdklog "trpc-system/go-opentelemetry/sdk/log"
Expand Down Expand Up @@ -472,7 +472,7 @@ func (bp *BatchWriteSyncer) shouldProcessInBatch() bool {

// calcLogSize calculates the packet size of a ScopeLogs
func calcLogSize(sl *logsproto.ScopeLogs) int {
return v1proto.Size(sl)
return proto.Size(sl)
}

// BatchSyncerOption apply changes to internalOptions.
Expand Down
3 changes: 1 addition & 2 deletions otelzap/zap_benchmark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ import (
sdklog "trpc-system/go-opentelemetry/sdk/log"

"go.uber.org/zap"

"github.com/golang/protobuf/proto"
"go.uber.org/zap/zapcore"
"google.golang.org/protobuf/proto"

commonproto "go.opentelemetry.io/proto/otlp/common/v1"
logsproto "go.opentelemetry.io/proto/otlp/logs/v1"
Expand Down
1 change: 0 additions & 1 deletion sdk/metric/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ func newTLSConfig(tlsCert TLSCert) *tls.Config {
Certificates: []tls.Certificate{cert},
RootCAs: caCertPool,
}
tlsConfig.BuildNameToCertificate()
return tlsConfig
}
return nil
Expand Down
3 changes: 2 additions & 1 deletion sdk/remote/configurator.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"time"

"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
"google.golang.org/grpc/metadata"

"trpc-system/go-opentelemetry/pkg/protocol/opentelemetry-ext/proto/operation"
Expand Down Expand Up @@ -84,7 +85,7 @@ func (rc *remoteConfigurator) syncDaemon() {

func (rc *remoteConfigurator) sync() {
if rc.client == nil {
cc, err := grpc.Dial(rc.remoteServiceAddr, grpc.WithInsecure())
cc, err := grpc.Dial(rc.remoteServiceAddr, grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
if rc.debug {
log.Printf("opentelemetry: remote dial err:%v", err)
Expand Down
3 changes: 2 additions & 1 deletion sdk/trace/dyeing_sampler.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
sdktrace "go.opentelemetry.io/otel/sdk/trace"
"go.opentelemetry.io/otel/trace"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
"google.golang.org/grpc/metadata"

"trpc-system/go-opentelemetry/pkg/protocol/opentelemetry-ext/proto/sampler"
Expand Down Expand Up @@ -149,7 +150,7 @@ func (ws *Sampler) updateDyeingMetadataDaemon() {

func (ws *Sampler) updateDyeingMetadata() {
if ws.client == nil {
cc, err := grpc.Dial(ws.samplerConfig.SamplerServiceAddr, grpc.WithInsecure())
cc, err := grpc.Dial(ws.samplerConfig.SamplerServiceAddr, grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
return
}
Expand Down
2 changes: 1 addition & 1 deletion sdk/trace/noop.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (

// NoopTracerProvider implementation a tracer provider that will do nothing
// use code lines blow to set a noop tracer
// otel.SetTracerProvider(NooTracerProvider)
// otel.SetTracerProvider(NoopTracerProvider)
var NoopTracerProvider = trace.NewNoopTracerProvider()

// SetNoopTracerProvider set the global trace provider as noop
Expand Down
2 changes: 1 addition & 1 deletion tag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ if [ "${COMMIT_FOUND}" != "${COMMIT_HASH}" ] ; then
exit -1
fi

# Check if the tag doesn't alread exists.
# Check if the tag doesn't already exists.
TAG_FOUND=`git tag --list ${TAG}`
if [ "${TAG_FOUND}" = "${TAG}" ] ; then
printf "Tag ${TAG} already exists\n"
Expand Down

0 comments on commit b566eb8

Please sign in to comment.