# Google Cloud Logging v2 API - Class MetricsServiceV2ClientBuilder (4.5.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [4.5.0 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Logging.V2/latest/Google.Cloud.Logging.V2.MetricsServiceV2ClientBuilder)
- [4.4.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Logging.V2/4.4.0/Google.Cloud.Logging.V2.MetricsServiceV2ClientBuilder)
- [4.3.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Logging.V2/4.3.0/Google.Cloud.Logging.V2.MetricsServiceV2ClientBuilder)
- [4.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Logging.V2/4.2.0/Google.Cloud.Logging.V2.MetricsServiceV2ClientBuilder)
- [4.1.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Logging.V2/4.1.0/Google.Cloud.Logging.V2.MetricsServiceV2ClientBuilder)
- [4.0.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Logging.V2/4.0.0/Google.Cloud.Logging.V2.MetricsServiceV2ClientBuilder)
- [3.6.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Logging.V2/3.6.0/Google.Cloud.Logging.V2.MetricsServiceV2ClientBuilder)
- [3.5.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Logging.V2/3.5.0/Google.Cloud.Logging.V2.MetricsServiceV2ClientBuilder)
- [3.4.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Logging.V2/3.4.0/Google.Cloud.Logging.V2.MetricsServiceV2ClientBuilder)
- [3.3.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Logging.V2/3.3.0/Google.Cloud.Logging.V2.MetricsServiceV2ClientBuilder)

    public sealed class MetricsServiceV2ClientBuilder : ClientBuilderBase<MetricsServiceV2Client>

Reference documentation and code samples for the Google Cloud Logging v2 API class MetricsServiceV2ClientBuilder.

Builder class for [MetricsServiceV2Client](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Logging.V2/latest/Google.Cloud.Logging.V2.MetricsServiceV2Client) to provide simple configuration of credentials, endpoint
etc.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> [ClientBuilderBase](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.ClientBuilderBase-1.html)[MetricsServiceV2Client](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Logging.V2/latest/Google.Cloud.Logging.V2.MetricsServiceV2Client) \> MetricsServiceV2ClientBuilder

## Inherited Members

