Giter VIP home page Giter VIP logo

Comments (10)

erikpetzold avatar erikpetzold commented on May 27, 2024 1

What exactly is "not working"? Do you have any error message?

from spring-boot-admin.

erikpetzold avatar erikpetzold commented on May 27, 2024

Hi @aohanhongzhi ,

as written in #2893 , it would be really helpful if you would use the template we're providing for bugs. In the edit mode it contains also hints what to fill in there.

Please also provide some description of the problem. What have you already tried? have you set spring.boot.admin.ui.public-url and erver.forward-headers-strategy=native?

from spring-boot-admin.

aohanhongzhi avatar aohanhongzhi commented on May 27, 2024

Hi @aohanhongzhi ,

as written(书面) in #2893 , it would(会) be really helpful(乐于助人) if you would(会) use the template we're providing(提供) for bugs. In the edit(编辑) mode(模式) it contains also hints what to fill in there.

Please also provide(提供) some description(描述) of the problem. What have you already tried? have you set spring.boot.admin.ui.public-url and erver.forward-headers-strategy=native?

of course , I have set spring.boot.admin.ui.public-url and erver.forward-headers-strategy=native, but it not helpful

from spring-boot-admin.

erikpetzold avatar erikpetzold commented on May 27, 2024

Hi @aohanhongzhi

I added a sample with nginx proxy here: https://github.com/codecentric/spring-boot-admin-discovery-playground/tree/main/nginx

Maybe now I start understanding your problem (you still did not really describe your setup). From the screenshots in #2893 I guess, that you are talking about the connection between admin server and monitored app. So only your monitored app lives behind the proxy and the url it returns is pointing to the wrong url (private url, not public url of the proxy).
So I guess you want to modify the values in the /actuator endpoint?
Like in the example from above http://localhost:8888/hello/actuator returns
grafik
which contains http://hello-world-nginx:8081/ that would not be reachable from the outside. So Admin Server could not access this, right?

Hint: Actuator is provided by Spring Boot itself, not by Admin. The class in your screenshot is not even from Spring Boot Admin.

Questions:

  • Is the setup and problem I assumed correct?
  • Which discovery/registration mechanism do you use?

from spring-boot-admin.

aohanhongzhi avatar aohanhongzhi commented on May 27, 2024

Hi @aohanhongzhi

I added a sample with nginx proxy here: https://github.com/codecentric/spring-boot-admin-discovery-playground/tree/main/nginx

Maybe now I start understanding your problem (you still did not really describe your setup). From the screenshots in #2893 I guess, that you are talking about the connection between admin server and monitored app. So only your monitored app lives behind the proxy and the url it returns is pointing to the wrong url (private url, not public url of the proxy). So I guess you want to modify the values in the /actuator endpoint? Like in the example from above http://localhost:8888/hello/actuator returns grafik which contains http://hello-world-nginx:8081/ that would not be reachable from the outside. So Admin Server could not access this, right?

Hint: Actuator is provided by Spring Boot itself, not by Admin. The class in your screenshot is not even from Spring Boot Admin.

Questions:

  • Is the setup and problem I assumed correct?
  • Which discovery/registration mechanism do you use?

bingo , you are right! I didn't use any discovery/registration mechanism

so as your mean , I should solve the problem by modify Actuator to use public url of the proxy?

from spring-boot-admin.

erikpetzold avatar erikpetzold commented on May 27, 2024

I mean, there must be some kind of discovery or registration, the admin server must know the spring apps somehow.

E.g. with self registration you can provide the url (spring.boot.admin.client.instance.health-url) that the adminserver should use, so it would not use the url that is returned by the actuator anyways, so no need to fix this.

from spring-boot-admin.

aohanhongzhi avatar aohanhongzhi commented on May 27, 2024

I mean, there must be some kind of discovery or registration, the admin server must know the spring apps somehow.

E.g. with self registration you can provide the url (spring.boot.admin.client.instance.health-url) that the adminserver should use, so it would not use the url that is returned by the actuator anyways, so no need to fix this.

I configed spring.boot.admin.client.instance.health-url , but it is not working.

image

from spring-boot-admin.

erikpetzold avatar erikpetzold commented on May 27, 2024

As I said before, the properties will not change the output of the actuator endpoint. Actuator is provided by Spring Boot and is not influenced by the spring.boot.admin properties.
So the url in your screenshot is completely out of our control. This is part of Spring Boot itself.

However, the Spring Boot Admin does not use these urls in href. So even if they are wrong, you can get Spring Boot Admin to call the correct urls. Therefore, the client which is used to register can be configured with some different properties, see https://docs.spring-boot-admin.com/current/client.html#spring-boot-admin-client
You would need to set health-url/management-url/service-url depending on your setup. Probably management-url should be your url with the prod-api path. Then SBA Server will call the actuator endpoints with this path.

Here as graphical overview:
grafik

In the example in the playground (see above) you can simulate that situation by setting
spring.boot.admin.client.instance.service-url: "http://host.docker.internal:8888/hello"
then the admin client would register with that url and admin server would call client through proxy

from spring-boot-admin.

aohanhongzhi avatar aohanhongzhi commented on May 27, 2024

As I said before, the properties will not change the output of the actuator endpoint. Actuator is provided by Spring Boot and is not influenced by the spring.boot.admin properties. So the url in your screenshot is completely out of our control. This is part of Spring Boot itself.

However, the Spring Boot Admin does not use these urls in href. So even if they are wrong, you can get Spring Boot Admin to call the correct urls. Therefore, the client which is used to register can be configured with some different properties, see https://docs.spring-boot-admin.com/current/client.html#spring-boot-admin-client You would need to set health-url/management-url/service-url depending on your setup. Probably management-url should be your url with the prod-api path. Then SBA Server will call the actuator endpoints with this path.

Here as graphical overview: grafik

In the example in the playground (see above) you can simulate that situation by setting spring.boot.admin.client.instance.service-url: "http://host.docker.internal:8888/hello" then the admin client would register with that url and admin server would call client through proxy

unfortunately, it is not working too.

image

from spring-boot-admin.

aohanhongzhi avatar aohanhongzhi commented on May 27, 2024

What exactly is "not working"? Do you have any error message?

I mean this spring.boot.admin.client.instance.service-url still doesn't have a way to configure the post-proxy address

Looking at the Springboot Actuator source code, there's really no way to configure this

Maybe I should go to the Springboot Actuator github and make my request.

thank you very much!

from spring-boot-admin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.