Skip to content

Commit

Permalink
Adjust metrics endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel Saratura committed Jul 19, 2023
1 parent 0ff8363 commit 03da7ae
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions pkg/crossplane/service_mariadb_database.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,10 @@ func createCredentials(endpoint *Endpoint, username, password, database, databas
}
if metricsEnabled {
creds["metricsEndpoints"] = []string{
fmt.Sprintf("http://%s-mariadb-0.%s.%s", databaseParent, clusterName, metricsDomain),
fmt.Sprintf("http://%s-mariadb-1.%s.%s", databaseParent, clusterName, metricsDomain),
fmt.Sprintf("http://%s-mariadb-2.%s.%s", databaseParent, clusterName, metricsDomain),
fmt.Sprintf("http://%s.%s.%s", databaseParent, clusterName, metricsDomain),
fmt.Sprintf("http://%s.%s.%s/mariadb/0", databaseParent, clusterName, metricsDomain),
fmt.Sprintf("http://%s.%s.%s/mariadb/1", databaseParent, clusterName, metricsDomain),
fmt.Sprintf("http://%s.%s.%s/mariadb/2", databaseParent, clusterName, metricsDomain),
}
}

Expand Down
7 changes: 4 additions & 3 deletions pkg/crossplane/service_redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,10 @@ func (rsb RedisServiceBinder) GetBinding(ctx context.Context, bindingID string)
}
if rsb.cp.config.EnableMetrics {
creds["metricsEndpoints"] = []string{
fmt.Sprintf("http://%s-redis-0.%s.%s", rsb.instance.ID(), cn, rsb.cp.config.MetricsDomain),
fmt.Sprintf("http://%s-redis-1.%s.%s", rsb.instance.ID(), cn, rsb.cp.config.MetricsDomain),
fmt.Sprintf("http://%s-redis-2.%s.%s", rsb.instance.ID(), cn, rsb.cp.config.MetricsDomain),
fmt.Sprintf("http://%s.%s.%s", rsb.instance.ID(), cn, rsb.cp.config.MetricsDomain),
fmt.Sprintf("http://%s.%s.%s/redis/0", rsb.instance.ID(), cn, rsb.cp.config.MetricsDomain),
fmt.Sprintf("http://%s.%s.%s/redis/1", rsb.instance.ID(), cn, rsb.cp.config.MetricsDomain),
fmt.Sprintf("http://%s.%s.%s/redis/2", rsb.instance.ID(), cn, rsb.cp.config.MetricsDomain),
}
}

Expand Down

0 comments on commit 03da7ae

Please sign in to comment.