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
TCK RestClientSpanTest Span Name Doesn't Follow Semantic Conv #86
Comments
To expand what @arieki is referring to: MP Tracing spec says:
The word "should" indicate optional requirement. If we take it one step further, Semantic conventions for HTTP spans also use word "should" to describe the requirement. If the spec would say, that compatible implementation MUST follow recommendations given for http span names set forth by conventions, then checking for those span names would be reasonable. However, in that case, the span names that are validated now are not the ones set forth by convention:
Test expect client spans to be called |
This issue lists several problems that I'd like to address individually:
This is true for the current version of the OpenTelemetry specification, but MicroProfile Telemetry 1.0 is based on v1.13.0 of OpenTelemetry and this section of the spec has changed since then. The relevant part in 1.13 doesn't suggest including the HTTP method in the name.
The section of the spec talks about using the full URI path vs. using a more concise HTTP route. The example given is However, in the TCK test you quote the URI path has no placeholders, so the URI path and the HTTP route are the same. The TCK is expecting the HTTP route, and in this case it just happens to be the same as the full URI path. In a later test a URI with a placeholder is used and you can see the test expects the placeholder to be used in the span name, rather than using the full URI path for the request. Assert.assertEquals(server.getName(), (url.getPath() + "span/{name}"));
I think you are correct here. The spec suggests but doesn't mandate that a particular name is used so the TCK should not test it. I think the existing asserts for span names should be removed, though we could check to ensure that the name does not include the full URI path for the cases where the HTTP route includes placeholders. |
@pdudits will take a look at this. |
@pdudits will create a PR to cover this. |
… conventions 1.19 * Specific values of span name is not checked, rather absence of high-cardinality parts of requests * `net.host.name` and `net.host.port` are required for server Rest spans * `http.route` is required for server Rest spans * `net.peer.name` and `net.peer.host` are required for client Rest spans * error status of span is required for certain 4xx and 5xx requests Fixes eclipse#86, eclipse#44 Signed-off-by: Patrik Dudits <patrik.dudits@payara.fish>
… conventions 1.19 * Specific values of span name is not checked, rather absence of high-cardinality parts of requests * `net.host.name` and `net.host.port` are required for server Rest spans * `http.route` is required for server Rest spans * `net.peer.name` and `net.peer.host` are required for client Rest spans * error status of span is required for certain 4xx and 5xx requests Fixes eclipse#86, eclipse#44 Signed-off-by: Patrik Dudits <patrik.dudits@payara.fish>
… conventions 1.19 * Specific values of span name is not checked, rather absence of high-cardinality parts of requests * `net.host.name` and `net.host.port` are required for server Rest spans * `http.route` is required for server Rest spans * `net.peer.name` and `net.peer.host` are required for client Rest spans * error status of span is required for certain 4xx and 5xx requests Fixes eclipse#86, eclipse#44 Signed-off-by: Patrik Dudits <patrik.dudits@payara.fish>
… conventions 1.19 (#95) * Specific values of span name is not checked, rather absence of high-cardinality parts of requests * `net.host.name` and `net.host.port` are required for server Rest spans * `http.route` is required for server Rest spans * `net.peer.name` and `net.peer.host` are required for client Rest spans * error status of span is required for certain 4xx and 5xx requests Fixes #86, #44 Signed-off-by: Patrik Dudits <patrik.dudits@payara.fish>
… conventions 1.19 * Specific values of span name is not checked, rather absence of high-cardinality parts of requests * `net.host.name` and `net.host.port` are required for server Rest spans * `http.route` is required for server Rest spans * `net.peer.name` and `net.peer.host` are required for client Rest spans * error status of span is required for certain 4xx and 5xx requests Fixes eclipse#86, eclipse#44 Signed-off-by: Patrik Dudits <patrik.dudits@payara.fish>
Description
Based on OpenTelemetry Semantic conventions for HTTP spans "Instrumentation MUST NOT default to using URI path as span name, but MAY provide hooks to allow custom logic to override the default span name."
Meanwhile, I found in the TCK use URI path as the span name
Assert.assertEquals(server.getName(), url.getPath() + "span");
As the guideline span name described "an RPC method name, a function name, or the name of a subtask or stage within a larger computation" is a good example
The text was updated successfully, but these errors were encountered: