-
Notifications
You must be signed in to change notification settings - Fork 559
Add Recordable implementation for otprotocol exporter #49
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
Merged
Merged
Changes from all commits
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
3503d72
Start Recorder api
rnburn 79b4f1d
Fill out Span api
rnburn 8bcff6e
Reformat
rnburn c5e9a9e
Fill out Tracer class
rnburn a69206f
Add cmake build
rnburn 87170e3
Add commenting
rnburn 4c7d2c0
Merge branch 'master' of https://github.com/open-telemetry/openteleme…
rnburn 320add0
Fix formatting
rnburn 1a3761e
Reformat
rnburn 597f0f3
Fix date
rnburn 0d8649f
Make mutex mutable
rnburn c15286e
s/mutex_/mu_/
rnburn 3c6fbb0
Remove AddEvent with steady timestamp
rnburn b0d1548
Fix typo
rnburn 6210da0
Fill in IsRecordable
rnburn c619e2b
Set up protobuf dependency
rnburn 84d5ccd
Install protobuf in docker image
rnburn 23c23b6
Merge branch 'recorder-interface' into otprotocol
rnburn eecc683
Merge in Recordable
rnburn 414957f
Add exporter folder
rnburn c8fc557
Integrate protobuf files into build
rnburn b98eb9d
Add otprotocol Recordable
rnburn d2e2198
Set up protobuf with bazel
rnburn f470dd0
Reformat
rnburn 51f9182
Install git in CI
rnburn d240118
Add otprotocol to cmake test
rnburn 427314a
Fix typo
rnburn 5f5050c
Fix install_protobuf.sh
rnburn 092bd8d
Fix install_protobuf.sh
rnburn a979b8e
Fix install_protobuf.sh
rnburn fda73fe
Fix do_ci.sh
rnburn 366e9e0
Add otprotocol windows tests
rnburn 9094a52
Fix typo
rnburn b3d611b
Make protobuf install optional for windows
rnburn 3b94521
Fix install_windows_protobuf.ps1
rnburn 04284e0
Merge branch 'master' of https://github.com/open-telemetry/openteleme…
rnburn 27e8526
Remove unnecessary globs
rnburn 1fbb06e
Refactor
rnburn 2f3296c
Rearrange protobuf files
rnburn 49c27fe
Clean up workspace
rnburn 28c8e5b
Fix formatting
rnburn f16dd46
Merge branch 'master' of https://github.com/open-telemetry/openteleme…
rnburn 6f5316c
Update CI
rnburn 2db1682
Merge branch 'master' of https://github.com/open-telemetry/openteleme…
rnburn 1d83819
Restructure
rnburn f64c826
Reformat
rnburn 49c375f
Refactor legacy test
rnburn ab62b01
Fix legacy target
rnburn 336d466
Fix legacy target
rnburn 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,60 @@ | ||
| # Copyright 2020, OpenTelemetry 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(default_visibility = ["//visibility:public"]) | ||
|
|
||
| load("@rules_proto//proto:defs.bzl", "proto_library") | ||
|
|
||
| proto_library( | ||
| name = "common_proto", | ||
| srcs = [ | ||
| "opentelemetry/proto/common/v1/common.proto", | ||
| ], | ||
| ) | ||
|
|
||
| cc_proto_library( | ||
| name = "common_proto_cc", | ||
| deps = [":common_proto"], | ||
| ) | ||
|
|
||
| proto_library( | ||
| name = "resource_proto", | ||
| srcs = [ | ||
| "opentelemetry/proto/resource/v1/resource.proto", | ||
| ], | ||
| deps = [ | ||
| ":common_proto", | ||
| ], | ||
| ) | ||
|
|
||
| cc_proto_library( | ||
| name = "resource_proto_cc", | ||
| deps = [":resource_proto"], | ||
| ) | ||
|
|
||
| proto_library( | ||
| name = "trace_proto", | ||
| srcs = [ | ||
| "opentelemetry/proto/trace/v1/trace.proto", | ||
| ], | ||
| deps = [ | ||
| ":common_proto", | ||
| ":resource_proto", | ||
| ], | ||
| ) | ||
|
|
||
| cc_proto_library( | ||
| name = "trace_proto_cc", | ||
| deps = [":trace_proto"], | ||
| ) | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,13 @@ | ||
| #!/bin/bash | ||
|
|
||
| set -e | ||
|
|
||
| [ -z "${PROTOBUF_VERSION}" ] && export PROTOBUF_VERSION="3.11.4" | ||
|
|
||
| cd / | ||
| wget https://github.com/google/protobuf/releases/download/v${PROTOBUF_VERSION}/protobuf-cpp-${PROTOBUF_VERSION}.tar.gz | ||
|
g-easy marked this conversation as resolved.
|
||
| tar zxf protobuf-cpp-${PROTOBUF_VERSION}.tar.gz --no-same-owner | ||
| cd protobuf-${PROTOBUF_VERSION} | ||
| ./configure | ||
| make && make install | ||
| ldconfig | ||
This file contains hidden or 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,5 @@ | ||
| $ErrorActionPreference = "Stop" | ||
| trap { $host.SetShouldExit(1) } | ||
|
|
||
| cd vcpkg | ||
| ./vcpkg install protobuf:x64-windows |
This file contains hidden or 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 hidden or 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,3 @@ | ||
| if(WITH_OTPROTOCOL) | ||
| add_subdirectory(otlp) | ||
| endif() |
This file contains hidden or 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,30 @@ | ||
| # Copyright 2020, OpenTelemetry 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(default_visibility = ["//visibility:public"]) | ||
|
|
||
| cc_library( | ||
| name = "recordable", | ||
| srcs = [ | ||
| "recordable.cc", | ||
| ], | ||
| hdrs = [ | ||
| "recordable.h", | ||
| ], | ||
| include_prefix = "exporters/otlp", | ||
| deps = [ | ||
| "//sdk/src/trace", | ||
| "@com_github_opentelemetry_proto//:trace_proto_cc", | ||
| ], | ||
| ) |
This file contains hidden or 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,3 @@ | ||
| add_library(opentelemetry_exporter_otprotocol recordable.cc) | ||
| target_link_libraries(opentelemetry_exporter_otprotocol | ||
| $<TARGET_OBJECTS:opentelemetry_proto>) |
This file contains hidden or 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,25 @@ | ||
| #include "exporters/otlp/recordable.h" | ||
|
|
||
| OPENTELEMETRY_BEGIN_NAMESPACE | ||
| namespace exporter | ||
| { | ||
| namespace otlp | ||
| { | ||
| void Recordable::AddEvent(nostd::string_view name, core::SystemTimestamp timestamp) noexcept | ||
| { | ||
| (void)name; | ||
| } | ||
|
|
||
| void Recordable::SetStatus(trace::CanonicalCode code, nostd::string_view description) noexcept | ||
| { | ||
| (void)code; | ||
| (void)description; | ||
| } | ||
|
|
||
| void Recordable::SetName(nostd::string_view name) noexcept | ||
| { | ||
| span_.set_name(name.data(), name.size()); | ||
| } | ||
| } // namespace otlp | ||
| } // namespace exporter | ||
| OPENTELEMETRY_END_NAMESPACE |
This file contains hidden or 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,29 @@ | ||
| #pragma once | ||
|
|
||
| #include "opentelemetry/proto/trace/v1/trace.pb.h" | ||
| #include "opentelemetry/sdk/trace/recordable.h" | ||
| #include "opentelemetry/version.h" | ||
|
|
||
| OPENTELEMETRY_BEGIN_NAMESPACE | ||
| namespace exporter | ||
| { | ||
| namespace otlp | ||
| { | ||
| class Recordable final : public sdk::trace::Recordable | ||
| { | ||
| public: | ||
| const proto::trace::v1::Span &span() const noexcept { return span_; } | ||
|
|
||
| // sdk::trace::Recordable | ||
| void AddEvent(nostd::string_view name, core::SystemTimestamp timestamp) noexcept override; | ||
|
|
||
| void SetStatus(trace::CanonicalCode code, nostd::string_view description) noexcept override; | ||
|
|
||
| void SetName(nostd::string_view name) noexcept override; | ||
|
|
||
| private: | ||
| proto::trace::v1::Span span_; | ||
| }; | ||
| } // namespace otlp | ||
| } // namespace exporter | ||
| OPENTELEMETRY_END_NAMESPACE |
This file contains hidden or 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 hidden or 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 hidden or 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.
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.
Uh oh!
There was an error while loading. Please reload this page.