diff --git a/sf_notifier/salesforce/client.py b/sf_notifier/salesforce/client.py
index 319488d..79a6467 100644
--- a/sf_notifier/salesforce/client.py
+++ b/sf_notifier/salesforce/client.py
@@ -18,6 +18,8 @@
 import os
 import uuid
 
+from prometheus_client import Counter, Gauge
+
 import requests
 
 from simple_salesforce import Salesforce
@@ -66,6 +68,11 @@
 class SalesforceClient(object):
 
     def __init__(self, config):
+        self.metrics = {
+            'sf_auth_ok': Gauge('sf_auth_ok', 'sf-notifier'),
+            'sf_error_count': Counter('sf_error_count', 'sf-notifier'),
+            'sf_request_count': Counter('sf_request_count', 'sf-notifier')
+        }
         self.session = requests.Session()
         self.config = self._validate_config(config)
         self.environment = self.config.pop('environment_id')
@@ -103,8 +110,10 @@
             self.sf = Salesforce(**kwargs)
         except sf_exceptions.SalesforceAuthenticationFailed:
             logger.error('Salesforce authentication failure.')
+            self.metrics['sf_auth_ok'].set(0)
             return
         logger.info('Salesforce authentication successful.')
+        self.metrics['sf_auth_ok'].set(1)
 
     @staticmethod
     def _get_alert_id(labels):
@@ -117,7 +126,7 @@
     def _create_case(self, subject, body, labels, alert_id):
 
         if alert_id in self._registered_alerts:
-            logger.info('Duplicate case for alert: {}.'.format(alert_id))
+            logger.warning('Duplicate case for alert: {}.'.format(alert_id))
             return 1, self._registered_alerts[alert_id]['Id']
 
         severity = labels.get('severity', 'unknown').upper()
@@ -133,9 +142,11 @@
             'Environment2__c': self.environment,
             'Alert_ID__c': alert_id,
         }
-        logger.info('Try to create case: {}'.format(payload))
+        logger.info('Try to create case: {}.'.format(payload))
         try:
+            self.metrics['sf_request_count'].inc()
             case = self.sf.Case.create(payload)
+            logger.info('Created case: {}.'.format(case))
         except sf_exceptions.SalesforceMalformedRequest as ex:
             msg = ex.content[0]['message']
             err_code = ex.content[0]['errorCode']
@@ -146,22 +157,16 @@
                 self._registered_alerts[alert_id] = {'Id': case_id}
                 return 1, case_id
             else:
+                self.metrics['sf_error_count'].inc()
                 raise
 
         self._registered_alerts[alert_id] = {'Id': case['id']}
         return 0, case['id']
 
     @sf_auth_retry
-    def _get_case(self, case_id):
-        return self.sf.Case.get(case_id)
-
-    @sf_auth_retry
-    def _update_case(self, case_id, data):
-        return self.sf.Case.update(case_id, data)
-
-    @sf_auth_retry
     def _close_case(self, case_id):
         logger.info('Try to close case: {}.'.format(case_id))
+        self.metrics['sf_request_count'].inc()
         update = self.sf.Case.update(
             case_id,
             {'Status': 'Auto-solved', 'Alert_ID__c': uuid.uuid4().hex}
