-
Notifications
You must be signed in to change notification settings - Fork 965
semconv stable code #13860
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
base: main
Are you sure you want to change the base?
semconv stable code #13860
Conversation
You really don't need to do this, see #13860 (comment). You can convert tests to use the new assertion and enable the opt-in flag for all tests and run only selected tests with both new and old assertions to reduce the amount of work needed. |
It's not needed to be able to test everything but I would just sleep better if it is :-). For example I found that the logging instrumentation would also benefit from being exhaustively tested like the annotations, if I understand it correctly just adding this to the gradle module file should allow to properly test it.
|
🔧 The result from spotlessApply was committed to the PR branch. |
…nstrumentation into semconv-stable-code
…nstrumentation into semconv-stable-code
🔧 The result from spotlessApply was committed to the PR branch. |
I have updated this PR to only emit the deprecated semantic convention attributes by default. Using Then, we could then later remove the support for the unstable Is there already an issue that contains a list of breaking changes that we are planning to include in this major release to track progress on their respective implementations ? If no, please let me know and I can create one so we don't forget about this (and also the database semconv). |
https://github.com/open-telemetry/opentelemetry-java-instrumentation/milestone/41 |
Thanks, I've opened #14059. @trask your review status is still "requested change", do you think there are still things to change before we could merge this ? |
…nstrumentation into semconv-stable-code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
|
||
// using deprecated semconv |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// using deprecated semconv |
@@ -191,6 +189,13 @@ void shouldHandleAsyncResponse(AsyncResponseTestKind testKind) throws Exception | |||
assertThat(response.status().code()).isEqualTo(testKind.statusCode); | |||
testKind.assertBody(response.contentUtf8()); | |||
|
|||
List<AttributeAssertion> attributeAssertions = | |||
codeFunctionInfixAssertions("test.JaxRsTestResource", "asyncOp"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think?
codeFunctionInfixAssertions("test.JaxRsTestResource", "asyncOp"); | |
codeFunctionSuffixAssertions("test.JaxRsTestResource", "asyncOp"); |
CODE_NAMESPACE, | ||
"io.opentelemetry.instrumentation.jaxrs.v2_0.test.JaxRsTestResource"), | ||
equalTo(CODE_FUNCTION, "jaxRs21Async")); | ||
codeFunctionInfixAssertions(".JaxRsTestResource", "jaxRs21Async")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
codeFunctionInfixAssertions(".JaxRsTestResource", "jaxRs21Async")); | |
codeFunctionSuffixAssertions(".JaxRsTestResource", "jaxRs21Async")); |
@@ -319,7 +315,6 @@ protected SpanDataAssert assertHandlerSpan( | |||
return span.hasName("JaxRsTestResource." + methodName) | |||
.hasKind(SpanKind.INTERNAL) | |||
.hasAttributesSatisfyingExactly( | |||
satisfies(CODE_NAMESPACE, name -> name.endsWith("JaxRsTestResource")), | |||
equalTo(CODE_FUNCTION, methodName)); | |||
codeFunctionInfixAssertions(".JaxRsTestResource", methodName)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
codeFunctionInfixAssertions(".JaxRsTestResource", methodName)); | |
codeFunctionSuffixAssertions(".JaxRsTestResource", methodName)); |
dependsOn(testing.suites) | ||
dependsOn(testStableSemconv) | ||
dependsOn(testBothSemconv) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect we still need dependsOn(testing.suites)
@@ -57,8 +61,7 @@ public void captureSpanForCompletedCompletable() { | |||
.hasKind(SpanKind.INTERNAL) | |||
.hasNoParent() | |||
.hasAttributesSatisfyingExactly( | |||
satisfies(CODE_NAMESPACE, val -> val.endsWith(".TracedWithSpan")), | |||
equalTo(CODE_FUNCTION, "completable")))); | |||
codeFunctionSuffixAssertions("TracedWithSpan", "completable")))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(and other places below, to stay consistent with other places)
codeFunctionSuffixAssertions("TracedWithSpan", "completable")))); | |
codeFunctionSuffixAssertions(".TracedWithSpan", "completable")))); |
v -> | ||
assertThat(v) | ||
.isEqualTo( | ||
"org.springframework.security.web.firewall.FirewalledResponse"), | ||
v -> | ||
assertThat(v) | ||
.isEqualTo("jakarta.servlet.http.HttpServletResponseWrapper"))), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting, just confirming these seem no longer needed?
satisfies(CODE_NAMESPACE, v -> v.endsWith(".BasicErrorController")), | ||
equalTo(CODE_FUNCTION, "error"))); | ||
SemconvCodeStabilityUtil.codeFunctionSuffixAssertions( | ||
"BasicErrorController", "error"))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"BasicErrorController", "error"))); | |
".BasicErrorController", "error"))); |
Semconv 1.33.0 brings stable definitions for
code.*
namespace, which includes the following changes:code.namespace
is removedcode.function
is renamed tocode.function.name
and needs to include fully-qualified name of the class in addition to the functioncode.lineno
has been renamedcode.line.number
code.column
has been renamedcode.column.number
code.filepath
has been renamedcode.file.path
This PR might have to be updated if merged after the update to semconv 1.33.0 is merged first.EDIT: updated after 1.34.0 semconv updateEDIT: the existing
code.*
semantic conventions are still produced, the stable ones are opt-in by setting theotel.semconv-stability.opt-in
config option to includecode
(only stable) orcode/dup
(both stable + old).