You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "AryanK1511 (via GitHub)" <gi...@apache.org> on 2025/06/03 09:26:27 UTC

[PR] [Providers/HTTP] Add Debug logging for improved troubleshooting in the HTTP Provider Hook [airflow]

AryanK1511 opened a new pull request, #51352:
URL: https://github.com/apache/airflow/pull/51352

   <!--
    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License.  You may obtain a copy of the License at
   
      http://www.apache.org/licenses/LICENSE-2.0
   
    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.
    -->
   
   <!--
   Thank you for contributing! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   In case of an existing issue, reference it using one of the following:
   
   closes: #ISSUE
   related: #ISSUE
   
   How to write a good git commit message:
   http://chris.beams.io/posts/git-commit/
   -->
   
   
   
   <!-- Please keep an empty line above the dashes. -->
   ---
   
   Added some debug logging to the HTTP Prover hook (`providers/http/src/airflow/providers/http/hooks/http.py`) since this hook runs on every HTTP call. As a user, the only info missing from the existing logs was more detailed data about the HTTP request itself. It made sense to add logs here because then users can pinpoint exactly where a request failed and troubleshoot more effectively.
   
   **Here is a screenshot highlighting what the debug logging looks like:**
   
   ![Screenshot 2025-06-03 at 5 25 58 AM](https://github.com/user-attachments/assets/18d07b9b-eb62-4169-9462-16067cddded5)
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Providers/HTTP] Add Debug logging for improved troubleshooting in the HTTP Provider Hook [airflow]

Posted by "AryanK1511 (via GitHub)" <gi...@apache.org>.
AryanK1511 closed pull request #51352: [Providers/HTTP] Add Debug logging for improved troubleshooting in the HTTP Provider Hook
URL: https://github.com/apache/airflow/pull/51352


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Providers/HTTP] Add Debug logging for improved troubleshooting in the HTTP Provider Hook [airflow]

Posted by "AryanK1511 (via GitHub)" <gi...@apache.org>.
AryanK1511 commented on code in PR #51352:
URL: https://github.com/apache/airflow/pull/51352#discussion_r2125072572


##########
providers/http/src/airflow/providers/http/hooks/http.py:
##########
@@ -294,6 +312,24 @@ def run_and_check(
             i.e. ``{'check_response': False}`` to avoid checking raising exceptions on non 2XX
             or 3XX status codes
         """
+        self.log.debug(
+            "Executing prepared request:\n"
+            "URL: %s\n"
+            "Method: %s\n"
+            "Headers: %s\n"

Review Comment:
   @rawwar Makes sense 😊 Also, with regards to the utility function, the scope is the HTTP Provider and not all providers right?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Providers/HTTP] Add Debug logging for improved troubleshooting in the HTTP Provider Hook [airflow]

Posted by "rawwar (via GitHub)" <gi...@apache.org>.
rawwar commented on code in PR #51352:
URL: https://github.com/apache/airflow/pull/51352#discussion_r2125203351


##########
providers/http/src/airflow/providers/http/hooks/http.py:
##########
@@ -294,6 +312,24 @@ def run_and_check(
             i.e. ``{'check_response': False}`` to avoid checking raising exceptions on non 2XX
             or 3XX status codes
         """
+        self.log.debug(
+            "Executing prepared request:\n"
+            "URL: %s\n"
+            "Method: %s\n"
+            "Headers: %s\n"

Review Comment:
   Yes



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Providers/HTTP] Add Debug logging for improved troubleshooting in the HTTP Provider Hook [airflow]

Posted by "rawwar (via GitHub)" <gi...@apache.org>.
rawwar commented on code in PR #51352:
URL: https://github.com/apache/airflow/pull/51352#discussion_r2123368898


##########
providers/http/src/airflow/providers/http/hooks/http.py:
##########
@@ -294,6 +312,24 @@ def run_and_check(
             i.e. ``{'check_response': False}`` to avoid checking raising exceptions on non 2XX
             or 3XX status codes
         """
+        self.log.debug(
+            "Executing prepared request:\n"
+            "URL: %s\n"
+            "Method: %s\n"
+            "Headers: %s\n"

Review Comment:
   I think, we should not print auth information here.  Headers usually have basic auth tokens as such. We need to filter them out or print partial values. Along with that, can we just make a utility function that logs all this information, given a request object? That's easier to reuse. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org