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

W3C TraceContext compliance #197

Closed
reyang opened this issue Oct 3, 2019 · 4 comments
Closed

W3C TraceContext compliance #197

reyang opened this issue Oct 3, 2019 · 4 comments
Labels
bug Something isn't working priority:p1 Issues that should be resolved in the upcoming release (except for zero-day hotfix release)
Milestone

Comments

@reyang
Copy link
Member

reyang commented Oct 3, 2019

We have an initial implementation of TraceContext and it has some issues.

The following code would get 30 test failures according to the latest W3C Distributed Tracing Validation Service:

import flask
import json
import requests

from opentelemetry import trace
from opentelemetry.ext import http_requests
from opentelemetry.ext.wsgi import OpenTelemetryMiddleware
from opentelemetry.sdk.trace import Tracer
from opentelemetry.sdk.trace.export import (
    ConsoleSpanExporter,
    SimpleExportSpanProcessor,
)

trace.set_preferred_tracer_implementation(lambda T: Tracer())

http_requests.enable(trace.tracer())
span_processor = SimpleExportSpanProcessor(ConsoleSpanExporter())
trace.tracer().add_span_processor(span_processor)

app = flask.Flask(__name__)
app.wsgi_app = OpenTelemetryMiddleware(app.wsgi_app)

@app.route("/", methods=["POST"])
def hello():
    for action in flask.request.json:
        requests.post(
            url=action["url"],
            data=json.dumps(action["arguments"]),
            headers={
                "Accept": "application/json",
                "Content-Type": "application/json; charset=utf-8",
            },
            timeout=5.0,
        )
    return "hello"

if __name__ == "__main__":
    app.run(debug=True)
    span_processor.shutdown()
@reyang reyang added the bug Something isn't working label Oct 3, 2019
@reyang
Copy link
Member Author

reyang commented Oct 3, 2019

Here goes the validation result:

STRICT_LEVEL: 2
harness listening on http://127.0.0.1:7777
test_multiple_requests_with_illegal_traceparent (__main__.AdvancedTest) ... ERROR
test_multiple_requests_with_valid_traceparent (__main__.AdvancedTest) ... ok
test_multiple_requests_without_traceparent (__main__.AdvancedTest) ... ERROR
test_both_traceparent_and_tracestate_missing (__main__.TraceContextTest) ... ERROR
test_traceparent_duplicated (__main__.TraceContextTest) ... ERROR
test_traceparent_header_name (__main__.TraceContextTest) ... ERROR
test_traceparent_header_name_valid_casing (__main__.TraceContextTest) ... ok
test_traceparent_included_tracestate_missing (__main__.TraceContextTest) ... ok
test_traceparent_ows_handling (__main__.TraceContextTest) ... ok
test_traceparent_parent_id_all_zero (__main__.TraceContextTest) ... ERROR
test_traceparent_parent_id_illegal_characters (__main__.TraceContextTest) ... ERROR
test_traceparent_parent_id_too_long (__main__.TraceContextTest) ... ERROR
test_traceparent_parent_id_too_short (__main__.TraceContextTest) ... ERROR
test_traceparent_trace_flags_illegal_characters (__main__.TraceContextTest) ... ERROR
test_traceparent_trace_flags_too_long (__main__.TraceContextTest) ... ERROR
test_traceparent_trace_flags_too_short (__main__.TraceContextTest) ... ERROR
test_traceparent_trace_id_all_zero (__main__.TraceContextTest) ... ERROR
test_traceparent_trace_id_illegal_characters (__main__.TraceContextTest) ... ERROR
test_traceparent_trace_id_too_long (__main__.TraceContextTest) ... ERROR
test_traceparent_trace_id_too_short (__main__.TraceContextTest) ... ERROR
test_traceparent_version_0x00 (__main__.TraceContextTest) ... ERROR
test_traceparent_version_0xcc (__main__.TraceContextTest) ... ERROR
test_traceparent_version_0xff (__main__.TraceContextTest) ... ERROR
test_traceparent_version_illegal_characters (__main__.TraceContextTest) ... ERROR
test_traceparent_version_too_long (__main__.TraceContextTest) ... ERROR
test_traceparent_version_too_short (__main__.TraceContextTest) ... ERROR
test_tracestate_all_allowed_characters (__main__.TraceContextTest) ... ok
test_tracestate_duplicated_keys (__main__.TraceContextTest) ... FAIL
test_tracestate_empty_header (__main__.TraceContextTest) ... FAIL
test_tracestate_header_name (__main__.TraceContextTest) ... ok
test_tracestate_header_name_valid_casing (__main__.TraceContextTest) ... ok
test_tracestate_included_traceparent_included (__main__.TraceContextTest) ... ok
test_tracestate_included_traceparent_missing (__main__.TraceContextTest) ... ERROR
test_tracestate_key_illegal_characters (__main__.TraceContextTest) ... FAIL
test_tracestate_key_illegal_vendor_format (__main__.TraceContextTest) ... FAIL
test_tracestate_key_length_limit (__main__.TraceContextTest) ... FAIL
test_tracestate_member_count_limit (__main__.TraceContextTest) ... FAIL
test_tracestate_multiple_headers_different_keys (__main__.TraceContextTest) ... ok
test_tracestate_ows_handling (__main__.TraceContextTest) ... ok
test_tracestate_value_illegal_characters (__main__.TraceContextTest) ... FAIL

@reyang reyang added the priority:p1 Issues that should be resolved in the upcoming release (except for zero-day hotfix release) label Oct 3, 2019
@reyang reyang added this to the Beta Release milestone Oct 3, 2019
@mauriciovasquezbernal
Copy link
Member

Related: #202

@c24t
Copy link
Member

c24t commented Oct 29, 2019

@toumorokoshi, @reyang, this is fixed by #228 right?

@reyang
Copy link
Member Author

reyang commented Oct 30, 2019

Yep!

@reyang reyang closed this as completed Oct 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority:p1 Issues that should be resolved in the upcoming release (except for zero-day hotfix release)
Projects
None yet
Development

No branches or pull requests

3 participants