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

JMX and logging section doesn't show up #72

Closed
MichaelF25 opened this issue May 11, 2015 · 17 comments
Closed

JMX and logging section doesn't show up #72

MichaelF25 opened this issue May 11, 2015 · 17 comments

Comments

@MichaelF25
Copy link

Created a standalone spring-boot-admin-server application including spring-boot-admin-server-ui.
In my already existing spring boot application I've added spring-boot-admin-client and spring-boot-starter-actuator. Furthermore I've added following properties in my already existing application:

info.build.artifact
info.build.name
info.build.description
info.version
spring.application.name
logging.file

In my new spring-boot-admin-server application the dashboard contains one entry for my already existing app but the entry is missing the respective information in the 'version' and 'info' columns. Additionally the logfile download does not work (button is disabled). The /logfile endpoint in my already existing spring boot application works as expected.

@joshiste
Copy link
Collaborator

Did you have a look at the endpoints via browser? Is the information provided there?

@MichaelF25
Copy link
Author

The application itself is secured but the /info, /logfile and /health endpoints are not and the missing information is also provided there.
I am using spring boot 1.2.2 for both the admin-server application and my application

@MichaelF25
Copy link
Author

Resolved an internal issue with my local vagrant setup which caused invalid hostnames :-(

Now I can download the log file, see the version number and proper health information.
However, the 'info' column is still empty if I set only the info property in my application. If I set for example the info.description property, the 'info' column contains the text 'description: .....'.

What property has to be set in order to provide proper content for the 'info' column?

Another issue is logging. The list in Details -> Logging is always empty. I've tried to set some additional logging.level properties in my monitored application but that did not change anything.

@joshiste
Copy link
Collaborator

The way you described the info column to work is the intended one.

The logging view only works if you are using logback and is relying on jmx access via jolokia...
(does the jmx view work?)

@josetesan
Copy link

Hi johannes,
I'm in the same situation as MichaelF25.
I can download logfile, see info, see metrics, but no jmx and no logging level customization works.

Currently using SpringBoot 1.2.3.RELEASE , and BootAdmin 1.2.0.

And yes, i'm using logback, with a working logback.xml file.

See my app log

2015-05-14 16:22:59,469 INFO o.s.j.e.MBeanExporter | Registering beans for JMX exposure on startup
2015-05-14 16:22:59,481 INFO o.s.j.e.MBeanExporter | Located managed bean 'requestMappingEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=requestMappingEndpoint]
2015-05-14 16:22:59,503 INFO o.s.j.e.MBeanExporter | Located managed bean 'environmentEndpoint': registering with JMX server as MBean [org.springframework.boot:type=Endpoint,name=environmentEndpoint]
2015-05-14 16:22:59,507 INFO o.s.j.e.MBeanExporter | Located managed bean 'healthEndpoint': registering with JMX server as MBean

and when i do curl http://my-app/jolokia
i do get

{"request":{"type":"version"},"value":{"agent":"1.2.3","protocol":"7.2","config":{"agentId":"172.17.42.1-29992-7ece51a6-servlet","agentType":"servlet"},"info":{"product":"tomcat","vendor":"Apache","version":"8.0.22"}},"timestamp":1431613883,"status":200}

Any idea ?

@joshiste
Copy link
Collaborator

You need to activate the JMX-Configurator in Logback:

https://github.com/codecentric/spring-boot-admin/blob/master/spring-boot-admin-samples/spring-boot-admin-sample/src/main/resources/logback.xml#L4

Did you have a look at your browers console in jmx view? Is there any error showing up?

@josetesan
Copy link

No change. Still nothing even if i added that option to logback.xml
And no error from browser either

@joshiste
Copy link
Collaborator

So can you take a look at the network console looking at the request/responses?
Or do you have a sample project to reproduce the issue?

@joshiste
Copy link
Collaborator

Or maybe an browser issue? What browser are you using? Did you try latest chrome or ff?

@MichaelF25
Copy link
Author

Adding a logback.xml to my application resolved the missing logger configuration issue. Thx!

@joshiste
Copy link
Collaborator

@josetesan Do you have any unresolved problems? can this Issue be closed?

@joshiste joshiste changed the title Version, info and log missing or empty JMX and logging section doesn't show up May 15, 2015
joshiste pushed a commit that referenced this issue May 15, 2015
@josetesan
Copy link

Sorry for the delay :-(
Did what you asked me, and found two intesting things..
When clicking both "logging" and "jmx", the admin boot server tries to do a post to himself
http://server:port/api/applications/e7c94ba2/jolokia/
But it does receive a 403 HTTP status error code, forbidden.
"Invalid CSRF Token 'null' was found on the request parameter '_csrf' or header 'X-CSRF-TOKEN'."

This looks like the cause of the problem ?

@joshiste
Copy link
Collaborator

the boot admin server serves as a zuul reverese proxy on /api/applications//* so the request is forwarded to your client app. And I assume there is security with csrf protection active?

@josetesan
Copy link

Yes, there is


Enviado desde Mailbox

On Sat, May 16, 2015 at 10:03 PM, Johannes Stelzer
notifications@github.com wrote:

the boot admin server serves as a zuul reverese proxy on /api/applications//* so the request is forwarded to your client app. And I assume there is security with csrf protection active?

Reply to this email directly or view it on GitHub:
#72 (comment)

@josetesan
Copy link

So, do I have to disable csrf ? Or how can I allow server connect back to client ?

@joshiste
Copy link
Collaborator

For the JMX and logging section posting to /jolokia is required. So you sholud disable csrf for this endpoint.

@josetesan
Copy link

Just to let you know by adding
.csrf().ignoringAntMatchers("/jolokia/**")

to the HttpSecurity configuration made this work.
Thanks for the help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants