@@ -115,11 +115,13 @@ void createMetricDescriptor(String type) throws IOException {
115115 * @param name Name of metric descriptor to delete
116116 */
117117 void deleteMetricDescriptor (String name ) throws IOException {
118+ // [START monitoring_delete_metric]
118119 String projectId = System .getProperty ("projectId" );
119120 final MetricServiceClient client = MetricServiceClient .create ();
120121 MetricDescriptorName metricName = MetricDescriptorName .create (projectId , name );
121122 client .deleteMetricDescriptor (metricName );
122123 System .out .println ("Deleted descriptor " + name );
124+ // [END monitoring_delete_metric]
123125 }
124126
125127 /**
@@ -447,15 +449,15 @@ void listMonitoredResources() throws IOException {
447449 for (MonitoredResourceDescriptor d : descriptors ) {
448450 System .out .println (d .getType ());
449451 }
450- // [START monitoring_list_resources]
452+ // [END monitoring_list_resources]
451453 }
452454
453455 /**
454456 * Gets full information for a monitored resource.
455457 * @param The resource type
456458 */
457459 void describeMonitoredResources (String type ) throws IOException {
458- // [START monitoring_list_resources ]
460+ // [START monitoring_get_descriptor ]
459461 // Your Google Cloud Platform project ID
460462 String projectId = System .getProperty ("projectId" );
461463
@@ -465,8 +467,7 @@ void describeMonitoredResources(String type) throws IOException {
465467
466468 System .out .println ("Printing monitored resource descriptor: " );
467469 System .out .println (response );
468-
469- // [END monitoring_list_resources]
470+ // [END monitoring_get_descriptor]
470471 }
471472
472473
0 commit comments