-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add ok/error logic to the decorator #79
Conversation
For record_error_if and record_success_if
932442a
to
b5b82f8
Compare
This is done by using the "follow_imports=skip" option for opentelemetry.attributes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking good!
.github/workflows/main.yml
Outdated
@@ -24,10 +24,12 @@ jobs: | |||
python-version: ${{ matrix.python-version }} | |||
cache: poetry | |||
- name: Install dependencies | |||
run: poetry install --no-interaction --no-root --with dev | |||
run: poetry install --no-interaction --no-root --with dev --with examples |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--with
supports comma separated syntax too 🙃
run: poetry install --no-interaction --no-root --with dev --with examples | |
run: poetry install --no-interaction --no-root --with dev,examples |
src/py.typed
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice! i wanted to add these as well
pyproject.toml
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since we are exposing types correctly now, i think it would be fair to also add the "Typing :: Typed"
classifier 🧐
And also switch to mypy (instead of pyright). There's an issue with pyright and the return value for coroutines (microsoft/pyright#5745) which caused problems for our library and I also ran into issues when overloading the decorator and pyright not complaining about certain overloads which would never be used because other overloads were more generic/broadly defined).
Anyway the real meat of the matter is the addition of:
record_error_if
record_ok_if
Which allows the user of the lib to make certain exceptions not show up as errors and certain normal responses to register as errors.
Resolves #45