# Google Cloud Logging v2 API - Class MetricsServiceV2.MetricsServiceV2Base (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.MetricsServiceV2.MetricsServiceV2Base)
- [4.4.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Logging.V2/4.4.0/Google.Cloud.Logging.V2.MetricsServiceV2.MetricsServiceV2Base)
- [4.3.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Logging.V2/4.3.0/Google.Cloud.Logging.V2.MetricsServiceV2.MetricsServiceV2Base)
- [4.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Logging.V2/4.2.0/Google.Cloud.Logging.V2.MetricsServiceV2.MetricsServiceV2Base)
- [4.1.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Logging.V2/4.1.0/Google.Cloud.Logging.V2.MetricsServiceV2.MetricsServiceV2Base)
- [4.0.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Logging.V2/4.0.0/Google.Cloud.Logging.V2.MetricsServiceV2.MetricsServiceV2Base)
- [3.6.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Logging.V2/3.6.0/Google.Cloud.Logging.V2.MetricsServiceV2.MetricsServiceV2Base)
- [3.5.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Logging.V2/3.5.0/Google.Cloud.Logging.V2.MetricsServiceV2.MetricsServiceV2Base)
- [3.4.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Logging.V2/3.4.0/Google.Cloud.Logging.V2.MetricsServiceV2.MetricsServiceV2Base)
- [3.3.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Logging.V2/3.3.0/Google.Cloud.Logging.V2.MetricsServiceV2.MetricsServiceV2Base)

    [BindServiceMethod(typeof(MetricsServiceV2), "BindService")]
    public abstract class MetricsServiceV2.MetricsServiceV2Base

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

Base class for server-side implementations of MetricsServiceV2

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> MetricsServiceV2.MetricsServiceV2Base

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) [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

## Methods

### CreateLogMetric(CreateLogMetricRequest, ServerCallContext)

    public virtual Task<LogMetric> CreateLogMetric(CreateLogMetricRequest request, ServerCallContext context)

Creates a logs-based metric.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Logging.V2/latest/Google.Cloud.Logging.V2.CreateLogMetricRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **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.LogMetric` | The response to send back to the client (wrapped by a task). |

### DeleteLogMetric(DeleteLogMetricRequest, ServerCallContext)

    public virtual Task<Empty> DeleteLogMetric(DeleteLogMetricRequest request, ServerCallContext context)

Deletes a logs-based metric.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Logging.V2/latest/Google.Cloud.Logging.V2.DeleteLogMetricRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.WellKnownTypes.Empty.html` | The response to send back to the client (wrapped by a task). |

### GetLogMetric(GetLogMetricRequest, ServerCallContext)

    public virtual Task<LogMetric> GetLogMetric(GetLogMetricRequest request, ServerCallContext context)

Gets a logs-based metric.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Logging.V2/latest/Google.Cloud.Logging.V2.GetLogMetricRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **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.LogMetric` | The response to send back to the client (wrapped by a task). |

### ListLogMetrics(ListLogMetricsRequest, ServerCallContext)

    public virtual Task<ListLogMetricsResponse> ListLogMetrics(ListLogMetricsRequest request, ServerCallContext context)

Lists logs-based metrics.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Logging.V2/latest/Google.Cloud.Logging.V2.ListLogMetricsRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **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.ListLogMetricsResponse` | The response to send back to the client (wrapped by a task). |

### UpdateLogMetric(UpdateLogMetricRequest, ServerCallContext)

    public virtual Task<LogMetric> UpdateLogMetric(UpdateLogMetricRequest request, ServerCallContext context)

Creates or updates a logs-based metric.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Logging.V2/latest/Google.Cloud.Logging.V2.UpdateLogMetricRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **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.LogMetric` | The response to send back to the client (wrapped by a task). |