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

Add a test service for the W3C validation harness #487

Merged
merged 23 commits into from
Jan 21, 2021

Conversation

pyohannes
Copy link
Contributor

This example program is intended to be used as a test service for the W3C Distributed Tracing Validation Service. It is implemented according to this instructions.

With the current state of our implementation, 26 out of 40 tests pass. Most failures are related to tracestate propagation, which we currently do not support at all.

This program makes use of nlohmann::json and our internally provided HTTP client and server implementations.

@pyohannes pyohannes requested a review from a team December 23, 2020 23:22
@@ -6,3 +6,4 @@ add_subdirectory(simple)
add_subdirectory(batch)
add_subdirectory(metrics_simple)
add_subdirectory(multithreaded)
add_subdirectory(w3c_tracecontext_test)
Copy link
Contributor

Choose a reason for hiding this comment

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

Put w3c_tracecontext_test into some test folder instead of under examples?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

@lalitb lalitb Dec 24, 2020

Choose a reason for hiding this comment

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

Yes, docker image or script to run both the services and give result would be handy ( as part of separate PR )

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is moved now into ext, signaling that this is not a central component or test that has to run with the core test suite.

@codecov
Copy link

codecov bot commented Dec 23, 2020

Codecov Report

Merging #487 (4cade93) into master (a9ca938) will increase coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #487      +/-   ##
==========================================
+ Coverage   94.46%   94.48%   +0.01%     
==========================================
  Files         189      189              
  Lines        8388     8388              
==========================================
+ Hits         7924     7925       +1     
+ Misses        464      463       -1     
Impacted Files Coverage Δ
sdk/test/metrics/counter_aggregator_test.cc 100.00% <0.00%> (+1.78%) ⬆️

Copy link
Member

@lalitb lalitb left a comment

Choose a reason for hiding this comment

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

LGTM once CI checks are fixed. . Thanks for this adding validation code.

Most failures are related to tracestate propagation, which we currently do not support at all.

Should we be creating a ticket for this ?

port = std::stoi(uri.substr(7 + host_end + 1, port_end));
path = uri.substr(host_end + port_end + 2, std::string::npos);
}
};
Copy link
Member

Choose a reason for hiding this comment

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

jfi - i added a url_parser.h header to parse the url as part of zipkin exporter PR ( https://github.com/open-telemetry/opentelemetry-cpp/pull/471/files )

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd love to use that once it's merged.

#include "opentelemetry/trace/scope.h"

#include <algorithm>
#include "nlohmann/json.hpp"
Copy link
Contributor

Choose a reason for hiding this comment

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

Where / how do you install nlohmann/json.hpp for non-Windows OS?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This relies on the nlohmann-json packages installed by our CI tools.

@pyohannes pyohannes force-pushed the w3c-trace-context-test branch from e2c6bd2 to b20f7e1 Compare January 5, 2021 02:16
@pyohannes
Copy link
Contributor Author

This should be ready for another review and hopefully merge, all the CI tests are passing.

@pyohannes pyohannes added the pr:please-merge This PR is ready to be merged by a Maintainer (rebased, CI passed, has enough valid approvals, etc.) label Jan 21, 2021
@lalitb lalitb merged commit 4a13db9 into open-telemetry:master Jan 21, 2021
@pyohannes pyohannes linked an issue Jan 21, 2021 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:please-merge This PR is ready to be merged by a Maintainer (rebased, CI passed, has enough valid approvals, etc.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

W3C TraceContext compliance
4 participants