Skip to content

Commit

Permalink
ft(consul): discovery update
Browse files Browse the repository at this point in the history
  • Loading branch information
siddhantprateek committed Aug 15, 2023
1 parent d1823f1 commit 82b8314
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
)

func GetEnvConfig(VARIABLE_NAME string) string {
err := godotenv.Load(".dev.env") // for production leave it empty
err := godotenv.Load()
if err != nil {
fmt.Println("Error loading .env file:", err)
}
Expand Down
4 changes: 2 additions & 2 deletions consul/consul.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type Service struct {
ttl string
}

const (
var (
ttl = time.Second * 8 // time to leave
// serviceAddress = "consul:8500" // for production
serviceAddress = "localhost"
Expand All @@ -41,7 +41,7 @@ servicePort: int - Port number on which the service is running.
*/
func NewService(serviceID, serviceName, serviceTag string, servicePort int) *Service {
client, err := api.NewClient(&api.Config{
// Address: serviceAddress,
Address: serviceAddress,
})
if err != nil {
log.Fatal(err)
Expand Down
20 changes: 20 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,26 @@ services:
- consul
restart: always

jaeger:
container_name: jaeger
image: jaegertracing/all-in-one:1.47
environment:
- COLLECTOR_OTLP_ENABLED=true
- COLLECTOR_ZIPKIN_HOST_PORT=:9411
ports:
- 6831:6831/udp
- 6832:6832/udp
- 5778:5778
- 16686:16686
- 4317:4317
- 4318:4318
- 14250:14250
- 14268:14268
- 14269:14269
- 9411:9411
networks:
- backend
restart: always

networks:
monitoring:
Expand Down

0 comments on commit 82b8314

Please sign in to comment.