]>
git.proxmox.com Git - ceph.git/blob - ceph/src/jaegertracing/jaeger-client-cpp/crossdock/Server.h
2 * Copyright (c) 2017 Uber Technologies, Inc.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef JAEGERTRACING_CROSSDOCK_SERVER_H
18 #define JAEGERTRACING_CROSSDOCK_SERVER_H
22 #include <opentracing/tracer.h>
24 #include "jaegertracing/thrift-gen/tracetest_types.h"
26 namespace jaegertracing
{
31 } // namespace logging
48 Server(const net::IPAddress
& clientIP
,
49 const net::IPAddress
& serverIP
,
50 const std::string
& agentHostPort
,
51 const std::string
& collectorEndpoint
,
52 const std::string
& samplingServerURL
);
59 template <typename RequestType
>
60 std::string
handleJSON(
61 const net::http::Request
& request
,
62 std::function
<thrift::TraceResponse(
63 const RequestType
&, const opentracing::SpanContext
&)> handler
);
65 std::string
handleRequest(const net::http::Request
& request
);
67 thrift::TraceResponse
startTrace(const thrift::StartTraceRequest
& request
);
69 thrift::TraceResponse
joinTrace(const thrift::JoinTraceRequest
& request
,
70 const opentracing::SpanContext
& ctx
);
72 std::string
generateTraces(const net::http::Request
& request
);
75 class EndToEndHandler
;
77 std::shared_ptr
<logging::Logger
> _logger
;
78 std::shared_ptr
<opentracing::Tracer
> _tracer
;
79 std::unique_ptr
<SocketListener
> _clientListener
;
80 std::unique_ptr
<SocketListener
> _serverListener
;
81 std::unique_ptr
<EndToEndHandler
> _handler
;
84 } // namespace crossdock
85 } // namespace jaegertracing
87 #endif // JAEGERTRACING_CROSSDOCK_SERVER_H