Netflix / Prana

A sidecar for your NetflixOSS based services.
Apache License 2.0
502 stars 98 forks source link

Registered healthcheck, status, and homepage URLs use application's port, not Prana's port #11

Open grahamc opened 9 years ago

grahamc commented 9 years ago

Using the following configuration:

prana.host.healthcheck.url=http://127.0.0.1:5000/hc
prana.host.healthcheck.timeout=1500
prana.proxy.req.acceptencoding=gzip

archaius.deployment.applicationId=EXAMPLEAPP
archaius.deployment.environment=prod

eureka.name=EXAMPLEAPP
eureka.vipAddress=EXAMPLEAPP
eureka.port=5000
eureka.environment=prod
eureka.appinfo.initial.replicate.time=1
eureka.preferSameZone=true
eureka.region=us-west-2
eureka.datacenter=cloud
eureka.shouldUseDns=true
eureka.eurekaServer.domainName=eureka.example.net
eureka.eurekaServer.port=8080
eureka.eurekaServer.context=eureka/v2

and starting Prana with:

./Prana -c ./config -p 8080

In Eureka I see:

<application>
  <name>RABBIT3</name>
  <instance>
    <hostName>ec2-xx-xx-xx-xx.us-west-2.compute.amazonaws.com</hostName>
    <app>RABBIT3</app>
    <ipAddr>172.17.0.112</ipAddr>
    <status>UP</status>
    <overriddenstatus>UNKNOWN</overriddenstatus>
    <port enabled="true">5000</port>
    <securePort enabled="false">443</securePort>
    <countryId>1</countryId>
    <dataCenterInfo class="com.netflix.appinfo.AmazonInfo">
      <name>Amazon</name>
      <metadata>
        <availability-zone>us-west-2a</availability-zone>
        <public-ipv4>xx.xx.xx.xx</public-ipv4>
        <instance-id>i-xxxxxxxx</instance-id>
        <public-hostname>ec2-xx-xx-xx-xx.us-west-2.compute.amazonaws.com</public-hostname>
        <local-ipv4>172.31.30.174</local-ipv4>
        <ami-id>ami-xxxxxxxx</ami-id>
        <instance-type>r3.8xlarge</instance-type>
      </metadata>
    </dataCenterInfo>
    <leaseInfo>
      <renewalIntervalInSecs>30</renewalIntervalInSecs>
      <durationInSecs>90</durationInSecs>
      <registrationTimestamp>1429647009479</registrationTimestamp>
      <lastRenewalTimestamp>1429647009479</lastRenewalTimestamp>
      <evictionTimestamp>0</evictionTimestamp>
      <serviceUpTimestamp>1429647009479</serviceUpTimestamp>
    </leaseInfo>
    <metadata class="java.util.Collections$EmptyMap"/>
    <appGroupName>UNKNOWN</appGroupName>
    <homePageUrl>http://ec2-xx-xx-xx-xx.us-west-2.compute.amazonaws.com:5000/</homePageUrl>
    <statusPageUrl>http://ec2-xx-xx-xx-xx.us-west-2.compute.amazonaws.com:5000/Status</statusPageUrl>
    <healthCheckUrl>http://ec2-xx-xx-xx-xx.us-west-2.compute.amazonaws.com:5000/healthcheck</healthCheckUrl>
    <vipAddress>rabbit3</vipAddress>
    <isCoordinatingDiscoveryServer>false</isCoordinatingDiscoveryServer>
    <lastUpdatedTimestamp>1429647009479</lastUpdatedTimestamp>
    <lastDirtyTimestamp>1429647009092</lastDirtyTimestamp>
    <actionType>ADDED</actionType>
  </instance>
</application>

Note specifically the homepage, status, and health checks are referring to port 5000:

    <homePageUrl>http://ec2-xx-xx-xx-xx.us-west-2.compute.amazonaws.com:5000/</homePageUrl>
    <statusPageUrl>http://ec2-xx-xx-xx-xx.us-west-2.compute.amazonaws.com:5000/Status</statusPageUrl>
    <healthCheckUrl>http://ec2-xx-xx-xx-xx.us-west-2.compute.amazonaws.com:5000/healthcheck</healthCheckUrl>

Meanwhile in the logs, I'm seeing the Prana bind to port 8080:

3134 [main] INFO io.reactivex.netty.server.AbstractServer - Rx server started at port: 8080
aspyker commented 8 years ago

@grahamc Thank you for the contribution. More will be coming, but please see http://ispyker.blogspot.com/2015/10/towards-being-better-about-open-source.html for a bit of context on the status of this project.