-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: Freeze all range objects #1172 #1222
base: main
Are you sure you want to change the base?
Conversation
Created a readable constant in 8 files to freeze ranges 100..399 . Relate to open-telemetry#1172
….399 . Reviewed-by: kaylareopelle Refs: open-telemetry#1172
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.
@open-telemetry/ruby-contrib-approvers now that I'm looking at this I'm wondering if there is an opportunity to extract status setter helper method rather than defining a range per http instrumentation and implementing the same logic in each instrumentation separately.
Something like this
Semconv::Http::Client.set_status(span, http_status_code)
Which would then set the span status based on the http status code falling in the range of bad client status code.
That would reduce the number of places we would need to update when satisfying the specification.
Maybe that could be a follow up PR and this perf refactoring is a first step?
@arielvalentin - I like that idea! My vote would be to keep this refactoring as a first step and open that up in a follow-up PR. |
Hi @Victorsesan! Thanks for re-opening this PR! It looks like there are a few rubocop (Ruby linter) failures on your changes. The general message is:
I think the solution is to remove If you'd like to run rubocop locally to test yourself, you can do so using: docker compose run app
<container_sha>: /app$ cd instrumentation/http_client
<container_sha>: /app/instrumentation/http_client$ bundle install
<container_sha>: /app/instrumentation/http_client$ bundle exec rubocop |
Reviewed-by: kaylareopelle Refs: open-telemetry#1172
Thanks very much for reviewing @kaylareopelle . I have taken a look at the failures again from my end and have them sorted. Some end-of-line characters & carriage return test failures were also found which i converted with |
Ref #1172