forked from jaegertracing/jaeger
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Yuri Shkuro <[email protected]> Fix lint Signed-off-by: Yuri Shkuro <[email protected]> Add gRPC endpoint to collector Signed-off-by: Yuri Shkuro <[email protected]> Add proper grpc server Signed-off-by: Yuri Shkuro <[email protected]> Add grpc to all-in-one Signed-off-by: Yuri Shkuro <[email protected]> adds the gRPC port to the docker-all-in-one Dockerfile (jaegertracing#773) (jaegertracing#967) Signed-off-by: Jan Heylen <[email protected]> Simple fixes (jaegertracing#999) * Fix test error Signed-off-by: Isaac Hier <[email protected]> * go fmt Signed-off-by: Isaac Hier <[email protected]> Implement PostSpans for collector gRPC handler Signed-off-by: Isaac Hier <[email protected]> Fix formatting Signed-off-by: Isaac Hier <[email protected]> Remove timeout Signed-off-by: Isaac Hier <[email protected]> Use expectedError variable Signed-off-by: Isaac Hier <[email protected]>
- Loading branch information
1 parent
eab423c
commit 6566ba1
Showing
20 changed files
with
1,715 additions
and
993 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,9 @@ EXPOSE 5778 | |
# Collector HTTP | ||
EXPOSE 14268 | ||
|
||
# Collector gRPC | ||
EXPOSE 14270 | ||
|
||
# Web HTTP | ||
EXPOSE 16686 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
// Copyright (c) 2018 The Jaeger Authors. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package app | ||
|
||
import ( | ||
"context" | ||
"time" | ||
|
||
"go.uber.org/zap" | ||
|
||
"github.com/jaegertracing/jaeger/model" | ||
"github.com/jaegertracing/jaeger/proto-gen/api_v2" | ||
) | ||
|
||
// GRPCHandler implements gRPC CollectorService. | ||
type GRPCHandler struct { | ||
logger *zap.Logger | ||
spanProcessor SpanProcessor | ||
} | ||
|
||
// NewGRPCHandler registers routes for this handler on the given router. | ||
func NewGRPCHandler(logger *zap.Logger, spanProcessor SpanProcessor) *GRPCHandler { | ||
return &GRPCHandler{ | ||
logger: logger, | ||
spanProcessor: spanProcessor, | ||
} | ||
} | ||
|
||
// PostSpans implements gRPC CollectorService. | ||
func (g *GRPCHandler) PostSpans(ctx context.Context, r *api_v2.PostSpansRequest) (*api_v2.PostSpansResponse, error) { | ||
oks, err := g.spanProcessor.ProcessSpans(r.GetBatch().Spans, JaegerFormatType) | ||
if err != nil { | ||
g.logger.Error("cannot process spans", zap.Error(err)) | ||
return nil, err | ||
} | ||
success := true | ||
for _, ok := range oks { | ||
if !ok { | ||
success = false | ||
break | ||
} | ||
} | ||
return &api_v2.PostSpansResponse{Ok: success}, nil | ||
} | ||
|
||
// GetTrace gets trace | ||
func (g *GRPCHandler) GetTrace(ctx context.Context, req *api_v2.GetTraceRequest) (*api_v2.GetTraceResponse, error) { | ||
// TODO | ||
return &api_v2.GetTraceResponse{ | ||
Trace: &model.Trace{ | ||
Spans: []*model.Span{ | ||
{ | ||
TraceID: model.TraceID{Low: 123}, | ||
SpanID: model.NewSpanID(456), | ||
OperationName: "foo bar", | ||
StartTime: time.Now(), | ||
}, | ||
}, | ||
}, | ||
}, nil | ||
} |
Oops, something went wrong.