code: private int getMetricInfo(final MetricIdentity identity, final AppIdentity appIdentity) throws IOException, HttpException {
  		Preconditions.checkNotNull(identity);
  		Preconditions.checkNotNull(appIdentity);
  		
  		// build the json objects
  		
  		JsonGetMetricInfoRequest.Builder requestBuilder = JsonGetMetricInfoRequest.newBuilder();
  		requestBuilder.category(identity.getCategory());
  		requestBuilder.metricName(identity.getName());
  		requestBuilder.deviceId(appIdentity.getDeviceId());
  		requestBuilder.deviceAppId(appIdentity.getDeviceAppId());
  		requestBuilder.appNameId(appIdentity.getAppNameId());
  		requestBuilder.metricTypeId(identity.getType().getId());
  		
  		JsonGetMetricInfoRequest request = requestBuilder.build();
  		
  		// convert to json bytes
  				
  		byte[] jsonBytes = objectMapper.writer().writeValueAsBytes(request);
  		
  		if (LOGGER.isDebugEnabled())
  		{
  			LOGGER.debug("GetMetricInfo Request: {}", new String(jsonBytes, "UTF-8"));
  		}
  
  		// post to stackify
  		
  		HttpClient httpClient = new HttpClient(apiConfig);
  		String responseString = httpClient.post("/Metrics/GetMetricInfo", jsonBytes);
  		
  		LOGGER.debug("GetMetricInfo Response: {}", responseString);
  
  		// deserialize the response and return the monitor id
  		
  		ObjectReader jsonReader = objectMapper.reader(new TypeReference<JsonGetMetricInfoResponse>(){});
  		JsonGetMetricInfoResponse response = jsonReader.readValue(responseString);
  		
  		if (response != null) {
  			return response.getMonitorId();
  		}
  		
  		return 0;
  	}
docs: Gets the monitor id for this metric
  @param identity The metric identity
  @return The monitor id (optional)
  @throws IOException
  @throws HttpException