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

Restore jaegerthrifthttpexporter #5666

Merged
merged 13 commits into from
Nov 1, 2021

Conversation

ctreatma
Copy link
Contributor

@ctreatma ctreatma commented Oct 6, 2021

Description:

In some cases, a Jaeger collector may be deployed to a platform that does not support gRPC. This restores the jaegerthrifthttpexporter so that OpenTelemetry users who need to ship traces to a Jaeger collector that cannot support gRPC are able to ship traces using the Jaeger collector's Thrift over HTTP API.

This also adds a warning to the README for the restored exporter directing users to use the jaeger exporter instead of jeager_thrift if they are able to do so.

Link to tracking Issue: #4667

Testing:

Documentation:

@ctreatma ctreatma requested review from a team and dmitryax October 6, 2021 21:00
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Oct 6, 2021

CLA Signed

The committers are authorized under a signed CLA.

  • ✅ Charles Treatman (c85c349678c53e2bc713551042e4d6e880594484, e093197d9e8ce9d39cca0eecdf0a5438b87ded46)

@bogdandrutu
Copy link
Member

/cc @jpkrohling

@github-actions
Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@github-actions github-actions bot added the Stale label Oct 15, 2021
@bogdandrutu bogdandrutu removed the Stale label Oct 15, 2021
@ctreatma ctreatma force-pushed the restore_jaeger_thrift branch from 24411a0 to 5e2cc3e Compare October 20, 2021 18:52
Copy link
Member

@jpkrohling jpkrohling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking great! There are a few helpers and changes to the config that we did over time that need to be applied here to be consistent with the other components. Let me know if you want me to handle those changes in a subsequent PR.

exporter/jaegerthrifthttpexporter/config.go Outdated Show resolved Hide resolved
exporter/jaegerthrifthttpexporter/config.go Outdated Show resolved Hide resolved
exporter/jaegerthrifthttpexporter/config.go Outdated Show resolved Hide resolved
exporter/jaegerthrifthttpexporter/config.go Outdated Show resolved Hide resolved
exporter/jaegerthrifthttpexporter/exporter.go Outdated Show resolved Hide resolved
exporter/jaegerthrifthttpexporter/exporter.go Outdated Show resolved Hide resolved
exporter/jaegerthrifthttpexporter/exporter.go Outdated Show resolved Hide resolved
exporter/jaegerthrifthttpexporter/factory.go Outdated Show resolved Hide resolved
exporter/jaegerthrifthttpexporter/factory_test.go Outdated Show resolved Hide resolved
go.mod Outdated Show resolved Hide resolved
jpkrohling
jpkrohling previously approved these changes Oct 22, 2021
Copy link
Member

@jpkrohling jpkrohling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. @bogdandrutu, I think I caught all the "modernization" issues, but would you like to check it as well? Otherwise, we can always improve later.

exporter/jaegerthrifthttpexporter/factory.go Show resolved Hide resolved
@jpkrohling
Copy link
Member

@ctreatma, could you take a look at the build failures? Some things do seem related to this PR, like this:

?   	github.com/open-telemetry/opentelemetry-collector-contrib/cmd/otelcontribcol	[no test files]
--- FAIL: TestDefaultExporters (0.10s)
    exporters_test.go:137: 
        	Error Trace:	exporters_test.go:137
        	Error:      	Not equal: 
        	            	expected: 36
        	            	actual  : 37
        	Test:       	TestDefaultExporters

Also, I'll run a manual e2e test and report back the results.

@jpkrohling
Copy link
Member

Looks like there's something missing:

