Skip to content

fix: Add better logging/metric per table#513

Merged
kodiakhq[bot] merged 3 commits intomainfrom
chore/logging
Dec 18, 2022
Merged

fix: Add better logging/metric per table#513
kodiakhq[bot] merged 3 commits intomainfrom
chore/logging

Conversation

@yevgenypats
Copy link
Copy Markdown
Contributor

currently we silently drop metrics from child tables. This add them back when root table sync is finished so it is printed once per table/client (and not per object like it was before with millions of log lines)

@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 17, 2022

⏱️ Benchmark results

  • DefaultConcurrency-2 resources/s: 11,936
  • Glob-2 ns/op: 157
  • TablesWithChildrenDefaultConcurrency-2 resources/s: 30,170
  • BufferedScanner-2 ns/op: 9.42
  • LogReader-2 ns/op: 30.72

Copy link
Copy Markdown
Member

@erezrokah erezrokah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, added 2 non blocking comments

logger.Info().Uint64("resources", tableMetrics.Resources).Uint64("errors", tableMetrics.Errors).Msg("fetch table finished")
if parent == nil { // Log only for root tables and relations only after resolving is done, otherwise we spam per object instead of per table.
logger.Info().Uint64("resources", tableMetrics.Resources).Uint64("errors", tableMetrics.Errors).Msg("table sync finished")
p.logTablesMetrics(table.Relations, client)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
p.logTablesMetrics(table.Relations, client)
p.logTablesMetrics(table.Relations, client)

[non blocking] Maybe this could be p.logTableMetrics(table, client) and move the log in the above line into the method? This way we don't need to duplicate it

yevgenypats and others added 3 commits December 18, 2022 09:50
@kodiakhq kodiakhq bot merged commit da36396 into main Dec 18, 2022
@kodiakhq kodiakhq bot deleted the chore/logging branch December 18, 2022 07:54
kodiakhq bot pushed a commit that referenced this pull request Dec 19, 2022
🤖 I have created a release *beep* *boop*
---


## [1.12.6](v1.12.5...v1.12.6) (2022-12-18)


### Bug Fixes

* Add better logging/metric per table ([#513](#513)) ([da36396](da36396))
* Improve formatting of newlines in markdown files ([#492](#492)) ([e48ff90](e48ff90))
* Include table name in logs on panic ([#505](#505)) ([a0b8a46](a0b8a46))
* Move source & destination plugin code to separate packages ([#516](#516)) ([6733785](6733785))
* Use correct error codes ([#514](#514)) ([8b53d76](8b53d76))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants