datadog: span portion of new tracing library#25121
Conversation
Signed-off-by: David Goffredo <david.goffredo@datadoghq.com>
Signed-off-by: David Goffredo <david.goffredo@datadoghq.com>
Signed-off-by: David Goffredo <david.goffredo@datadoghq.com>
Signed-off-by: David Goffredo <david.goffredo@datadoghq.com>
Signed-off-by: David Goffredo <david.goffredo@datadoghq.com>
Signed-off-by: David Goffredo <david.goffredo@datadoghq.com>
Signed-off-by: David Goffredo <david.goffredo@datadoghq.com>
…Span Signed-off-by: David Goffredo <david.goffredo@datadoghq.com>
Signed-off-by: David Goffredo <david.goffredo@datadoghq.com>
|
CC @envoyproxy/dependency-shepherds: Your approval is needed for changes made to |
|
/assign @jmarantz |
|
/lgtm deps |
Signed-off-by: David Goffredo <david.goffredo@datadoghq.com>
I guess I'll use |
Signed-off-by: David Goffredo <david.goffredo@datadoghq.com>
Signed-off-by: David Goffredo <david.goffredo@datadoghq.com>
jmarantz
left a comment
There was a problem hiding this comment.
This looks great; really nicely tested. Just a few nits.
I think @moderation should look at this also for span semantics.
| SystemTime start_time) { | ||
| if (!span_) { | ||
| // I don't expect this to happen. This means that `spawnChild` was called | ||
| // after `finishSpan`. |
There was a problem hiding this comment.
should we use an ENVOY_BUG here (logs a message in production build, asserts in debug/default builds)?
There was a problem hiding this comment.
That might be worth doing.
I'd reserve assert and friends for cases where the detected behavior is in violation of the component's contract. Because this Span has the escape hatch of going into "null-mode," it's not necessary. By that reasoning, perhaps the code comment is not necessary either.
You mentioned the idea of @moderation looking over the behavior of this Span. Maybe they can decide whether "spawn-after-finish" ought to be considered forbidden in these tracing implementations.
Signed-off-by: David Goffredo <david.goffredo@datadoghq.com>
|
Please merge main and resolve the conflict first. Thanks. |
wbpcode
left a comment
There was a problem hiding this comment.
LGTM overall. It's great. Only some minor comments.
Signed-off-by: David Goffredo <david.goffredo@datadoghq.com>
|
#24826 |
Signed-off-by: David Goffredo <david.goffredo@datadoghq.com>
Signed-off-by: David Goffredo <david.goffredo@datadoghq.com>
That's a new one. I suppose instead of this: const Tracing::SpanPtr child =
span.spawnChild(Tracing::MockConfig{}, "child", time_.timeSystem().systemTime());
EXPECT_NE(nullptr, child);
EXPECT_EQ(typeid(Tracing::NullSpan), typeid(*child));it wants this: const Tracing::SpanPtr child =
span.spawnChild(Tracing::MockConfig{}, "child", time_.timeSystem().systemTime());
EXPECT_NE(nullptr, child);
Tracing::Span& child_span = *child;
EXPECT_EQ(typeid(Tracing::NullSpan), typeid(child_span));I'll make that change and see if it helps. |
Signed-off-by: David Goffredo <david.goffredo@datadoghq.com>
|
@moderation I've lgtm'd can you look this over and merge if you are good with it? |
| if (!span_) { | ||
| return std::string{}; | ||
| } | ||
| return absl::StrCat(absl::Hex(span_->id())); |
This is part of the initiative described in #23958.
This revision introduces a new library dependency for Datadog tracing, and adds a component that will be used in the future when more of the new library is integrated into the Datadog tracing extension.
This revision also contains all of the changes from #25003, on which it depends. When that PR is merged, the diff of this PR will shrink.