fix: use original app name when setting include_labels for vector source
Closes #5221
This commit is contained in:
@@ -168,18 +168,18 @@ func writeVectorConfig() error {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
appName = strings.ReplaceAll(appName, ".", "-")
|
inflectedAppName := strings.ReplaceAll(appName, ".", "-")
|
||||||
sink, err := sinkValueToConfig(appName, value)
|
sink, err := sinkValueToConfig(inflectedAppName, value)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
data.Sources[fmt.Sprintf("docker-source:%s", appName)] = vectorSource{
|
data.Sources[fmt.Sprintf("docker-source:%s", inflectedAppName)] = vectorSource{
|
||||||
Type: "docker_logs",
|
Type: "docker_logs",
|
||||||
IncludeLabels: []string{fmt.Sprintf("com.dokku.app-name=%s", appName)},
|
IncludeLabels: []string{fmt.Sprintf("com.dokku.app-name=%s", appName)},
|
||||||
}
|
}
|
||||||
|
|
||||||
data.Sinks[fmt.Sprintf("docker-sink:%s", appName)] = sink
|
data.Sinks[fmt.Sprintf("docker-sink:%s", inflectedAppName)] = sink
|
||||||
}
|
}
|
||||||
|
|
||||||
value := common.PropertyGet("logs", "--global", "vector-sink")
|
value := common.PropertyGet("logs", "--global", "vector-sink")
|
||||||
|
|||||||
Reference in New Issue
Block a user