Couchbase C++ SDK 1.0.2 (rev. 51f4775)
Loading...
Searching...
No Matches
request_tracer.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2/*
3 * Copyright 2021 Couchbase, Inc.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#pragma once
19
21
22#include <memory>
23#include <string>
24
25namespace couchbase::tracing
26{
28{
29public:
30 request_tracer() = default;
31 request_tracer(const request_tracer& other) = default;
32 request_tracer(request_tracer&& other) = default;
33 auto operator=(const request_tracer& other) -> request_tracer& = default;
34 auto operator=(request_tracer&& other) -> request_tracer& = default;
35 virtual ~request_tracer() = default;
36
41 virtual void start()
42 {
43 /* do nothing */
44 }
45
49 virtual void stop()
50 {
51 /* do nothing */
52 }
53
54 virtual auto start_span(std::string name, std::shared_ptr<request_span> parent = {})
55 -> std::shared_ptr<request_span> = 0;
56};
57
58} // namespace couchbase::tracing
Definition request_tracer.hxx:28
request_tracer(request_tracer &&other)=default
request_tracer(const request_tracer &other)=default
virtual auto start_span(std::string name, std::shared_ptr< request_span > parent={}) -> std::shared_ptr< request_span >=0
virtual void start()
SDK invokes this method when cluster is ready to trace.
Definition request_tracer.hxx:41
auto operator=(const request_tracer &other) -> request_tracer &=default
virtual void stop()
SDK invokes this method when cluster is closed.
Definition request_tracer.hxx:49
auto operator=(request_tracer &&other) -> request_tracer &=default
Definition otel_tracer.hxx:28
@ parent
Notify the context that the process has forked and is the parent.