Skip to content

Commit

Permalink
Jaeger http thrift (elastic#3081)
Browse files Browse the repository at this point in the history
Add an HTTP handler, muxer, and server, in beater/jaeger for accepting Thrift-encoded trace data over HTTP. Refactor beater/jaeger.GRPCServer into Server, which now encapsulates both gRPC and HTTP servers.

Move beater/api/jaeger code into beater/jaeger, which is the only user of GRPCCollector. If the beater/jaeger code grows significantly, we might consider having subpackages like beater/jaeger/grpc, beater/jaeger/http, etc.
  • Loading branch information
axw authored and simitt committed Jan 14, 2020
1 parent d6bd35b commit 47acdcb
Show file tree
Hide file tree
Showing 43 changed files with 3,655 additions and 683 deletions.
5 changes: 3 additions & 2 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2028,7 +2028,8 @@ Apache License 2.0

--------------------------------------------------------------------
Dependency: github.com/jaegertracing/jaeger
Revision: e4b97b38c4785d9a593483241f0a1d3abe007e1c
Version: v1.16.0
Revision: 1c315785dddc80a39637c2b08b0a9bbe9ab1536c
License type (autodetected): Apache-2.0
./vendor/github.com/jaegertracing/jaeger/LICENSE:
--------------------------------------------------------------------
Expand Down Expand Up @@ -2611,7 +2612,7 @@ Apache License 2.0
--------------------------------------------------------------------
Dependency: github.com/open-telemetry/opentelemetry-collector
Version: master
Revision: e94dd19191e0ba67d5d17c4504de5e97f512eb75
Revision: c300f13417023e53ddb643b312e6559899b54ac7
License type (autodetected): Apache-2.0
./vendor/github.com/open-telemetry/opentelemetry-collector/LICENSE:
--------------------------------------------------------------------
Expand Down
13 changes: 10 additions & 3 deletions _meta/beat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -400,11 +400,18 @@ apm-server:
#---------------------------- APM Server - Open Telemetry Collector integration ----------------------------

#jaeger:
# Enable jaeger collector listening for traces sent from jaeger agent via gRPC. Disabled by default.
#enabled: false
#grpc:
# Defines the gRPC host and port the server is listening on. Defaults to Jaeger collector default port 14250.
# Set to true to enable the Jaeger gRPC collector service.
#enabled: false
# Defines the gRPC host and port the server is listening on.
# Defaults to the standard Jaeger gRPC collector port 14250.
#host: "{{ .jaeger_grpc_hostport }}"
#http:
# Set to true to enable the Jaeger HTTP collector endpoint.
#enabled: false
# Defines the HTTP host and port the server is listening on.
# Defaults to the standard Jaeger HTTP collector port 14268.
#host: "{{ .jaeger_http_hostport }}"

#================================= General =================================

Expand Down
13 changes: 10 additions & 3 deletions apm-server.docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -400,11 +400,18 @@ apm-server:
#---------------------------- APM Server - Open Telemetry Collector integration ----------------------------

#jaeger:
# Enable jaeger collector listening for traces sent from jaeger agent via gRPC. Disabled by default.
#enabled: false
#grpc:
# Defines the gRPC host and port the server is listening on. Defaults to Jaeger collector default port 14250.
# Set to true to enable the Jaeger gRPC collector service.
#enabled: false
# Defines the gRPC host and port the server is listening on.
# Defaults to the standard Jaeger gRPC collector port 14250.
#host: "0.0.0.0:14250"
#http:
# Set to true to enable the Jaeger HTTP collector endpoint.
#enabled: false
# Defines the HTTP host and port the server is listening on.
# Defaults to the standard Jaeger HTTP collector port 14268.
#host: "0.0.0.0:14268"

#================================= General =================================

Expand Down
13 changes: 10 additions & 3 deletions apm-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -400,11 +400,18 @@ apm-server:
#---------------------------- APM Server - Open Telemetry Collector integration ----------------------------

#jaeger:
# Enable jaeger collector listening for traces sent from jaeger agent via gRPC. Disabled by default.
#enabled: false
#grpc:
# Defines the gRPC host and port the server is listening on. Defaults to Jaeger collector default port 14250.
# Set to true to enable the Jaeger gRPC collector service.
#enabled: false
# Defines the gRPC host and port the server is listening on.
# Defaults to the standard Jaeger gRPC collector port 14250.
#host: "localhost:14250"
#http:
# Set to true to enable the Jaeger HTTP collector endpoint.
#enabled: false
# Defines the HTTP host and port the server is listening on.
# Defaults to the standard Jaeger HTTP collector port 14268.
#host: "localhost:14268"

#================================= General =================================

Expand Down
96 changes: 0 additions & 96 deletions beater/api/jaeger/grpc.go

This file was deleted.

64 changes: 0 additions & 64 deletions beater/api/jaeger/grpc_approval_test.go

This file was deleted.

109 changes: 0 additions & 109 deletions beater/api/jaeger/grpc_test.go

This file was deleted.

4 changes: 2 additions & 2 deletions beater/api/mux.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ type route struct {

// NewMux registers apm handlers to paths building up the APM Server API.
func NewMux(beaterConfig *config.Config, report publish.Reporter) (*http.ServeMux, error) {
pool := newContextPool()
pool := request.NewContextPool()
mux := http.NewServeMux()
logger := logp.NewLogger(logs.Handler)

Expand Down Expand Up @@ -112,7 +112,7 @@ func NewMux(beaterConfig *config.Config, report publish.Reporter) (*http.ServeMu
return nil, err
}
logger.Infof("Path %s added to request handler", route.path)
mux.Handle(route.path, pool.handler(h))
mux.Handle(route.path, pool.HTTPHandler(h))

}
if beaterConfig.Expvar.IsEnabled() {
Expand Down
Loading

0 comments on commit 47acdcb

Please sign in to comment.