Skip to content

Commit

Permalink
upgrade thrift to v0.14.1 in jaeger exporter (#1712)
Browse files Browse the repository at this point in the history
* upgrade thrift to v0.14.1 in jaeger exporter

* remove jaeger exporter vendor folder

* update PR number in changlog

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
  • Loading branch information
kjschnei001 and MrAlias authored Mar 22, 2021
1 parent 5a6a854 commit a9b2f85
Show file tree
Hide file tree
Showing 55 changed files with 7,159 additions and 1,881 deletions.
3 changes: 1 addition & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

### Changed

- Jaeger exporter was updated to use thrift v0.14.1. (#1712)
- Migrate from using internally built and maintained version of the OTLP to the one hosted at `go.opentelemetry.io/proto/otlp`. (#1713)
- Migrate from using `github.com/gogo/protobuf` to `google.golang.org/protobuf` to match `go.opentelemetry.io/proto/otlp`. (#1713)

Expand Down Expand Up @@ -38,8 +39,6 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- Renamed the `LabelSet` method of `"go.opentelemetry.io/otel/sdk/resource".Resource` to `Set`. (#1692)
- Changed `WithSDK` to `WithSDKOptions` to accept variadic arguments of `TracerProviderOption` type in `go.opentelemetry.io/otel/exporters/trace/jaeger` package. (#1693)
- Changed `WithSDK` to `WithSDKOptions` to accept variadic arguments of `TracerProviderOption` type in `go.opentelemetry.io/otel/exporters/trace/zipkin` package. (#1693)
- `"go.opentelemetry.io/otel/sdk/resource".NewWithAttributes` will now drop any invalid attributes passed. (#1703)
- `"go.opentelemetry.io/otel/sdk/resource".StringDetector` will now error if the produced attribute is invalid. (#1703)

### Removed

Expand Down
2 changes: 1 addition & 1 deletion exporters/trace/jaeger/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ go get -u go.opentelemetry.io/otel/exporters/trace/jaeger

## Maintenance

This exporter uses a vendored copy of the Apache Thrift library (v0.13.0) at a custom import path. When re-generating Thrift code in future, please adapt import paths as necessary.
This exporter uses a vendored copy of the Apache Thrift library (v0.14.1) at a custom import path. When re-generating Thrift code in future, please adapt import paths as necessary.
13 changes: 7 additions & 6 deletions exporters/trace/jaeger/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package jaeger // import "go.opentelemetry.io/otel/exporters/trace/jaeger"

import (
"context"
"fmt"
"io"
"log"
Expand All @@ -23,6 +24,7 @@ import (

"go.opentelemetry.io/otel/exporters/trace/jaeger/internal/third_party/thrift/lib/go/thrift"

genAgent "go.opentelemetry.io/otel/exporters/trace/jaeger/internal/gen-go/agent"
gen "go.opentelemetry.io/otel/exporters/trace/jaeger/internal/gen-go/jaeger"
)

Expand All @@ -31,11 +33,11 @@ const udpPacketMaxLength = 65000

// agentClientUDP is a UDP client to Jaeger agent that implements gen.Agent interface.
type agentClientUDP struct {
gen.Agent
genAgent.Agent
io.Closer

connUDP udpConn
client *gen.AgentClient
client *genAgent.AgentClient
maxPacketSize int // max size of datagram in bytes
thriftBuffer *thrift.TMemoryBuffer // buffer used to calculate byte size of a span
}
Expand Down Expand Up @@ -70,8 +72,8 @@ func newAgentClientUDP(params agentClientUDPParams) (*agentClientUDP, error) {
}

thriftBuffer := thrift.NewTMemoryBufferLen(params.MaxPacketSize)
protocolFactory := thrift.NewTCompactProtocolFactory()
client := gen.NewAgentClientFactory(thriftBuffer, protocolFactory)
protocolFactory := thrift.NewTCompactProtocolFactoryConf(&thrift.TConfiguration{})
client := genAgent.NewAgentClientFactory(thriftBuffer, protocolFactory)

var connUDP udpConn
var err error
Expand Down Expand Up @@ -109,8 +111,7 @@ func newAgentClientUDP(params agentClientUDPParams) (*agentClientUDP, error) {
// EmitBatch implements EmitBatch() of Agent interface
func (a *agentClientUDP) EmitBatch(batch *gen.Batch) error {
a.thriftBuffer.Reset()
a.client.SeqId = 0 // we have no need for distinct SeqIds for our one-way UDP messages
if err := a.client.EmitBatch(batch); err != nil {
if err := a.client.EmitBatch(context.Background(), batch); err != nil {
return err
}
if a.thriftBuffer.Len() > a.maxPacketSize {
Expand Down

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

26 changes: 26 additions & 0 deletions exporters/trace/jaeger/internal/gen-go/agent/agent-consts.go

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

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

Loading

0 comments on commit a9b2f85

Please sign in to comment.