jedcunningham commented on code in PR #39510:
URL: https://github.com/apache/airflow/pull/39510#discussion_r1595950404


##########
tests/utils/test_scarf.py:
##########


Review Comment:
   This tests the scheduler. We need an equivalent for the webserver.



##########
airflow/settings.py:
##########
@@ -666,3 +666,7 @@ def initialize():
     "y",
     "1",
 }
+
+IS_SCARF_ANALYTICS_ENABLED = conf.getboolean("scarf_analytics", "enabled", 
fallback=True) and (

Review Comment:
   No coverage on this either.



##########
airflow/utils/scarf.py:
##########
@@ -0,0 +1,61 @@
+#
+# 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.
+from __future__ import annotations
+
+import platform
+
+import httpx
+from packaging.version import parse
+
+from airflow import __version__ as airflow_version, settings
+from airflow.configuration import conf
+
+
+def scarf_analytics():
+    if not settings.IS_SCARF_ANALYTICS_ENABLED:
+        return
+
+    # Exclude pre-releases and dev versions
+    if _version_is_prerelease(airflow_version):
+        return
+
+    scarf_domain = "https://apacheairflow.gateway.scarf.sh/scheduler";

Review Comment:
   I see the scheduler hits `/scheduler`, but the normal tracking pixel hits 
`/`.
   
   Is this also a "pixel" on the scarf side?



-- 
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-unsubscr...@airflow.apache.org

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

Reply via email to