Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

add snowflake csid as Metabase_Metabase (#61866)

Luiz Arakaki2581cc50b405
diff --git a/modules/drivers/snowflake/src/metabase/driver/snowflake.clj b/modules/drivers/snowflake/src/metabase/driver/snowflake.clj
index 7ed0198c2c4..03bcd5fc65d 100644
--- a/modules/drivers/snowflake/src/metabase/driver/snowflake.clj
+++ b/modules/drivers/snowflake/src/metabase/driver/snowflake.clj
@@ -205,6 +205,8 @@
;; keep open connections open indefinitely instead of closing them. See #9674 and
;; https://docs.snowflake.net/manuals/sql-reference/parameters.html#client-session-keep-alive
:client_session_keep_alive true
+ ;; identify this connection as coming from Metabase for easier monitoring in Snowflake
+ :application "Metabase_Metabase"
;; other SESSION parameters
;; not 100% sure why we need to do this but if we don't set the connection to UTC our report timezone
;; stuff doesn't work, even though we ultimately override this when we set the session timezone
diff --git a/modules/drivers/snowflake/test/metabase/driver/snowflake_test.clj b/modules/drivers/snowflake/test/metabase/driver/snowflake_test.clj
index 0a2f245c968..a51f7409434 100644
--- a/modules/drivers/snowflake/test/metabase/driver/snowflake_test.clj
+++ b/modules/drivers/snowflake/test/metabase/driver/snowflake_test.clj
@@ -177,7 +177,10 @@
false nil "//ls10467.us-east-2.aws.snowflakecomputing.com/"
false "" "//ls10467.us-east-2.aws.snowflakecomputing.com/"
false "snowflake.example.com/" "//ls10467.us-east-2.aws.snowflakecomputing.com/"
- false "snowflake.example.com" "//ls10467.us-east-2.aws.snowflakecomputing.com/"))))
+ false "snowflake.example.com" "//ls10467.us-east-2.aws.snowflakecomputing.com/"))
+ (testing "Application parameter is set to identify Metabase connections"
+ (is (= "Metabase_Metabase"
+ (:application (sql-jdbc.conn/connection-details->spec :snowflake details)))))))
(deftest ddl-statements-test
(testing "make sure we didn't break the code that is used to generate DDL statements when we add new test datasets"