forked from ceph/ceph
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Basic Jaeger Tracing Added #1
Open
suab321321
wants to merge
22
commits into
master
Choose a base branch
from
suab321321_jaegerTracing
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 10 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
fd36b14
Basic Jaeger Tracing Added
suab321321 b878b91
Basic Jaeger Tracing Added
suab321321 05e1442
Merge branch 'suab321321_jaegerTracing' of https://github.com/suab321…
suab321321 eeebe21
"Jaeger Tracing of Bucket List Request"
suab321321 f10c6f4
Tracer for object Uploading in Container added
suab321321 1aa2724
Removing Uneccessary code
suab321321 725a5a4
Error Uploading Object to Container resolved
suab321321 a3ba8d7
Converted variables into snake_case and removed non-essential code
suab321321 f605172
RGW_OP_GET_OBJ tracer and cleanup
suab321321 1ec9c76
RGW_OP_DELETE_OBJ Tracer added
suab321321 a98ce02
RGW_OP_DELETE_BUCKET Tracer Added
suab321321 1117ba5
S3 and Swift tag added
suab321321 d70d0f8
Injecting trace further deep down functions for RGW_LIST_BUCKETS
suab321321 b83e969
Added more tracer to into deep functions RGW_LIST_BUCKET
suab321321 7f68f4d
Added more traces in depth in RGWPutObj operation
suab321321 8c60410
Added more traces to in-depth functions of RGW_PUTObj
suab321321 ea7e1e0
More Tracer added in-depth fucntion RGW_DELETE_BUCKET
suab321321 2b1bb05
Added more traces in depth of RGWCreateBucket
suab321321 3a331ff
Added more in depth traces to RGW_DeleteObj
suab321321 a42be55
Tracer Added in req_state and ListBuckets tracing added
suab321321 c88c714
Tracer for ListBucket
suab321321 7d76769
DeleteContainer
suab321321 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -0,0 +1,78 @@ | ||
#.rst: | ||
# FindJaeger | ||
# ------------ | ||
# | ||
# This module finds the `Jaeger` library. | ||
# | ||
# Imported target | ||
# ^^^^^^^^^^^^^^^ | ||
# | ||
# This module defines the following :prop_tgt:`IMPORTED` target: | ||
# | ||
# ``Jaeger`` | ||
# The Jaeger library, if found | ||
# | ||
# Result variables | ||
# ^^^^^^^^^^^^^^^^ | ||
# | ||
# This module sets the following | ||
# | ||
# ``Jaeger_FOUND`` | ||
# ``TRUE`` if system has Jaeger | ||
# ``Jaeger_INCLUDE_DIRS`` | ||
# The Jaeger include directories | ||
# ``Jaeger_LIBRARIES`` | ||
# The libraries needed to use Jaeger | ||
# ``Jaeger_VERSION_STRING`` | ||
# The Jaeger version | ||
# ``Jaeger_HAS_TRACEF`` | ||
# ``TRUE`` if the ``tracef()`` API is available in the system's LTTng-UST | ||
# ``Jaeger_HAS_TRACELOG`` | ||
# ``TRUE`` if the ``tracelog()`` API is available in the system's LTTng-UST | ||
|
||
#============================================================================= | ||
# Copyright 2018 Mania Abdi, Inc. | ||
# Copyright 2018 Mania Abdi | ||
# | ||
# Distributed under the OSI-approved BSD License (the "License"); | ||
# see accompanying file Copyright.txt for details. | ||
# | ||
# This software is distributed WITHOUT ANY WARRANTY; without even the | ||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
# See the License for more information. | ||
#============================================================================= | ||
# (To distribute this file outside of CMake, substitute the full | ||
# License text for the above reference.) | ||
|
||
find_path(Jaeger_INCLUDE_DIRS NAMES jaegertracing/Tracer.h) | ||
find_library(Jaeger_LIBRARIES NAMES jaegertracing) | ||
|
||
if(Jaeger_INCLUDE_DIRS AND Jaeger_LIBRARIES) | ||
# find tracef() and tracelog() support | ||
set(Jaeger_HAS_TRACEF 0) | ||
set(Jaeger_HAS_TRACELOG 0) | ||
|
||
set(Jaeger_VERSION_STRING "0.5.0") | ||
|
||
if(NOT TARGET Jaeger) | ||
add_library(Jaeger UNKNOWN IMPORTED) | ||
set_target_properties(Jaeger PROPERTIES | ||
INTERFACE_INCLUDE_DIRECTORIES "${Jaeger_INCLUDE_DIRS}" | ||
INTERFACE_LINK_LIBRARIES ${CMAKE_DL_LIBS} | ||
IMPORTED_LINK_INTERFACE_LANGUAGES "C" | ||
IMPORTED_LOCATION "${Jaeger_LIBRARIES}") | ||
endif() | ||
|
||
# add libdl to required libraries | ||
set(Jaeger_LIBRARIES ${Jaeger_LIBRARIES} ${CMAKE_DL_LIBS}) | ||
endif() | ||
|
||
# handle the QUIETLY and REQUIRED arguments and set LTTNGUST_FOUND to | ||
# TRUE if all listed variables are TRUE | ||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(Jaeger FOUND_VAR Jaeger_FOUND | ||
REQUIRED_VARS Jaeger_LIBRARIES | ||
Jaeger_INCLUDE_DIRS | ||
VERSION_VAR Jaeger_VERSION_STRING) | ||
mark_as_advanced(Jaeger_LIBRARIES Jaeger_INCLUDE_DIRS) | ||
|
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,78 @@ | ||
#.rst: | ||
# FindOpenTracing | ||
# ------------ | ||
# | ||
# This module finds the `OpenTracing` library. | ||
# | ||
# Imported target | ||
# ^^^^^^^^^^^^^^^ | ||
# | ||
# This module defines the following :prop_tgt:`IMPORTED` target: | ||
# | ||
# ``OpenTracing`` | ||
# The Opentracing library, if found | ||
# | ||
# Result variables | ||
# ^^^^^^^^^^^^^^^^ | ||
# | ||
# This module sets the following | ||
# | ||
# ``OpenTracing_FOUND`` | ||
# ``TRUE`` if system has OpenTracing | ||
# ``OpenTracing_INCLUDE_DIRS`` | ||
# The OpenTracing include directories | ||
# ``OpenTracing_LIBRARIES`` | ||
# The libraries needed to use OpenTracing | ||
# ``OpenTracing_VERSION_STRING`` | ||
# The OpenTracing version | ||
# ``OpenTracing_HAS_TRACEF`` | ||
# ``TRUE`` if the ``tracef()`` API is available in the system's LTTng-UST | ||
# ``OpenTracing_HAS_TRACELOG`` | ||
# ``TRUE`` if the ``tracelog()`` API is available in the system's LTTng-UST | ||
|
||
#============================================================================= | ||
# Copyright 2018 Mania Abdi, Inc. | ||
# Copyright 2018 Mania Abdi | ||
# | ||
# Distributed under the OSI-approved BSD License (the "License"); | ||
# see accompanying file Copyright.txt for details. | ||
# | ||
# This software is distributed WITHOUT ANY WARRANTY; without even the | ||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
# See the License for more information. | ||
#============================================================================= | ||
# (To distribute this file outside of CMake, substitute the full | ||
# License text for the above reference.) | ||
|
||
find_path(OpenTracing_INCLUDE_DIRS NAMES opentracing/tracer.h) | ||
find_library(OpenTracing_LIBRARIES NAMES opentracing) | ||
|
||
if(OpenTracing_INCLUDE_DIRS AND OpenTracing_LIBRARIES) | ||
# find tracef() and tracelog() support | ||
set(OpenTracing_HAS_TRACEF 0) | ||
set(OpenTracing_HAS_TRACELOG 0) | ||
|
||
# will need specifically 1.5.x for successful working with Jaeger | ||
set(OpenTracing_VERSION_STRING "1.5.x") | ||
|
||
if(NOT TARGET OpenTracing) | ||
add_library(OpenTracing UNKNOWN IMPORTED) | ||
set_target_properties(OpenTracing PROPERTIES | ||
INTERFACE_INCLUDE_DIRECTORIES "${OpenTracing_INCLUDE_DIRS}" | ||
INTERFACE_LINK_LIBRARIES ${CMAKE_DL_LIBS} | ||
IMPORTED_LINK_INTERFACE_LANGUAGES "C" | ||
IMPORTED_LOCATION "${OpenTracing_LIBRARIES}") | ||
endif() | ||
|
||
# add libdl to required libraries | ||
set(OpenTracing_LIBRARIES ${OpenTracing_LIBRARIES} ${CMAKE_DL_LIBS}) | ||
endif() | ||
|
||
# handle the QUIETLY and REQUIRED arguments and set LTTNGUST_FOUND to | ||
# TRUE if all listed variables are TRUE | ||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(OpenTracing FOUND_VAR OpenTracing_FOUND | ||
REQUIRED_VARS OpenTracing_LIBRARIES | ||
OpenTracing_INCLUDE_DIRS | ||
VERSION_VAR OpenTracing_VERSION_STRING) | ||
mark_as_advanced(OpenTracing_LIBRARIES OpenTracing_INCLUDE_DIRS) |
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,64 @@ | ||
# | ||
# This file is open source software, licensed to you under the terms | ||
# of the Apache License, Version 2.0 (the "License"). See the NOTICE file | ||
# distributed with this work for additional information regarding copyright | ||
# ownership. 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. | ||
# | ||
|
||
# | ||
# Copyright (C) 2018 Scylladb, Ltd. | ||
# | ||
|
||
find_package (PkgConfig REQUIRED) | ||
|
||
pkg_search_module (yaml-cpp_PC | ||
QUIET | ||
yaml-cpp) | ||
|
||
find_library (yaml-cpp_LIBRARY | ||
NAMES yaml-cpp | ||
HINTS | ||
${yaml-cpp_PC_LIBDIR} | ||
${yaml-cpp_PC_LIBRARY_DIRS}) | ||
|
||
find_path (yaml-cpp_INCLUDE_DIR | ||
NAMES yaml-cpp/yaml.h | ||
PATH_SUFFIXES yaml-cpp | ||
HINTS | ||
${yaml-cpp_PC_INCLUDEDIR} | ||
${yaml-cpp_PC_INCLUDE_DIRS}) | ||
|
||
mark_as_advanced ( | ||
yaml-cpp_LIBRARY | ||
yaml-cpp_INCLUDE_DIR) | ||
|
||
include (FindPackageHandleStandardArgs) | ||
|
||
find_package_handle_standard_args (yaml-cpp | ||
REQUIRED_VARS | ||
yaml-cpp_LIBRARY | ||
yaml-cpp_INCLUDE_DIR | ||
VERSION_VAR yaml-cpp_PC_VERSION) | ||
|
||
set (yaml-cpp_LIBRARIES ${yaml-cpp_LIBRARY}) | ||
set (yaml-cpp_INCLUDE_DIRS ${yaml-cpp_INCLUDE_DIR}) | ||
|
||
if (yaml-cpp_FOUND AND NOT (TARGET yaml-cpp::yaml-cpp)) | ||
add_library (yaml-cpp::yaml-cpp UNKNOWN IMPORTED) | ||
|
||
set_target_properties (yaml-cpp::yaml-cpp | ||
PROPERTIES | ||
IMPORTED_LOCATION ${yaml-cpp_LIBRARY} | ||
INTERFACE_INCLUDE_DIRECTORIES ${yaml-cpp_INCLUDE_DIRS}) | ||
endif () |
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,26 @@ | ||
|
||
|
||
#ifndef JAEGER_TRACER_ | ||
#define JAEGER_TRACER_ | ||
|
||
#include <memory> | ||
#include<jaegertracing/Tracer.h> | ||
#include <opentracing/tracer.h> | ||
|
||
class jTracer | ||
{ | ||
private: | ||
static jaegertracing::Config configuration; | ||
public: | ||
jTracer() {} | ||
static void loadYamlConfigFile(const char *); | ||
void initTracer(const char *); | ||
std::unique_ptr<opentracing::Span> newSpan(const char *); | ||
std::unique_ptr<opentracing::Span> childSpan(const char *, const std::unique_ptr<opentracing::Span> &); | ||
std::unique_ptr<opentracing::Span> followUpSpan(const char *, const std::unique_ptr<opentracing::Span> &); | ||
~jTracer(){ | ||
opentracing::Tracer::Global()->Close(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. looks good! |
||
} | ||
}; | ||
|
||
#endif |
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,34 @@ | ||
|
||
#include <yaml-cpp/yaml.h> | ||
#include <iostream> | ||
#include "jaegerTracer.h" | ||
|
||
void jTracer::loadYamlConfigFile(const char *filePath) | ||
{ | ||
auto yaml = YAML::LoadFile(filePath); | ||
jTracer::configuration = jaegertracing::Config::parse(yaml); | ||
} | ||
|
||
void jTracer::initTracer(const char *tracerName) | ||
{ | ||
auto tracer = jaegertracing::Tracer::make( | ||
tracerName, | ||
jTracer::configuration, | ||
jaegertracing::logging::consoleLogger()); | ||
opentracing::Tracer::InitGlobal( | ||
std::static_pointer_cast<opentracing::Tracer>(tracer)); | ||
} | ||
std::unique_ptr<opentracing::Span> newSpan(const char * spanName){ | ||
auto Span=opentracing::Tracer::Global()->StartSpan(spanName); | ||
return std::move(Span); | ||
} | ||
std::unique_ptr<opentracing::Span> jTracer::childSpan(const char *spanName, const std::unique_ptr<opentracing::Span> &parentSpan) | ||
{ | ||
auto Span = opentracing::Tracer::Global()->StartSpan(spanName, {opentracing::ChildOf(&parentSpan->context())}); | ||
return std::move(Span); | ||
} | ||
std::unique_ptr<opentracing::Span> jTracer::followUpSpan(const char *spanName, const std::unique_ptr<opentracing::Span> &parentSpan) | ||
{ | ||
auto Span = opentracing::Tracer::Global()->StartSpan(spanName, {opentracing::FollowsFrom(&parentSpan->context())}); | ||
return std::move(Span); | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are these changes part of your code? If not can you clean them up?