-
Notifications
You must be signed in to change notification settings - Fork 33
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
Collect WebLogic specific attributes #81
Conversation
...tion/weblogic/src/main/java/com/splunk/opentelemetry/middleware/weblogic/WebLogicEntity.java
Show resolved
Hide resolved
@@ -54,15 +57,29 @@ public void webLogicSmokeTest(String imageName) throws IOException, InterruptedE | |||
// FIXME: APMI-1300 | |||
// assertServerHandler(....) |
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.
You can replace this FIXME with just a comment, that there aren't any server handlers for weblogic because of APMI-1300.
...tion/weblogic/src/main/java/com/splunk/opentelemetry/middleware/weblogic/WebLogicEntity.java
Show resolved
Hide resolved
WebLogicEntity.Request request = WebLogicEntity.Request.wrap(servletRequest); | ||
|
||
Map<?, ?> attributes = fetchMiddlewareAttributes(request.getContext()); | ||
request.instance.setAttribute(REQUEST_ATTRIBUTE_NAME, attributes); |
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.
Just wondering: have you considered adding a field to MiddlewareHolder
and storing those attributes there instead of the request?
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.
The server and application fields may have different values in a single JVM, so the current static field approach MiddlewareHolder
would not work there.
9daec75
to
4cf1a60
Compare
This adds collection of WebLogic-specific attributes to servlet spans, and also provides middleware name and version through
MiddlewareHolder
.Sample output from the logging collector:
No spans are created at WebLogic instrumentation level (no custom logic required), so this adds an instrumentation that only collects the attribute values, stores them as a map into
otel.middleware
ServletRequest attribute. The map contents are copied over to the span in another instrumentation where the servlet span is currently active.WebLogic classes are not published as a public dependency, therefore its classes are accessed with
Class.forName
andMethodHandle
instead of compiling against its classes directly. These are resolved byWebLogicEntity
during its static initialization, which also provides wrapper classes for WebLogic classes. As an optimization, the full set of attributes is not collected on every request, but they are cached to a servlet context attribute.