Skip to content

Commit b34ccb3

Browse files
authored
put Promtail on default CTF network (#1993)
put promtail on default CTF network to be able to run seamlessly in CI
1 parent 4923b75 commit b34ccb3

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

framework/.changeset/v0.10.7.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Test observability stack in CI, move promtail to ctf default network

framework/observability.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,10 @@ func ObservabilityUp() error {
117117
if err := extractAllFiles("observability"); err != nil {
118118
return err
119119
}
120+
_ = DefaultNetwork(nil)
120121
if err := NewPromtail(); err != nil {
121122
return err
122123
}
123-
_ = DefaultNetwork(nil)
124124
err := RunCommand("bash", "-c", fmt.Sprintf(`
125125
cd %s && \
126126
docker compose up -d

framework/promtail.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ scrape_configs:
6060
lokiTenantID := os.Getenv("LOKI_TENANT_ID")
6161

6262
if lokiURL == "" {
63-
lokiURL = "http://host.docker.internal:3030/loki/api/v1/push"
63+
lokiURL = "http://loki:3100/loki/api/v1/push"
6464
}
6565
if lokiTenantID == "" {
6666
lokiTenantID = "promtail"
@@ -131,6 +131,10 @@ func NewPromtail() error {
131131
ExposedPorts: []string{"9080/tcp"},
132132
Name: "promtail",
133133
Cmd: cmd,
134+
Networks: []string{DefaultNetworkName},
135+
NetworkAliases: map[string][]string{
136+
DefaultNetworkName: {"promtail"},
137+
},
134138
Files: []testcontainers.ContainerFile{
135139
{
136140
HostFilePath: pcn,

0 commit comments

Comments
 (0)