diff --git a/drm/libmediadrm/DrmMetrics.cpp b/drm/libmediadrm/DrmMetrics.cpp
index f536545..68730b7 100644
--- a/drm/libmediadrm/DrmMetrics.cpp
+++ b/drm/libmediadrm/DrmMetrics.cpp
@@ -14,13 +14,46 @@
  * limitations under the License.
  */
 
+#include <android-base/macros.h>
 #include <media/DrmMetrics.h>
 
+using ::android::hardware::drm::V1_0::EventType;
+using ::android::hardware::drm::V1_0::KeyStatusType;
+
 namespace {
 
 template<typename T>
+std::string GetAttributeName(T type);
+
+template<>
+std::string GetAttributeName<KeyStatusType>(KeyStatusType type) {
+  static const char* type_names[] = {
+      "USABLE", "EXPIRED", "OUTPUT_NOT_ALLOWED",
+      "STATUS_PENDING", "INTERNAL_ERROR" };
+  if (((size_t) type) > arraysize(type_names)) {
+    return "UNKNOWN_TYPE";
+  }
+  return type_names[(size_t) type];
+}
+
+template<>
+std::string GetAttributeName<EventType>(EventType type) {
+  static const char* type_names[] = {
+      "PROVISION_REQUIRED", "KEY_NEEDED", "KEY_EXPIRED",
+      "VENDOR_DEFINED", "SESSION_RECLAIMED" };
+  if (((size_t) type) > arraysize(type_names)) {
+    return "UNKNOWN_TYPE";
+  }
+  return type_names[(size_t) type];
+}
+
+template<typename T>
 void ExportCounterMetric(const android::CounterMetric<T>& counter,
                          android::MediaAnalyticsItem* item) {
+  if (!item) {
+    ALOGE("item was unexpectedly null.");
+    return;
+  }
   std::string success_count_name = counter.metric_name() + "/ok/count";
   std::string error_count_name = counter.metric_name() + "/error/count";
   counter.ExportValues(
@@ -38,11 +71,31 @@
 }
 
 template<typename T>
+void ExportCounterMetricWithAttributeNames(
+    const android::CounterMetric<T>& counter,
+    android::MediaAnalyticsItem* item) {
+  if (!item) {
+    ALOGE("item was unexpectedly null.");
+    return;
+  }
+  counter.ExportValues(
+      [&] (const T& attribute, const int64_t value) {
+          std::string name = counter.metric_name()
+              + "/" + GetAttributeName(attribute) + "/count";
+          item->setInt64(name.c_str(), value);
+      });
+}
+
+template<typename T>
 void ExportEventMetric(const android::EventMetric<T>& event,
                        android::MediaAnalyticsItem* item) {
+  if (!item) {
+    ALOGE("item was unexpectedly null.");
+    return;
+  }
   std::string success_count_name = event.metric_name() + "/ok/count";
   std::string error_count_name = event.metric_name() + "/error/count";
-  std::string timing_name = event.metric_name() + "/average_time_micros";
+  std::string timing_name = event.metric_name() + "/ok/average_time_micros";
   event.ExportValues(
       [&] (const android::status_t& status,
            const android::EventStatistics& value) {
@@ -66,12 +119,34 @@
 
 MediaDrmMetrics::MediaDrmMetrics()
     : mOpenSessionCounter("/drm/mediadrm/open_session", "status"),
-      mGetKeyRequestTiming("/drm/mediadrm/get_key_request", "status") {
+      mCloseSessionCounter("/drm/mediadrm/close_session", "status"),
+      mGetKeyRequestTiming("/drm/mediadrm/get_key_request", "status"),
+      mProvideKeyResponseTiming("/drm/mediadrm/provide_key_response", "status"),
+      mGetProvisionRequestCounter(
+          "/drm/mediadrm/get_provision_request", "status"),
+      mProvideProvisionResponseCounter(
+          "/drm/mediadrm/provide_provision_response", "status"),
+      mKeyStatusChangeCounter(
+          "/drm/mediadrm/key_status_change", "key_status_type"),
+      mEventCounter("/drm/mediadrm/event", "event_type"),
+      mGetDeviceUniqueIdCounter(
+          "/drm/mediadrm/get_device_unique_id", "status") {
 }
 
 void MediaDrmMetrics::Export(MediaAnalyticsItem* item) {
+  if (!item) {
+    ALOGE("item was unexpectedly null.");
+    return;
+  }
   ExportCounterMetric(mOpenSessionCounter, item);
+  ExportCounterMetric(mCloseSessionCounter, item);
   ExportEventMetric(mGetKeyRequestTiming, item);
+  ExportEventMetric(mProvideKeyResponseTiming, item);
+  ExportCounterMetric(mGetProvisionRequestCounter, item);
+  ExportCounterMetric(mProvideProvisionResponseCounter, item);
+  ExportCounterMetricWithAttributeNames(mKeyStatusChangeCounter, item);
+  ExportCounterMetricWithAttributeNames(mEventCounter, item);
+  ExportCounterMetric(mGetDeviceUniqueIdCounter, item);
 }
 
 }  // namespace android
