feat: add vector integration

This currently is missing a few features:

- global sinks
- logrotation

But works fairly well otherwise.
This commit is contained in:
Jose Diaz-Gonzalez
2021-01-04 00:30:22 -05:00
parent b386783ec8
commit fd85b1f605
15 changed files with 628 additions and 5 deletions

25
plugins/logs/report.go Normal file
View File

@@ -0,0 +1,25 @@
package logs
import (
"github.com/dokku/dokku/plugins/common"
)
// ReportSingleApp is an internal function that displays the logs report for one or more apps
func ReportSingleApp(appName, infoFlag string) error {
if err := common.VerifyAppName(appName); err != nil {
return err
}
flags := map[string]common.ReportFunc{
"--logs-vector-sink": reportVectorSink,
}
trimPrefix := false
uppercaseFirstCharacter := true
infoFlags := common.CollectReport(appName, infoFlag, flags)
return common.ReportSingleApp("logs", appName, infoFlag, infoFlags, trimPrefix, uppercaseFirstCharacter)
}
func reportVectorSink(appName string) string {
return common.PropertyGet("logs", appName, "vector-sink")
}