Skip to content

Commit

Permalink
Single startup log with more context - post rebase
Browse files Browse the repository at this point in the history
Signed-off-by: Kyle Eckhart <[email protected]>
  • Loading branch information
kgeckhart committed Mar 18, 2024
1 parent b629514 commit 1ec3046
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions stackdriver_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,16 +279,6 @@ func main() {
}
}

level.Info(logger).Log(
"msg", "Starting stackdriver_exporter",
"version", version.Info(),
"build_context", version.BuildContext(),
"projects", *projectID,
"metric_prefixes", *monitoringMetricsTypePrefixes,
"extra_filters", strings.Join(*monitoringMetricsExtraFilter, ","),
)
level.Info(logger).Log("msg", "Build context", "build_context", version.BuildContext())

monitoringService, err := createMonitoringService(ctx)
if err != nil {
level.Error(logger).Log("msg", "failed to create monitoring service", "err", err)
Expand All @@ -298,7 +288,6 @@ func main() {
var projectIDs []string

if *projectsFilter != "" {
level.Info(logger).Log("msg", "Using Google Cloud Projects Filter", "projectsFilter", *projectsFilter)
projectIDs, err = utils.GetProjectIDsFromFilter(ctx, *projectsFilter)
if err != nil {
level.Error(logger).Log("msg", "failed to get project IDs from filter", "err", err)
Expand All @@ -310,7 +299,16 @@ func main() {
projectIDs = append(projectIDs, strings.Split(*projectID, ",")...)
}

level.Info(logger).Log("msg", "Using Google Cloud Project IDs", "projectIDs", fmt.Sprintf("%v", projectIDs))
level.Info(logger).Log(
"msg", "Starting stackdriver_exporter",
"version", version.Info(),
"build_context", version.BuildContext(),
"projects", *projectID,
"metric_prefixes", *monitoringMetricsTypePrefixes,
"extra_filters", strings.Join(*monitoringMetricsExtraFilter, ","),
"projectIDs", fmt.Sprintf("%v", projectIDs),
"projectsFilter", *projectsFilter,
)

metricsTypePrefixes := strings.Split(*monitoringMetricsTypePrefixes, ",")
metricExtraFilters := parseMetricExtraFilters()
Expand Down

0 comments on commit 1ec3046

Please sign in to comment.