Skip to content

Commit

Permalink
fix: init metrics after logger (#333)
Browse files Browse the repository at this point in the history
# Description

Metrics package uses the global logger (😠), so it needs to init after
the logger.

## Related Issue

If this pull request is related to any issue, please mention it here.
Additionally, make sure that the issue is assigned to you before
submitting this pull request.

## Checklist

- [ ] I have read the [contributing
documentation](https://retina.sh/docs/contributing).
- [ ] I signed and signed-off the commits (`git commit -S -s ...`). See
[this
documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification)
on signing commits.
- [ ] I have correctly attributed the author(s) of the code.
- [ ] I have tested the changes locally.
- [ ] I have followed the project's style guidelines.
- [ ] I have updated the documentation, if necessary.
- [ ] I have added tests, if applicable.

## Screenshots (if applicable) or Testing Completed

Please add any relevant screenshots or GIFs to showcase the changes
made.

## Additional Notes

Add any additional notes or context about the pull request here.

---

Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more
information on how to contribute to this project.

Signed-off-by: Evan Baker <[email protected]>
  • Loading branch information
rbtr authored May 1, 2024
1 parent 72c048c commit cf62112
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ func main() {
panic(err)
}

metrics.InitializeMetrics()

fmt.Println("init client-go")
cfg, err := kcfg.GetConfig()
if err != nil {
Expand Down Expand Up @@ -125,6 +123,8 @@ func main() {
defer zl.Close()
mainLogger := zl.Named("main").Sugar()

metrics.InitializeMetrics()

var tel telemetry.Telemetry
if config.EnableTelemetry && applicationInsightsID != "" {
mainLogger.Info("telemetry enabled", zap.String("applicationInsightsID", applicationInsightsID))
Expand Down

0 comments on commit cf62112

Please sign in to comment.