Startup timestamp in Eureka metadata
<p>We're using Spring Cloud Angel.SR6 with Netflix Eureka and Spring Config Server. One of our microservices is a distributed system that uses Eureka as a discovery mechanism to find peers. In order to start up the system in the correct way when multiple instances are started in parallel, we would like to know which node started first. The application information in Eureka contains a few different timestamps, but they change when the Eureka client updates the status so it seems that we can't rely on them.</p>

<p>Our idea now is to have the application register its own boot timestamp in the Eureka <code>metadataMap</code> which we have been able to accomplish using the <code>EurekaInstanceConfigBean</code>. With this approach however, the timestamp is added too late in the process. The instances initially appear in Eureka without the timestamp, which is not good enough for us (and even if it would be, it takes to long to be a nice solution).</p>

<p>What we are trying to do instead is to get the timestamp included in the initial Eureka registration. Properties declared in <code>bootstrap.properties</code> are included, so if we could somehow get the timestamp in here everything would work:</p>

<p><code>eureka.instance.metadataMap.bootTimestamp=&lt;here we want the timestamp&gt;</code></p>

<p>We have tried to add a custom <code>PropertySourceLocator</code> using the approach mentioned in the <a href="http://projects.spring.io/spring-cloud/docs/1.0.3/spring-cloud.html#customizing-bootstrap-property-sources" rel="nofollow">Spring Cloud Documentation</a>, but still no luck. The initial Eureka registration happens before the the PropertySourceLocator is initialized which again is too late.</p>

<p>How can we get the boot timestamp into the environment before the initial Eureka registration so the application never appears in Eureka without a timestamp?</p>