Skip to content
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

datadog: Config (final) portion of new tracing library #26284

Merged

Conversation

dgoffredo
Copy link
Contributor

@dgoffredo dgoffredo commented Mar 22, 2023

This is the final part of the work proposed in #23958.

This PR additionally contains all of the changes from #26148. This diff will shrink when that PR is merged.

This revision alters the DatadogTracerFactory in source/extensions/tracers/datadog/config.h to produce instances of the new dd-trace-cpp based implementation of the Datadog tracer, instead of the old dd-opentracing-cpp based one.

This revision actually alters the implementation of the Datadog tracer. Previous pull requests have only added code for use here.

This revision also moves some unit tests around:

  • Two tests that were part of datadog_tracer_impl_test.cc have been moved into agent_http_client_test.cc, because they're about HTTP requests.
  • One test that was part of datadog_tracer_impl_test.cc has been removed because its behavior is already covered by tests added in other PRs in this series.
  • The remaining tests in datadog_tracer_impl_test_.cc were moved into config_test.cc, since they all now have to do with the configuration of the tracer and the resulting behavior.

Finally, all references to dd-opentracing-cpp and msgpack have been removed from the repo, and the documentation (READMEs) and demo/ directory from #23958 have been added.

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>
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>
….goffredo/dd-trace-cpp-3/9-tracer_stats' of github.com:DataDog/envoy into david.goffredo/dd-trace-cpp-7/9-agent_http_client

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>
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>
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>
This reverts commit 570d9f0.

Signed-off-by: David Goffredo <david.goffredo@datadoghq.com>
@dgoffredo
Copy link
Contributor Author

I'm currently working on modifications to the common/ot code that might resolve this. It will require a little circumvention but will probably come out fine.

[...] AFAICT there is no dependence on this other than datadog, and it is not adequately tested on its own.

Another option which also makes sense to me is to, in this PR, delete the ot directories and their files. That would be more extreme, but it would wake up anyone that cares to re-add this (and contribute tests to unblock that PR).

common/ot is depended upon additionally by dynamic_ot:

"//source/extensions/tracers/common/ot:opentracing_driver_lib",

The relevant feature is documented here: https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/trace/v3/dynamic_ot.proto

It allows a user to bring their own build of an OpenTracing-compatible tracer and dlopen it into Envoy on start.

🤷 If you're willing to remove that feature, then the common/ot code can be removed also.

@wbpcode
Copy link
Member

wbpcode commented Apr 27, 2023

As @wbpcode is an owner of this extension WDYT?

In fact, I have no strong point to this. Because I don't know if there are actual users of common/ot or dynamic_ot. I had never got related feedbacks from community, if my memory is correct.

If the community think we should keep these extensions, I can add some tests to improve the coverage in the next week and unblock this PR (I will have some free time at that time.)

@wbpcode
Copy link
Member

wbpcode commented Apr 27, 2023

I'm currently working on modifications to the common/ot code that might resolve this. It will require a little circumvention but will probably come out fine.

If you can resolve it directly it would great.

…ersReader::ForeachKey

Signed-off-by: David Goffredo <david.goffredo@datadoghq.com>
@dgoffredo
Copy link
Contributor Author

dgoffredo commented Apr 27, 2023

I pushed a commit that covers the following code:

opentracing::expected<void> ForeachKey(OpenTracingCb f) const override {
trace_context_.forEach([cb = std::move(f)](absl::string_view key, absl::string_view val) {
opentracing::string_view opentracing_key{key.data(), key.length()};
opentracing::string_view opentracing_val{val.data(), val.length()};
return static_cast<bool>(cb(opentracing_key, opentracing_val));
});
return {};
}

by adding some new boilerplate to the common/ot unit test: a7bf4fd

The difficulty is that the existing unit test uses opentracing::mocktracer::MockTracer to interact with the driver under test. opentracing::mocktracer::MockTracer will not call the "for each" flavor of header extraction. It's just not in the opentracing-cpp code. opentracing-cpp is deprecated and hasn't been touched in a while, so I don't think modifying that library and cutting a release is a viable option.

