def sample_update_log_metric():
    # Create a client
    client = logging_v2.MetricsServiceV2Client()

    # Initialize request argument(s)
    metric = logging_v2.LogMetric()
    metric.name = "name_value"
    metric.filter = "filter_value"

    request = logging_v2.UpdateLogMetricRequest(
        metric_name="metric_name_value",
        metric=metric,
    )

    # Make the request
    response = client.update_log_metric(request=request)

    # Handle the response
    print(response)
async def sample_create_log_metric():
    # Create a client
    client = logging_v2.MetricsServiceV2AsyncClient()

    # Initialize request argument(s)
    metric = logging_v2.LogMetric()
    metric.name = "name_value"
    metric.filter = "filter_value"

    request = logging_v2.CreateLogMetricRequest(
        parent="parent_value",
        metric=metric,
    )

    # Make the request
    response = await client.create_log_metric(request=request)

    # Handle the response
    print(response)