[ClientBuilderBase\<MetricsServiceV2Client\>.Build(IServiceProvider)](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.ClientBuilderBase-1.html#Google_Api_Gax_Grpc_ClientBuilderBase_1_Build_System_IServiceProvider_) [ClientBuilderBase\<MetricsServiceV2Client\>.BuildAsync(IServiceProvider, CancellationToken)](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.ClientBuilderBase-1.html#Google_Api_Gax_Grpc_ClientBuilderBase_1_BuildAsync_System_IServiceProvider_System_Threading_CancellationToken_) [ClientBuilderBase\<MetricsServiceV2Client\>.UniverseDomain](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.ClientBuilderBase-1.html#Google_Api_Gax_Grpc_ClientBuilderBase_1_UniverseDomain) [ClientBuilderBase\<MetricsServiceV2Client\>.Endpoint](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.ClientBuilderBase-1.html#Google_Api_Gax_Grpc_ClientBuilderBase_1_Endpoint) [ClientBuilderBase\<MetricsServiceV2Client\>.Logger](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.ClientBuilderBase-1.html#Google_Api_Gax_Grpc_ClientBuilderBase_1_Logger) [ClientBuilderBase\<MetricsServiceV2Client\>.Scopes](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.ClientBuilderBase-1.html#Google_Api_Gax_Grpc_ClientBuilderBase_1_Scopes) [ClientBuilderBase\<MetricsServiceV2Client\>.ChannelCredentials](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.ClientBuilderBase-1.html#Google_Api_Gax_Grpc_ClientBuilderBase_1_ChannelCredentials) [ClientBuilderBase\<MetricsServiceV2Client\>.CredentialsPath](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.ClientBuilderBase-1.html#Google_Api_Gax_Grpc_ClientBuilderBase_1_CredentialsPath) [ClientBuilderBase\<MetricsServiceV2Client\>.JsonCredentials](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.ClientBuilderBase-1.html#Google_Api_Gax_Grpc_ClientBuilderBase_1_JsonCredentials) [ClientBuilderBase\<MetricsServiceV2Client\>.GoogleCredential](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.ClientBuilderBase-1.html#Google_Api_Gax_Grpc_ClientBuilderBase_1_GoogleCredential) [ClientBuilderBase\<MetricsServiceV2Client\>.Credential](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.ClientBuilderBase-1.html#Google_Api_Gax_Grpc_ClientBuilderBase_1_Credential) [ClientBuilderBase\<MetricsServiceV2Client\>.TokenAccessMethod](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.ClientBuilderBase-1.html#Google_Api_Gax_Grpc_ClientBuilderBase_1_TokenAccessMethod) [ClientBuilderBase\<MetricsServiceV2Client\>.CallInvoker](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.ClientBuilderBase-1.html#Google_Api_Gax_Grpc_ClientBuilderBase_1_CallInvoker) [ClientBuilderBase\<MetricsServiceV2Client\>.UserAgent](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.ClientBuilderBase-1.html#Google_Api_Gax_Grpc_ClientBuilderBase_1_UserAgent) [ClientBuilderBase\<MetricsServiceV2Client\>.GrpcAdapter](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.ClientBuilderBase-1.html#Google_Api_Gax_Grpc_ClientBuilderBase_1_GrpcAdapter) [ClientBuilderBase\<MetricsServiceV2Client\>.ApiKey](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.ClientBuilderBase-1.html#Google_Api_Gax_Grpc_ClientBuilderBase_1_ApiKey) [ClientBuilderBase\<MetricsServiceV2Client\>.QuotaProject](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.ClientBuilderBase-1.html#Google_Api_Gax_Grpc_ClientBuilderBase_1_QuotaProject) [ClientBuilderBase\<MetricsServiceV2Client\>.GrpcChannelOptions](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.ClientBuilderBase-1.html#Google_Api_Gax_Grpc_ClientBuilderBase_1_GrpcChannelOptions) [ClientBuilderBase\<MetricsServiceV2Client\>.LastCreatedChannel](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.ClientBuilderBase-1.html#Google_Api_Gax_Grpc_ClientBuilderBase_1_LastCreatedChannel) [ClientBuilderBase\<MetricsServiceV2Client\>.UseJwtAccessWithScopes](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.ClientBuilderBase-1.html#Google_Api_Gax_Grpc_ClientBuilderBase_1_UseJwtAccessWithScopes) [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.Logging.V2](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Logging.V2/latest/Google.Cloud.Logging.V2)

## Assembly

Google.Cloud.Logging.V2.dll

## Constructors

### MetricsServiceV2ClientBuilder()

    public MetricsServiceV2ClientBuilder()

Creates a new builder with default settings.

## Properties

### Settings

    public MetricsServiceV2Settings Settings { get; set; }

The settings to use for RPCs, or `null` for the default settings.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Logging.V2/latest/Google.Cloud.Logging.V2.MetricsServiceV2Settings` |   |

## Methods

### Build()

    public override MetricsServiceV2Client Build()

Builds the resulting client.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Logging.V2/latest/Google.Cloud.Logging.V2.MetricsServiceV2Client` |   |

**Overrides** Google.Api.Gax.Grpc.ClientBuilderBase\<Google.Cloud.Logging.V2.MetricsServiceV2Client\>.Build()

### BuildAsync(CancellationToken)

    public override Task<MetricsServiceV2Client> BuildAsync(CancellationToken cancellationToken = default)

Builds the resulting client asynchronously.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Logging.V2/latest/Google.Cloud.Logging.V2.MetricsServiceV2Client` |   |

**Overrides** Google.Api.Gax.Grpc.ClientBuilderBase\<Google.Cloud.Logging.V2.MetricsServiceV2Client\>.BuildAsync(System.Threading.CancellationToken)

### GetChannelPool()

    protected override ChannelPool GetChannelPool()

Returns the channel pool to use when no other options are specified.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.ChannelPool.html` |   |

**Overrides** Google.Api.Gax.Grpc.ClientBuilderBase\<Google.Cloud.Logging.V2.MetricsServiceV2Client\>.GetChannelPool()