Instead, I reproduce a skeleton of an opentracing::Tracer (together with its opentracing::Span and opentracing::SpanContext) that does nothing except call the "for each" flavor when extraction is requested.

@alyssawilk
Copy link
Contributor

sweet! No changes to core code and no changes to coverage so I'll recuse myself and let josh merge.

@alyssawilk alyssawilk removed their assignment Apr 27, 2023
@alyssawilk
Copy link
Contributor

looks like clang-tidy failed though so you may want to clean that up so it' good to merge :-)

Signed-off-by: David Goffredo <david.goffredo@datadoghq.com>
Signed-off-by: David Goffredo <david.goffredo@datadoghq.com>
@dgoffredo
Copy link
Contributor Author

dgoffredo commented Apr 27, 2023

@alyssawilk we are go for launch, stand by for ignition sequence

Copy link
Contributor

@jmarantz jmarantz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alyssawilk has deferred to me. LGTM!

@jmarantz jmarantz dismissed alyssawilk’s stale review April 27, 2023 19:34

all requests are addressed.

@jmarantz jmarantz merged commit 9bae445 into envoyproxy:main Apr 27, 2023
@dgoffredo
Copy link
Contributor Author

🎉🎉🎉🎉🎉🎉🎉🎉

Once again, thank you @jmarantz, @wbpcode, and everyone who contributed to the review of these 10 pull requests.

I learned a lot and am looking forward to collaborating again.

@dgoffredo
Copy link
Contributor Author

dgoffredo commented May 13, 2023

@moderation

This is a Datadog call, however the existing extension is available in the 1.25.x release cycle. The new extension would be in the 1.26x release chain. Seems OK vs. a flag (and then flag maintenance)

I downloaded the zipped source code from the v1.26.1 release, and it does not include the changes in this PR, thus v1.26.1 contains the old extension, not the new one.

Might a subsequent release in the v1.26.x series contain these changes, or will we have to wait for v1.27.x? I'd prefer to have these changes available as soon as possible. The changes were initially proposed in November of 2022.

edit: It looks like we missed the release cutoff by six hours!

@phlax
Copy link
Member

phlax commented May 14, 2023

Might a subsequent release in the v1.26.x series contain these changes

its possible we could backport the changes to 1.26.x, but i think that we should not as that is usually reserved for fixes

the 1.27 release is due for 2023/07/14

@dgoffredo
Copy link
Contributor Author

dgoffredo commented May 15, 2023

I agree that a backport would not be appropriate here. Ok, July it is. Thanks @phlax

reskin89 pushed a commit to reskin89/envoy that referenced this pull request Jul 11, 2023
)

This is the final part of the work proposed in envoyproxy#23958.

This PR additionally contains all of the changes from envoyproxy#26148. This diff will shrink when that PR is merged.

This revision alters the DatadogTracerFactory in source/extensions/tracers/datadog/config.h to produce instances of the new dd-trace-cpp based implementation of the Datadog tracer, instead of the old dd-opentracing-cpp based one.

This revision actually alters the implementation of the Datadog tracer. Previous pull requests have only added code for use here.

This revision also moves some unit tests around:

Two tests that were part of datadog_tracer_impl_test.cc have been moved into agent_http_client_test.cc, because they're about HTTP requests.
One test that was part of datadog_tracer_impl_test.cc has been removed because its behavior is already covered by tests added in other PRs in this series.
The remaining tests in datadog_tracer_impl_test_.cc were moved into config_test.cc, since they all now have to do with the configuration of the tracer and the resulting behavior.
Finally, all references to dd-opentracing-cpp and msgpack have been removed from the repo, and the documentation (READMEs) and demo/ directory from envoyproxy#23958 have been added.

Signed-off-by: David Goffredo <david.goffredo@datadoghq.com>
Signed-off-by: Ryan Eskin <ryan.eskin89@protonmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants