1
0
Fork 0

Log provider namespace during startup

This commit is contained in:
shreealt 2025-10-03 19:00:05 +05:30 committed by GitHub
parent 0b7f0b4042
commit 7cc8b099d2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 86 additions and 2 deletions

View file

@ -2,6 +2,7 @@ package aggregator
import (
"context"
"fmt"
"time"
"github.com/rs/zerolog/log"
@ -203,8 +204,16 @@ func (p *ProviderAggregator) launchProvider(configurationChan chan<- dynamic.Mes
log.Debug().Err(err).Msgf("Cannot marshal the provider configuration %T", prd)
}
log.Info().Msgf("Starting provider %T", prd)
log.Debug().RawJSON("config", []byte(jsonConf)).Msgf("%T provider configuration", prd)
// Check if provider has namespace information.
var namespaceInfo string
if namespaceProvider, ok := prd.(provider.NamespacedProvider); ok {
if namespace := namespaceProvider.Namespace(); namespace != "" {
namespaceInfo = fmt.Sprintf(" (namespace: %s)", namespace)
}
}
log.Info().Msgf("Starting provider %T%s", prd, namespaceInfo)
log.Debug().RawJSON("config", []byte(jsonConf)).Msgf("%T provider configuration%s", prd, namespaceInfo)
if err := maybeThrottledProvide(prd, p.providersThrottleDuration)(configurationChan, pool); err != nil {
log.Error().Err(err).Msgf("Cannot start the provider %T", prd)