Skip to content
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

Not possible to register WebApp name/key properly when using WebRequestTrackingFilter in Spring boot #359

Closed
gdahlin opened this issue Jan 30, 2017 · 5 comments
Assignees
Labels
Milestone

Comments

@gdahlin
Copy link

gdahlin commented Jan 30, 2017

Hi,

When using the WebRequestTrackingFilter with a Spring boot application on the root context path the filter cannot register the web app name/key properly:

AI: ERROR 30-01-2017 12:15, 22: WebApp name is not found, unable to register WebApp
AI: INFO 30-01-2017 12:15, 22: Successfully registered the filter 'ApplicationInsightsWebFilter

This seem to be due to dependencies to either having a (non-root) servlet context path set for the app or that the app is found under a class-loading path containing "WEB-INF", which is not the case for this Spring boot app.

Would be good if the initialisation config could read either the spring boot app name or to have some external configuration value to set for the web app name/key.

Thanks in advance

@tomaszglinski
Copy link

I managed to fix that by implementing wrappers for WebRequestTrackingFilter, FilterContext and ServletContext classes, but that was a dirty hack...
Strange that such parameter has not been added from the very beginning...

@ericis
Copy link

ericis commented Apr 19, 2017

Yes, I'm getting the same error. It's not an enhancement IMO. Seems like a bug (e.g. if I used a modern .NET app and AppInsights failed to register, it'd probably be assumed to be a bug)

@beckylino beckylino added Bug and removed Enhancement labels Jun 5, 2017
@beckylino beckylino modified the milestones: 1.0.9, 1.0.10 Jun 15, 2017
@beckylino beckylino modified the milestones: 1.0.11, 1.0.10 Sep 13, 2017
@twsouthwick
Copy link
Member

@tomaszglinski What was the work around that you did?

@tomaszglinski
Copy link

@twsouthwick I think I extended the mentioned classes to pass required parameter. Cannot say exactly, cause I removed that (I was only playing, I resigned from App insights because of those troubles)

@dhaval24
Copy link
Contributor

dhaval24 commented Dec 6, 2017

fixed in #449 with a public constructor to register the name of spring boot application. Later we will take the approach of #461 for better SpringBoot Integration.

@dhaval24 dhaval24 closed this as completed Dec 6, 2017
@dhaval24 dhaval24 modified the milestones: 1.0.11, 2.0.0 Dec 27, 2017
@ghost ghost locked as resolved and limited conversation to collaborators Jul 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

7 participants