-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Metrics + OpenTelemetry Tracing (#541)
- Loading branch information
Showing
49 changed files
with
1,362 additions
and
95 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,15 +69,15 @@ | |
[boost] | ||
[email protected]:motis-project/boost.git | ||
branch=master | ||
commit=1c3f21c1fa8b149da89e2f6bcb48b28fff30fa5e | ||
commit=60cae66449fa3c9599b2b7d3d5d44c65301ed3a3 | ||
[mimalloc] | ||
[email protected]:motis-project/mimalloc.git | ||
branch=master | ||
commit=0087f000848de31b0090cb6f282348bd2fd3a9b8 | ||
[nigiri] | ||
[email protected]:motis-project/nigiri.git | ||
branch=master | ||
commit=ada780c39ab11cfd6a1dd6e8b972f6b877f07d1b | ||
commit=d6e1c8f5c0a8264e568fa85a34622e105a975315 | ||
[osr] | ||
[email protected]:motis-project/osr.git | ||
branch=master | ||
|
@@ -86,3 +86,11 @@ | |
[email protected]:triptix-tech/adr.git | ||
branch=master | ||
commit=bef3f11a8c1642939e7047bcebf3d2f3528b23a3 | ||
[prometheus-cpp] | ||
[email protected]:motis-project/prometheus-cpp.git | ||
branch=master | ||
commit=e420cd7cf3995a994220b40a36c987ac8e67c0bf | ||
[opentelemetry-cpp] | ||
[email protected]:motis-project/opentelemetry-cpp.git | ||
branch=main | ||
commit=ec4aef6b17b697052edef5417825ad71947b2ed1 |
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 |
---|---|---|
|
@@ -257,4 +257,4 @@ | |
"configurePreset": "linux-sanitizer" | ||
} | ||
] | ||
} | ||
} |
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 |
---|---|---|
|
@@ -13,4 +13,5 @@ target_link_libraries(motis-core | |
geo | ||
motis-data | ||
motis-module | ||
opentelemetry_api | ||
) |
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,11 @@ | ||
#pragma once | ||
|
||
#include <memory> | ||
|
||
#include "opentelemetry/trace/tracer.h" | ||
|
||
namespace motis { | ||
|
||
extern std::shared_ptr<opentelemetry::trace::Tracer> motis_tracer; | ||
|
||
} // namespace motis |
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,8 @@ | ||
#include "motis/core/otel/tracer.h" | ||
|
||
namespace motis { | ||
|
||
// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) | ||
std::shared_ptr<opentelemetry::trace::Tracer> motis_tracer; | ||
|
||
} // namespace motis |
34 changes: 34 additions & 0 deletions
34
base/launcher/include/motis/launcher/http_text_map_carrier.h
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 @@ | ||
#pragma once | ||
|
||
#include <type_traits> | ||
|
||
#include "boost/beast/http/fields.hpp" | ||
#include "boost/beast/http/message.hpp" | ||
|
||
#include "opentelemetry/context/propagation/global_propagator.h" | ||
#include "opentelemetry/context/propagation/text_map_propagator.h" | ||
#include "opentelemetry/trace/propagation/http_trace_context.h" | ||
|
||
namespace motis::launcher { | ||
|
||
template <typename T> | ||
struct http_text_map_carrier | ||
: public opentelemetry::context::propagation::TextMapCarrier { | ||
explicit http_text_map_carrier(T& header) : header_{header} {} | ||
|
||
virtual opentelemetry::nostd::string_view Get( | ||
opentelemetry::nostd::string_view key) const noexcept override { | ||
return header_[key]; | ||
} | ||
|
||
virtual void Set(opentelemetry::nostd::string_view key, | ||
opentelemetry::nostd::string_view value) noexcept override { | ||
if constexpr (!std::is_const_v<T>) { | ||
header_.set(key, value); | ||
} | ||
} | ||
|
||
T& header_; | ||
}; | ||
|
||
} // namespace motis::launcher |
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
Oops, something went wrong.