private static Map<String, String> getMetadata(ConsulDiscoveryProperties properties) {
		LinkedHashMap<String, String> metadata = new LinkedHashMap<>();
		if (!CollectionUtils.isEmpty(properties.getMetadata())) {
			metadata.putAll(properties.getMetadata());
		}

		// add metadata from other properties. See createTags above.
		if (StringUtils.hasLength(properties.getInstanceZone())) {
			metadata.put(properties.getDefaultZoneMetadataName(),
					properties.getInstanceZone());
		}
		if (StringUtils.hasLength(properties.getInstanceGroup())) {
			metadata.put("group", properties.getInstanceGroup());
		}

		// store the secure flag in the tags so that clients will be able to figure
		// out whether to use http or https automatically
		metadata.put("secure",
				Boolean.toString(properties.getScheme().equalsIgnoreCase("https")));

		return metadata;
	}
copyed from
org.springframework.cloud.consul.serviceregistry.ConsulAutoRegistration#getMetadata.
spring-cloud-alibaba-starters/spring-cloud-starter-alibaba-sidecar/src/main/java/com/alibaba/cloud/sidecar/consul/SidecarConsulAutoRegistration.java