-
Notifications
You must be signed in to change notification settings - Fork 423
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
Add SpanContext (and TraceState) to Recordable #667
Add SpanContext (and TraceState) to Recordable #667
Conversation
67b0b80
to
ca5887c
Compare
@@ -12,6 +12,8 @@ | |||
// See the License for the specific language governing permissions and | |||
// limitations under the License. | |||
|
|||
#pragma once |
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.
Initially considered using kv_properties for trace state, during which I hit redeclarations due to this being missing
@@ -110,20 +120,18 @@ class ThreadsafeSpanData final : public opentelemetry::sdk::trace::Recordable | |||
* Get the attributes for this span | |||
* @return the attributes for this span | |||
*/ | |||
const std::unordered_map<std::string, opentelemetry::sdk::common::OwnedAttributeValue> | |||
GetAttributes() const noexcept | |||
std::unordered_map<std::string, opentelemetry::sdk::common::OwnedAttributeValue> GetAttributes() |
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.
if we have to copy for thread safety, the copy doesn't need to be const
void AddEvent(nostd::string_view name, | ||
core::SystemTimestamp timestamp, | ||
const opentelemetry::common::KeyValueIterable &attributes) noexcept override | ||
void AddEvent( |
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.
to make consistent with ThreadsafeSpanData and avoid having to explicitly have to reference .opentelemetry::sdk::trace::Recordable::AddEvent
WIP till I make CI happy |
Codecov Report
@@ Coverage Diff @@
## main #667 +/- ##
==========================================
+ Coverage 94.65% 94.67% +0.02%
==========================================
Files 204 204
Lines 9387 9416 +29
==========================================
+ Hits 8885 8915 +30
+ Misses 502 501 -1
|
- Updated Recordable interface to take a span context and parent span id rather than just the trace/span ids. - Updated SpanData to new interface and added new getters for accessing SpanContext - Updated ThreadsafeSpanData with the same - Updated tests for both (and made consistent) - Updated OStreamSpanExporter to print tracestate and tests
- Added SetIdentity to otlp::Recordable (with tracestate) - Added SetIdentity to Zipkin (without tracestate support) - Fixed minor formatting issue
7126da9
to
b79031a
Compare
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.
LGTM
Fixes #661
Changes
rather than just the trace/span ids.
SpanContext
For significant contributions please make sure you have completed the following items:
CHANGELOG.md
updated for non-trivial changes