Class SnowflakeTelemetryService

  • Direct Known Subclasses:
    SnowflakeTelemetryServiceV1, SnowflakeTelemetryServiceV2

    public abstract class SnowflakeTelemetryService
    extends Object
    Abstract class handling basics of sending telemetry information to snowflake. Please note, this is only for debugging purposes and data is not exposed to customers.
    • Constructor Detail

      • SnowflakeTelemetryService

        protected SnowflakeTelemetryService()
    • Method Detail

      • setAppName

        public void setAppName​(String name)
        set app name
        Parameters:
        name - app name
      • setTaskID

        public void setTaskID​(String taskID)
        set task id
        Parameters:
        taskID - task id
      • reportKafkaConnectStart

        public void reportKafkaConnectStart​(long startTime,
                                            Map<String,​String> userProvidedConfig)
        Event of connector start
        Parameters:
        startTime - task start time
        userProvidedConfig - max number of tasks
      • reportKafkaConnectStop

        public void reportKafkaConnectStop​(long startTime)
        Event of connector stop
        Parameters:
        startTime - start timestamp
      • reportKafkaConnectFatalError

        public void reportKafkaConnectFatalError​(String errorDetail)
        Event of a fatal error in the connector
        Parameters:
        errorDetail - error message
      • reportKafkaPartitionUsage

        public void reportKafkaPartitionUsage​(SnowflakeTelemetryBasicInfo partitionStatus,
                                              boolean isClosing)
        report connector's partition usage.
        Parameters:
        partitionStatus - SnowflakePipeStatus object
        isClosing - is the underlying pipe/channel closing
      • getObjectNode

        public abstract net.snowflake.client.jdbc.internal.fasterxml.jackson.databind.node.ObjectNode getObjectNode()
        Get default object Node which will be part of every telemetry being sent to snowflake. Based on the underlying implementation, node fields might change.
        Returns:
        ObjectNode in Json Format
      • reportKafkaPartitionStart

        public void reportKafkaPartitionStart​(SnowflakeTelemetryBasicInfo partitionCreation)
        report connector partition start
        Parameters:
        partitionCreation - SnowflakeTelemetryBasicInfo object
      • getDefaultObjectNode

        protected net.snowflake.client.jdbc.internal.fasterxml.jackson.databind.node.ObjectNode getDefaultObjectNode​(IngestionMethodConfig ingestionMethodConfig)
        This is the minimum JsonNode which will be present in each telemetry Payload. Format:
         {
          "app_name": "",
          "task_id": 1,
          "snowflake.ingestion.method": "" for IngestionMethodConfig
         }
         
        Returns:
        An ObjectNode which is by default always created with certain defined properties in it.
      • send

        protected void send​(SnowflakeTelemetryService.TelemetryType type,
                            net.snowflake.client.jdbc.internal.fasterxml.jackson.databind.JsonNode data)
        JsonNode data is wrapped into another ObjectNode which looks like this:
           {
           "data": {
             "app_name": "",
             "task_id": "-1"
           },
           "source": "kafka_connector",
           "type": "kafka_start/",
           "version": "snowflake_kc_version"
         }
        
         
        Parameters:
        type - type of Data
        data - JsonData to wrap in a json field called data
      • addUserConnectorPropertiesToDataNode

        protected void addUserConnectorPropertiesToDataNode​(Map<String,​String> userProvidedConfig,
                                                            net.snowflake.client.jdbc.internal.fasterxml.jackson.databind.node.ObjectNode dataObjectNode)
        Adds specific user provided connector properties to ObjectNode
        Parameters:
        userProvidedConfig - user provided key value pairs in a Map
        dataObjectNode - Object node in which specific properties to add