Skip to content

Commit

Permalink
[SVLS-5713] Correctly set log source in sidecar mode (#30070)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcstorms1 authored Oct 17, 2024
1 parent ec15fa7 commit f7b3b58
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmd/serverless-init/log/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,20 @@ func SetupLogAgent(conf *Config, tags map[string]string, tagger tagger.Component

tagsArray := serverlessTag.MapToArray(tags)

addFileTailing(logsAgent, tagsArray)
addFileTailing(logsAgent, conf.source, tagsArray)

serverlessLogs.SetLogsTags(tagsArray)
return logsAgent
}

func addFileTailing(logsAgent logsAgent.ServerlessLogsAgent, tags []string) {
func addFileTailing(logsAgent logsAgent.ServerlessLogsAgent, source string, tags []string) {
if filePath, set := os.LookupEnv(envVarTailFilePath); set {
src := sources.NewLogSource("serverless-file-tail", &logConfig.LogsConfig{
Type: logConfig.FileType,
Path: filePath,
Service: os.Getenv("DD_SERVICE"),
Tags: tags,
Source: source,
})
logsAgent.GetSources().AddSource(src)
}
Expand Down

0 comments on commit f7b3b58

Please sign in to comment.