These are chat archives for spring-cloud/spring-cloud

Aug 2018
Knut Schleßelmann
Aug 09 2018 07:49

Hi guys, I'm still trying to add cloudwatch metrics to my application. Currently I have

dependencyManagement {
    imports {
        mavenBom ''

dependencies {






    testCompile('org.springframework.boot:spring-boot-starter-test') {
        exclude module: 'junit'

in my build.gradle and

        enabled: true
        namespace: my-service

in my configuration. But it seems there are not metrics written. Any suggestions?

The config properties aren't regiocnized by my IDE as well … this feels wrong
Szymon Zberaz
Aug 09 2018 11:51
@kschlesselmann check this tutorial
Knut Schleßelmann
Aug 09 2018 12:00
@SzymonZberaz_twitter Yeah, I already found that … but currently I got some exception. So I think I'm on some valid path :-)
Brian Devins-Suresh
Aug 09 2018 13:44
@kschlesselmann I think you need to include spring-boot-starter-actuator as well
Knut Schleßelmann
Aug 09 2018 13:48
@devinsba Yeah I did … it's working now. Sadly my jenkins test fail now because of … is not authorized to perform: cloudformation:DescribeStackResources (Service: AmazonCloudFormation; Status Code: 403; Error Code: AccessDenied; … if I run tests that start a Spring context … I think it's detecting that it runs on some EC2 (jenkins) and tries to start up its Spring Cloud AWS magic
Brian Devins-Suresh
Aug 09 2018 13:54
I excluded aws-java-sdk-cloudformation and aws-java-sdk-s3 from spring-cloud-starter-aws since I wasn’t using those to ignore those auto configurations
Knut Schleßelmann
Aug 09 2018 13:55
Hm … maybe that's an idea as well …
Do you have something along
      static: eu-central-1
in application-test.yml as well? @devinsba
Brian Devins-Suresh
Aug 09 2018 13:58
Knut Schleßelmann
Aug 09 2018 14:00

OK, jenkins is up and running again :-)

Let's see what this cloudformation stuff did in the first place :-P

Sarvesh Dubey
Aug 09 2018 15:31
Hi is there a document to know the order in which spring events are published. I am looking for an event which will be published after the spring context is refreshed (especially after hitting the /refresh endpoint) and after the Eureka client registers itself. Currently it has been a trial and error for me. I tried to listen to RefreshScopeRefreshedEvent, it triggers when I hit the refresh endpoint, but post refresh the client registers to Eureka server. My use case is to send some metadata to Eureka after the client is refreshed.
Sarvesh Dubey
Aug 09 2018 18:55
@spencergibb thanks for the links. But I am still not able to achieve my use case. I want to send some dynamically generated metadata for a client to Eureka. Everything works fine when the client registers to Eureka during app startup, but when I hit the refresh endpoint all that metadata gets lost. So I registered an InstanceRegisteredEvent listener which will update the metadata using /apps/appId/instanceId?metadata API. I am fetching the instance I'd by doing GET for ` The tricky part is when the instance gets refresh, it re-registers itself to Eureka due to which a new instanceId is created
So when I do try to get all instances of the app from Eureka using REST API, sometimes it gives me the old instance Id due to which the update metadata API fails. As a workaround, I used spring retry with some delay and eventually the GET API returns proper instance Id and the update metadata succeeds. But looks like I am complicating stuff to do a simple thing (to update client metadata on refresh so that it is not lost), any suggestions?
Sarvesh Dubey
Aug 09 2018 19:04
Not sure if I was clear on explaining the problem, if not let me know, I will post question on Stack overflow
Marcos Barbero
Aug 09 2018 20:49
@Sarvesh-D I was working on something similar few months ago, if you can share some code on a public repo I'll be more than happy to help you out