$ go run ./cmd/otelcontribcol/ --config local/jaeger_thrift.yaml 
2021-10-22T13:57:17.290+0200	info	service/collector.go:174	Applying configuration...
2021-10-22T13:57:17.290+0200	info	builder/exporters_builder.go:259	Exporter was built.	{"kind": "exporter", "name": "jaeger_thrift"}
2021-10-22T13:57:17.291+0200	info	builder/exporters_builder.go:259	Exporter was built.	{"kind": "exporter", "name": "logging"}
2021-10-22T13:57:17.291+0200	info	builder/pipelines_builder.go:220	Pipeline was built.	{"pipeline_name": "traces", "pipeline_datatype": "traces"}
2021-10-22T13:57:17.291+0200	info	builder/receivers_builder.go:228	Receiver was built.	{"kind": "receiver", "name": "otlp", "datatype": "traces"}
2021-10-22T13:57:17.291+0200	info	service/service.go:86	Starting extensions...
2021-10-22T13:57:17.291+0200	info	service/service.go:91	Starting exporters...
2021-10-22T13:57:17.291+0200	info	builder/exporters_builder.go:40	Exporter is starting...	{"kind": "exporter", "name": "jaeger_thrift"}
Error: cannot start exporters: %!v(PANIC=Error method: runtime error: invalid memory address or nil pointer dereference)
2021/10/22 13:57:17 collector server run finished with error: cannot start exporters: %!v(PANIC=Error method: runtime error: invalid memory address or nil pointer dereference)
exit status 1

This is the config file I'm using:

receivers:
  otlp:
    protocols:
      grpc:

processors:

exporters:
  jaeger_thrift:
    endpoint: "http://localhost:14268/api/traces"

  logging:

service:
  pipelines:
    traces:
     receivers: [otlp]
     processors: []
     exporters: [jaeger_thrift, logging]

@jpkrohling jpkrohling dismissed their stale review October 22, 2021 11:59

dismissing the review until the manual tests succeed as well

Copy link
Member

@jpkrohling jpkrohling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jpkrohling
Copy link
Member

This PR is looking great! I did a manual e2e test, and it worked. There's a test still failing, though:

--- FAIL: TestDefaultExporters (0.10s)
    exporters_test.go:146: 
        	Error Trace:	exporters_test.go:146
        	Error:      	Not equal: 
        	            	expected: 38
        	            	actual  : 37
        	Test:       	TestDefaultExporters
    --- FAIL: TestDefaultExporters/jaeger_thrift (0.00s)
        exporters_test.go:195: 
            	Error Trace:	exporters_test.go:195
            	            				exporters_test.go:159
            	Error:      	Received unexpected error:
            	            	"jaeger_thrift" config requires a valid "url": parse "127.0.0.1:50024": invalid URI for request
            	Test:       	TestDefaultExporters/jaeger_thrift
FAIL
FAIL	github.com/open-telemetry/opentelemetry-collector-contrib/internal/components	0.993s

You also need to add the new module to the versions.yaml at the top-level directory. I think it should be fine after that.

@ctreatma
Copy link
Contributor Author

I updated a few places where I missed the url => endpoint change and added the Jaeger Thrift exporter to values.yaml. I'm still getting some failures for make gotest, but they're for receivers I haven't touched and the same failures happen for on main, so I think everything should be OK for the new exporter.

@jpkrohling
Copy link
Member

An unrelated test failed (fluentbit receiver?). Sorry, I hit "re-run jobs" before I could copy the output to create an issue.

@jpkrohling
Copy link
Member

Sorry, there was a release in between and the go.mod is now conflicting :/ Would you please rebase this? It is already approved and will be merged after resolving the conflict.

ctreatma and others added 9 commits October 29, 2021 10:05
In some cases, a Jaeger collector may be deployed to a platform
that does not support gRPC.  This restores the jaegerthrifthttpexporter
so that OpenTelemetry users who need to ship traces to a Jaeger
collector that cannot support gRPC are able to ship traces using
the Jaeger collector's [Thrift over HTTP API](https://www.jaegertracing.io/docs/1.27/apis/#thrift-over-http-stable).
This removes the protospan_to_jaegerthrift translator because we can
use the existing internal_to_jaegerproto translator to translate from
from internal spans to Jaeger domain spans.  The Jaeger domain spans
to Jaeger Thrift conversion is small enough that I think it makes more
sense as part of the exporter now.

That said, some tests may need to be added for the exporter to cover
the code that used to be in protospan_to_jaegerthrift.
I still need to convert from jaeger/model.Batch to thrift-gen/jaeger.Batch,
which will require a separate translator
@ctreatma ctreatma force-pushed the restore_jaeger_thrift branch from b5e31c5 to acec9f0 Compare October 29, 2021 14:37
@jpkrohling jpkrohling merged commit 8e5b3ac into open-telemetry:main Nov 1, 2021
@ctreatma ctreatma deleted the restore_jaeger_thrift branch November 1, 2021 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants