-
Notifications
You must be signed in to change notification settings - Fork 1k
Disable JSP compile spans by default #15261
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
Changes from all commits
069a885
6ee9f31
3833bbd
747c6ac
e76c3d0
111aac3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6859,12 +6859,45 @@ libraries: | |
| attributes: [] | ||
| jsp: | ||
| - name: jsp-2.3 | ||
| display_name: JSP (JavaServer Pages) | ||
| description: | | ||
| This instrumentation enables view spans for JSP page rendering and compilation (view spans are disabled by default). | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @trask the jsp compile spans are enabled by default. Should we disable them?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
| library_link: https://jakarta.ee/specifications/pages/ | ||
| features: | ||
| - VIEW_SPANS | ||
| source_path: instrumentation/jsp-2.3 | ||
| scope: | ||
| name: io.opentelemetry.jsp-2.3 | ||
| target_versions: | ||
| javaagent: | ||
| - org.apache.tomcat:tomcat-jasper:[7.0.19,10) | ||
| configurations: | ||
| - name: otel.instrumentation.common.experimental.view-telemetry.enabled | ||
| description: Enables the creation of experimental view spans. | ||
| type: boolean | ||
| default: false | ||
| - name: otel.instrumentation.jsp.experimental-span-attributes | ||
| description: | | ||
| Enables experimental span attributes `jsp.forwardOrigin`, `jsp.requestURL`, `jsp.compiler`, and `jsp.classFQCN`. | ||
| type: boolean | ||
| default: false | ||
| telemetry: | ||
| - when: otel.instrumentation.common.experimental.view-telemetry.enabled=true | ||
| spans: | ||
| - span_kind: INTERNAL | ||
| attributes: [] | ||
| - when: otel.instrumentation.common.experimental.view-telemetry.enabled=true,otel.instrumentation.jsp.experimental-span-attributes=true | ||
| spans: | ||
| - span_kind: INTERNAL | ||
| attributes: | ||
| - name: jsp.classFQCN | ||
| type: STRING | ||
| - name: jsp.compiler | ||
| type: STRING | ||
| - name: jsp.forwardOrigin | ||
| type: STRING | ||
| - name: jsp.requestURL | ||
| type: STRING | ||
| kafka: | ||
| - name: kafka-clients-0.11 | ||
| display_name: Apache Kafka Client | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,6 +12,7 @@ | |
| import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter; | ||
| import io.opentelemetry.instrumentation.api.instrumenter.SpanKindExtractor; | ||
| import io.opentelemetry.javaagent.bootstrap.internal.AgentInstrumentationConfig; | ||
| import io.opentelemetry.javaagent.bootstrap.internal.ExperimentalConfig; | ||
| import javax.annotation.Nullable; | ||
| import org.apache.jasper.JspCompilationContext; | ||
| import org.apache.jasper.compiler.Compiler; | ||
|
|
@@ -30,6 +31,7 @@ public class JspCompilationContextInstrumentationSingletons { | |
| "io.opentelemetry.jsp-2.3", | ||
| JspCompilationContextInstrumentationSingletons::spanNameOnCompile) | ||
| .addAttributesExtractor(new CompilationAttributesExtractor()) | ||
| .setEnabled(ExperimentalConfig.get().viewTelemetryEnabled()) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. view telemetry flag is usually used for view rendering but I think this is fine too |
||
| .buildInstrumenter(SpanKindExtractor.alwaysInternal()); | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| display_name: JSP (JavaServer Pages) | ||
| description: > | ||
| This instrumentation enables view spans for JSP page rendering and compilation (view spans are | ||
| disabled by default). | ||
| features: | ||
| - VIEW_SPANS | ||
| library_link: https://jakarta.ee/specifications/pages/ | ||
| configurations: | ||
| - name: otel.instrumentation.common.experimental.view-telemetry.enabled | ||
| description: Enables the creation of experimental view spans. | ||
| type: boolean | ||
| default: false | ||
| - name: otel.instrumentation.jsp.experimental-span-attributes | ||
| description: > | ||
| Enables experimental span attributes `jsp.forwardOrigin`, `jsp.requestURL`, `jsp.compiler`, | ||
| and `jsp.classFQCN`. | ||
| type: boolean | ||
| default: false |
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.
Actually the instrumentation name is a bit misleading. It really applies only to jasper, which is the jsp engine used by tomcat and all (except liberty?) open source app servers. Weblogic and websphere have their own jsp engines. The view rendering part should work for all jsp engines, but the compilation part will probably make muzzle reject the instrumentation for non-jasper implementations. This is just a FYI.
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.
😅