You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "hussein-awala (via GitHub)" <gi...@apache.org> on 2023/03/13 01:06:32 UTC

[GitHub] [airflow] hussein-awala opened a new pull request, #30059: Support creating Datadog connection from the UI and add documentation for this conn

hussein-awala opened a new pull request, #30059:
URL: https://github.com/apache/airflow/pull/30059

   related: #28790 
   
   ---
   This PR:
   
   - add  Datadog connection to webserver connections list
   - updates Datadog connection UI widget to easily provide extra values
   - add documentation for Datadog provider connection types.


-- 
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


[GitHub] [airflow] hussein-awala commented on a diff in pull request #30059: Support creating Datadog connection from the UI and add documentation for this conn

Posted by "hussein-awala (via GitHub)" <gi...@apache.org>.
hussein-awala commented on code in PR #30059:
URL: https://github.com/apache/airflow/pull/30059#discussion_r1135746773


##########
airflow/providers/datadog/hooks/datadog.py:
##########
@@ -152,3 +157,27 @@ def post_event(
 
         self.validate_response(response)
         return response
+
+    @staticmethod
+    def get_connection_form_widgets() -> dict[str, Any]:
+        """Returns connection widgets to add to connection form"""
+        from flask_appbuilder.fieldwidgets import BS3TextFieldWidget
+        from flask_babel import lazy_gettext
+        from wtforms import StringField
+
+        return {
+            "api_host": StringField(lazy_gettext("Datadog API endpoint"), widget=BS3TextFieldWidget()),
+            "api_key": StringField(lazy_gettext("Datadog API key"), widget=BS3TextFieldWidget()),
+            "app_key": StringField(lazy_gettext("Datadog application key"), widget=BS3TextFieldWidget()),
+            "source_type_name": StringField(
+                lazy_gettext("Datadog source type name"), widget=BS3TextFieldWidget()

Review Comment:
   I had the same impression :+1: 



-- 
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


[GitHub] [airflow] josh-fell merged pull request #30059: Support creating Datadog connection from the UI and add documentation for this conn

Posted by "josh-fell (via GitHub)" <gi...@apache.org>.
josh-fell merged PR #30059:
URL: https://github.com/apache/airflow/pull/30059


-- 
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


[GitHub] [airflow] josh-fell commented on a diff in pull request #30059: Support creating Datadog connection from the UI and add documentation for this conn

Posted by "josh-fell (via GitHub)" <gi...@apache.org>.
josh-fell commented on code in PR #30059:
URL: https://github.com/apache/airflow/pull/30059#discussion_r1135607598


##########
docs/apache-airflow-providers-datadog/connections/datadog.rst:
##########
@@ -0,0 +1,46 @@
+ .. 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.
+
+.. _howto/connection:kubernetes:
+
+Datadog Connection
+=============================
+
+The Datadog Connection type enables integrations with the Datadog API client.
+
+
+Default Connection IDs
+----------------------
+
+Hooks and sensors related to Datadog use ``datadog_default`` by default.
+
+Configuring the Connection
+--------------------------
+Host
+    Host name to associate with the sent events.
+
+Extra
+    Specify the extra parameters (as json dictionary) that can be used in Datadog

Review Comment:
   ```suggestion
       Specify the extra parameters (as a JSON dictionary) that can be used in Datadog
   ```
   A nit I suppose.



##########
airflow/providers/datadog/hooks/datadog.py:
##########
@@ -152,3 +157,27 @@ def post_event(
 
         self.validate_response(response)
         return response
+
+    @staticmethod
+    def get_connection_form_widgets() -> dict[str, Any]:
+        """Returns connection widgets to add to connection form"""
+        from flask_appbuilder.fieldwidgets import BS3TextFieldWidget
+        from flask_babel import lazy_gettext
+        from wtforms import StringField
+
+        return {
+            "api_host": StringField(lazy_gettext("Datadog API endpoint"), widget=BS3TextFieldWidget()),
+            "api_key": StringField(lazy_gettext("Datadog API key"), widget=BS3TextFieldWidget()),
+            "app_key": StringField(lazy_gettext("Datadog application key"), widget=BS3TextFieldWidget()),
+            "source_type_name": StringField(
+                lazy_gettext("Datadog source type name"), widget=BS3TextFieldWidget()

Review Comment:
   ```suggestion
               "api_host": StringField(lazy_gettext("API endpoint"), widget=BS3TextFieldWidget()),
               "api_key": StringField(lazy_gettext("API key"), widget=BS3TextFieldWidget()),
               "app_key": StringField(lazy_gettext("Application key"), widget=BS3TextFieldWidget()),
               "source_type_name": StringField(
                   lazy_gettext("Source type name"), widget=BS3TextFieldWidget()
   ```
   WDYT about removing "Datadog" from the labels? This feels a little redundant given users would have chosen the Datadog conn type and the fields are assumed to be Datadog related.



-- 
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