Skip to content

Commit 8b61de1

Browse files
authored
fix corner case in storing span tag (#82)
1 parent 9d14df6 commit 8b61de1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

cpp2sky/tracing_context.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ class TracingSpan {
8888
/**
8989
* Get tags.
9090
*/
91-
virtual const std::vector<std::pair<std::string_view, std::string_view>>&
92-
tags() const = 0;
91+
virtual const std::vector<std::pair<std::string, std::string>>& tags()
92+
const = 0;
9393

9494
/**
9595
* Get logs.

source/tracing_context_impl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class TracingSpanImpl : public TracingSpan {
3939
bool errorStatus() const override { return is_error_; }
4040
bool skipAnalysis() const override { return skip_analysis_; }
4141
int32_t componentId() const override { return component_id_; }
42-
const std::vector<std::pair<std::string_view, std::string_view>>& tags()
42+
const std::vector<std::pair<std::string, std::string>>& tags()
4343
const override {
4444
return tags_;
4545
}
@@ -102,7 +102,7 @@ class TracingSpanImpl : public TracingSpan {
102102
// https://github.com/apache/skywalking/blob/master/docs/en/guides/Component-library-settings.md
103103
int32_t component_id_ = 9000;
104104
bool is_error_ = false;
105-
std::vector<std::pair<std::string_view, std::string_view>> tags_;
105+
std::vector<std::pair<std::string, std::string>> tags_;
106106
std::vector<skywalking::v3::Log> logs_;
107107
bool skip_analysis_ = false;
108108
bool finished_ = false;

0 commit comments

Comments
 (0)