elastic / apm-agent-java

https://www.elastic.co/guide/en/apm/agent/java/current/index.html
Apache License 2.0
562 stars 320 forks source link

RUM Javascript injection through the java agent #235

Open WassimDhib opened 5 years ago

WassimDhib commented 5 years ago

Do you have plans to inject RUM Javascript agent in servlet response ?

To override servlet response methods, you wrap the response in an object that extends ServletResponseWrapper or HttpServletResponseWrapper.

felixbarny commented 5 years ago

Hi and thanks for the great question. This is something we have already been thinking about, but as of now, there are no concrete plans or a timeline.

WassimDhib commented 5 years ago

I'm trying to implement this feature on an ongoing project, I would be interested if you have ideas. there are several problems to be solved, namely

hmdhk commented 5 years ago

From the RUM agent side the following snippet needs to be injected to initialise the agent:

<script src="elastic-apm-js-base/dist/bundles/elastic-apm-js-base.umd.min.js"></script>
<script>
  elasticApm.init({
    serviceName: 'service-name',
    serverUrl: 'http://localhost:8200',
  });
  elasticApm.setInitialPageLoadName('page-name');
</script>
WassimDhib commented 3 weeks ago

Hi Any news about this ticket ? I have seen many projets/applications interested by having rum monitoring Bu they dont like the idea of modifiying source code of application

jackshirazi commented 3 weeks ago

Hi, no current plans. There is an otel SIG for this, any support would most likely come from the otel Java agent supporting this and we'll support it through our distribution. But we're unlikely to implement this in our classic agent