Note:
This documentation is for version 3.15.0 of the library.
Some samples may not work with other versions.
Installation
Install the Google.Cloud.Monitoring.V3 package from NuGet. Add it to
your project in the normal way (for example by right-clicking on the
project in Visual Studio and choosing "Manage NuGet Packages...").
Authentication
When running on Google Cloud, no action needs to be taken to authenticate.
Otherwise, the simplest way of authenticating your API calls is to
set up Application Default Credentials.
The credentials will automatically be used to authenticate. See
Set up Application Default Credentials for more details.
Getting started
All operations are performed through the following client classes:
Create a client instance by calling the static Create or CreateAsync methods. Alternatively,
use the builder class associated with each client class (e.g. AlertPolicyServiceClientBuilder for AlertPolicyServiceClient)
as an easy way of specifying custom credentials, settings, or a custom endpoint. Clients are thread-safe,
and we recommend using a single instance across your entire application unless you have a particular need
to configure multiple client objects separately.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eGoogle.Cloud.Monitoring.V3\u003c/code\u003e library is a .NET client for interacting with the Google Cloud Monitoring API, with version 3.15.0 being the latest release.\u003c/p\u003e\n"],["\u003cp\u003eThe library is available via NuGet and can be easily installed into a .NET project through the standard package management tools.\u003c/p\u003e\n"],["\u003cp\u003eAuthentication with the API is seamless on Google Cloud and, otherwise, can be configured using Application Default Credentials.\u003c/p\u003e\n"],["\u003cp\u003eThe library offers multiple client classes, such as \u003ccode\u003eMetricServiceClient\u003c/code\u003e and \u003ccode\u003eGroupServiceClient\u003c/code\u003e, each providing operations to manage different aspects of Google Cloud Monitoring.\u003c/p\u003e\n"],["\u003cp\u003eClient instances are thread-safe and it is recommended to create a single instance for use throughout an entire application, simplifying client management.\u003c/p\u003e\n"]]],[],null,["Version latestkeyboard_arrow_down\n\n- [3.15.0 (latest)](/dotnet/docs/reference/Google.Cloud.Monitoring.V3/latest)\n- [3.14.0](/dotnet/docs/reference/Google.Cloud.Monitoring.V3/3.14.0)\n- [3.13.0](/dotnet/docs/reference/Google.Cloud.Monitoring.V3/3.13.0)\n- [3.12.0](/dotnet/docs/reference/Google.Cloud.Monitoring.V3/3.12.0)\n- [3.11.0](/dotnet/docs/reference/Google.Cloud.Monitoring.V3/3.11.0)\n- [3.10.0](/dotnet/docs/reference/Google.Cloud.Monitoring.V3/3.10.0)\n- [3.9.0](/dotnet/docs/reference/Google.Cloud.Monitoring.V3/3.9.0)\n- [3.8.0](/dotnet/docs/reference/Google.Cloud.Monitoring.V3/3.8.0)\n- [3.7.0](/dotnet/docs/reference/Google.Cloud.Monitoring.V3/3.7.0)\n- [3.6.0](/dotnet/docs/reference/Google.Cloud.Monitoring.V3/3.6.0)\n- [3.5.0](/dotnet/docs/reference/Google.Cloud.Monitoring.V3/3.5.0)\n- [3.4.0](/dotnet/docs/reference/Google.Cloud.Monitoring.V3/3.4.0)\n- [3.3.0](/dotnet/docs/reference/Google.Cloud.Monitoring.V3/3.3.0)\n- [3.2.0](/dotnet/docs/reference/Google.Cloud.Monitoring.V3/3.2.0)\n- [3.1.0](/dotnet/docs/reference/Google.Cloud.Monitoring.V3/3.1.0)\n- [3.0.0](/dotnet/docs/reference/Google.Cloud.Monitoring.V3/3.0.0)\n- [2.6.0](/dotnet/docs/reference/Google.Cloud.Monitoring.V3/2.6.0)\n- [2.5.0](/dotnet/docs/reference/Google.Cloud.Monitoring.V3/2.5.0)\n- [2.4.0](/dotnet/docs/reference/Google.Cloud.Monitoring.V3/2.4.0)\n- [2.3.0](/dotnet/docs/reference/Google.Cloud.Monitoring.V3/2.3.0) \n\nGoogle.Cloud.Monitoring.V3\n==========================\n\n`Google.Cloud.Monitoring.V3` is a.NET client library for the [Google Cloud Monitoring API](https://cloud.google.com/monitoring/api/v3/).\n\nNote:\nThis documentation is for version `3.15.0` of the library.\nSome samples may not work with other versions.\n\nInstallation\n------------\n\nInstall the `Google.Cloud.Monitoring.V3` package from NuGet. Add it to\nyour project in the normal way (for example by right-clicking on the\nproject in Visual Studio and choosing \"Manage NuGet Packages...\").\n\nAuthentication\n--------------\n\nWhen running on Google Cloud, no action needs to be taken to authenticate.\n\nOtherwise, the simplest way of authenticating your API calls is to\nset up Application Default Credentials.\nThe credentials will automatically be used to authenticate. See\n[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc) for more details.\n\nGetting started\n---------------\n\nAll operations are performed through the following client classes:\n\n- [AlertPolicyServiceClient](/dotnet/docs/reference/Google.Cloud.Monitoring.V3/latest/Google.Cloud.Monitoring.V3.AlertPolicyServiceClient)\n- [GroupServiceClient](/dotnet/docs/reference/Google.Cloud.Monitoring.V3/latest/Google.Cloud.Monitoring.V3.GroupServiceClient)\n- [MetricServiceClient](/dotnet/docs/reference/Google.Cloud.Monitoring.V3/latest/Google.Cloud.Monitoring.V3.MetricServiceClient)\n- [NotificationChannelServiceClient](/dotnet/docs/reference/Google.Cloud.Monitoring.V3/latest/Google.Cloud.Monitoring.V3.NotificationChannelServiceClient)\n- [QueryServiceClient](/dotnet/docs/reference/Google.Cloud.Monitoring.V3/latest/Google.Cloud.Monitoring.V3.QueryServiceClient)\n- [ServiceMonitoringServiceClient](/dotnet/docs/reference/Google.Cloud.Monitoring.V3/latest/Google.Cloud.Monitoring.V3.ServiceMonitoringServiceClient)\n- [SnoozeServiceClient](/dotnet/docs/reference/Google.Cloud.Monitoring.V3/latest/Google.Cloud.Monitoring.V3.SnoozeServiceClient)\n- [UptimeCheckServiceClient](/dotnet/docs/reference/Google.Cloud.Monitoring.V3/latest/Google.Cloud.Monitoring.V3.UptimeCheckServiceClient)\n\nCreate a client instance by calling the static `Create` or `CreateAsync` methods. Alternatively,\nuse the builder class associated with each client class (e.g. AlertPolicyServiceClientBuilder for AlertPolicyServiceClient)\nas an easy way of specifying custom credentials, settings, or a custom endpoint. Clients are thread-safe,\nand we recommend using a single instance across your entire application unless you have a particular need\nto configure multiple client objects separately.\n\nSample code\n-----------\n\nList metric descriptors\n-----------------------\n\n MetricServiceClient client = MetricServiceClient.Create();\n ProjectName projectName = ProjectName.FromProject(projectId);\n PagedEnumerable\u003cListMetricDescriptorsResponse, MetricDescriptor\u003e metrics = client.ListMetricDescriptors(projectName);\n foreach (MetricDescriptor metric in metrics.Take(10))\n {\n Console.WriteLine($\"{metric.Name}: {metric.DisplayName}\");\n }\n\nList groups\n-----------\n\n GroupServiceClient client = GroupServiceClient.Create();\n ProjectName projectName = ProjectName.FromProject(projectId);\n PagedEnumerable\u003cListGroupsResponse, Group\u003e groups = client.ListGroups(projectName);\n foreach (Group group in groups.Take(10))\n {\n Console.WriteLine($\"{group.Name}: {group.DisplayName}\");\n }"]]