public void ListMetricDescriptors() { string projectId = _fixture.ProjectId; // Snippet: ListMetricDescriptors MetricServiceClient client = MetricServiceClient.Create(); string projectName = MetricServiceClient.FormatProjectName(projectId); string filter = ""; IPagedEnumerable <ListMetricDescriptorsResponse, MetricDescriptor> metrics = client.ListMetricDescriptors(projectName, filter); foreach (MetricDescriptor metric in metrics.Take(10)) { Console.WriteLine($"{metric.Name}: {metric.DisplayName}"); } // End snippet }
public void ListTraces() { string projectId = _fixture.ProjectId; // Snippet: ListTraces TraceServiceClient client = TraceServiceClient.Create(); IPagedEnumerable <ListTracesResponse, Trace> traces = client.ListTraces(projectId); foreach (Trace trace in traces.Take(10)) { Console.WriteLine($"{trace.TraceId}:"); foreach (TraceSpan span in trace.Spans) { Console.WriteLine($" {span.StartTime}-{span.EndTime}: {span.Kind}"); } } // End snippet }