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

Added curator connectionString log #578

Merged
merged 1 commit into from
Oct 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.newm.server.curator.support

import io.github.oshai.kotlinlogging.KotlinLogging
import org.apache.curator.ensemble.EnsembleProvider
import software.amazon.awssdk.services.ec2.Ec2Client
import software.amazon.awssdk.services.ec2.model.DescribeInstancesRequest
Expand All @@ -10,6 +11,8 @@ class Ec2EnsembleProvider(
private val role: String,
private val port: Int
) : EnsembleProvider {
private val log = KotlinLogging.logger {}

override fun getConnectionString(): String {
val request = DescribeInstancesRequest
.builder()
Expand All @@ -26,6 +29,9 @@ class Ec2EnsembleProvider(
.reservations()
.flatMap { it.instances() }
.joinToString(",") { "${it.privateIpAddress()}:$port" }
.also {
log.info { "connectionString: $it" }
}
}

override fun start() {}
Expand Down
Loading