Skip to content

Add DisableSkipErrMetrics to disable ErrSkip metrics - #389

Merged
XSAM merged 3 commits into
XSAM:mainfrom
diebietse:add-disable-skip-err-metrics
Dec 12, 2024
Merged

XSAM merged 3 commits into
XSAM:mainfrom
diebietse:add-disable-skip-err-metrics

Conversation

@ncthompson

@ncthompson ncthompson commented Nov 28, 2024 •

Copy link
Copy Markdown
Contributor

DisableSkipErrMetrics will skip the recoding of any SkipErr metric if enabled.
Since SkipErr results in a retry, the actual database interaction will still be recorded.

Closes #386

@ncthompson
ncthompson requested a review from XSAM as a code owner November 28, 2024 07:23
@codecov

codecov Bot commented Nov 28, 2024 •

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.2%. Comparing base (5b7f647) to head (9e09094).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##            main    #389     +/-   ##
=======================================
+ Coverage   83.0%   83.2%   +0.1%     
=======================================
  Files         13      13             
  Lines        750     758      +8     
=======================================
+ Hits         623     631      +8     
  Misses       103     103             
  Partials      24      24             

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ncthompson
ncthompson force-pushed the add-disable-skip-err-metrics branch from d0e9a0c to c070d6e Compare November 28, 2024 07:24

@XSAM XSAM left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

@ncthompson, thanks for the PR!

It looks good. I only have a naming issue. BTW, do you think skipping the entire measurement creation when encountering ErrSkip is better than recording a measurement with status OK?

Comment thread config.go Resolved
Comment thread option.go Resolved
Comment thread option_test.go Resolved
Comment thread CHANGELOG.md Resolved
@ncthompson

Copy link
Copy Markdown
Contributor Author

@ncthompson, thanks for the PR!

It looks good. I only have a naming issue. BTW, do you think skipping the entire measurement creation when encountering ErrSkip is better than recording a measurement with status OK?

I was debating this myself when creating this. From looking at the lib itself, it always retries on a ErrSkip. So it feels like you will have "duplicate" measurements if you log both. I am open to change it if you feel like this will hide measurements that should rather be logged.

@ncthompson
ncthompson force-pushed the add-disable-skip-err-metrics branch from c070d6e to 2c9c905 Compare December 3, 2024 07:27
@XSAM

XSAM commented Dec 4, 2024 •

Copy link
Copy Markdown
Owner

@ncthompson, thanks for the PR!
It looks good. I only have a naming issue. BTW, do you think skipping the entire measurement creation when encountering ErrSkip is better than recording a measurement with status OK?

I was debating this myself when creating this. From looking at the lib itself, it always retries on a ErrSkip. So it feels like you will have "duplicate" measurements if you log both. I am open to change it if you feel like this will hide measurements that should rather be logged.

I took some time to think about this, and I prefer the way to keep the "duplicate" measurement. Here are my reasons:

DisableSkipErrMeasurement will suppress the recoding of any SkipErr metric if enabled.
The measurement will be recorded as status=ok.
See XSAM#386
@ncthompson
ncthompson force-pushed the add-disable-skip-err-metrics branch from 2c9c905 to bbfef15 Compare December 5, 2024 09:07
@ncthompson

Copy link
Copy Markdown
Contributor Author

@ncthompson, thanks for the PR!
It looks good. I only have a naming issue. BTW, do you think skipping the entire measurement creation when encountering ErrSkip is better than recording a measurement with status OK?

I was debating this myself when creating this. From looking at the lib itself, it always retries on a ErrSkip. So it feels like you will have "duplicate" measurements if you log both. I am open to change it if you feel like this will hide measurements that should rather be logged.

I took some time to think about this, and I prefer the way to keep the "duplicate" measurement. Here are my reasons:

Thanks for the feedback! 😄

I have updated it so it suppresses the ErrSkip like in the tracing case. Have a look if that makes sense to you.

@XSAM XSAM left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks for the update and contribution. Please merge the main branch and update the CHANGELOG as suggested, so I can merge this PR.

Comment thread CHANGELOG.md Resolved
@XSAM
XSAM merged commit cc367ec into XSAM:main Dec 12, 2024
@XSAM XSAM mentioned this pull request Dec 19, 2024
XSAM added a commit that referenced this pull request Dec 19, 2024
### Added

- `DisableSkipErrMeasurement` option suppresses `driver.ErrSkip` as an
error status in measurements if enabled. (#389)

### Changed

- Upgrade OTel to `v1.33.0/v0.55.0`. (#396)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Do not report ErrSkip in metrics as error

2 participants