Сократите затраты на регистрацию

После включения ведения журналов вы сами должны настроить маршрутизацию, хранение и сохранение ваших журналов. Превышение лимитов использования и хранения журналов может повлечь за собой дополнительные расходы Google Cloud на их обработку и хранение. См. информацию о ценах на Google Cloud Observability .

However, you can control logging costs by using any of the following approaches described in the following sections.

Сократить использование логов

You can limit the amount of log data that is ingested by excluding certain log entries. See Excluding logs for more details.

The following examples demonstrate common Fleet Engine scenarios and how to filter out specific log messages to reduce costs.

Фильтрация по методу

You can filter out read-only methods since these are typically not need for data analysis or troubleshooting.

The following command updates the _Default logging bucket to exclude GetVehicle logs.

gcloud logging sinks update _Default \
--add-exclusion=name=ExcludeFleetengineGetVehicle,\
filter='jsonPayload.@type:"type.googleapis.com/maps.fleetengine.v1.GetVehicleLog"'

The following command updates the _Default logging bucket to exclude GetTrip logs.

gcloud logging sinks update _Default \
--add-exclusion=name=ExcludeFleetengineGetTrip,filter=\
'jsonPayload.@type:"type.googleapis.com/maps.fleetengine.v1.GetTripLog"'

Создайте атрибут отладки.

You can reduce logs to specific vehicles only by setting a debug attribute . Any vehicle that does not have the debug attribute will now be excluded.

The following command updates the _Default logging bucket to exclude vehicles without the debug attribute from the UpdateVehicle logs.

gcloud logging sinks update _Default \
--add-exclusion=name=ExcludeFleetengineNonDebug,\
filter='resource.type="fleetengine.googleapis.com/Fleet"
log_name:"logs/fleetengine.googleapis.com%2Fupdate_vehicle"
jsonPayload.@type="type.googleapis.com/maps.fleetengine.v1.UpdateVehicleLog"
NOT jsonPayload.response.attributes.key="debug"'

Отфильтровать пустые журналы ограниченного использования

При включении этой функции журналы ограниченного использования создают дочерний журнал для каждого обычного журнала, даже если операция не заполняет поля ограниченного доступа. Фильтрация этих пустых журналов ограниченного использования может снизить затраты.

The following command updates the RestrictedLogs logging bucket to exclude empty restricted UpdateVehicle logs.

gcloud logging sinks update RestrictedLogs \
--add-exclusion=name=ExcludeFleetengineEmptyRestrictedVehicleLogs,\
filter='resource.type="fleetengine.googleapis.com/Fleet"
log_name:"logs/fleetengine.googleapis.com%2Fupdate_vehicle_restricted"
NOT jsonPayload.request.vehicle.currentRouteSegment:*
NOT jsonPayload.response.currentRouteSegment:*
NOT jsonPayload.response.waypoints:*'

Экспорт или журналы маршрутизации

Вы можете перенаправлять журналы в другие облачные сервисы Google Cloud или во внешние хранилища, чтобы избежать стандартных затрат на прием и хранение. Обязательно отключите прием журналов, как описано в следующем разделе, чтобы избежать этих затрат.

См. разделы «Экспорт журналов в облако» и «Экспорт журналов» .

Отключите прием логов.

If you don't intend to use Fleet Engine logs, you can avoid potential Cloud Logging charges by turning off ingestion. By default, Fleet Engine logs are routed to the _Default log bucket.

The following command updates the _Default logging bucket to not ingest Fleet Engine logs.

    gcloud logging sinks update _Default \
    --log-filter='NOT LOG_ID("cloudaudit.googleapis.com/activity")
    AND NOT LOG_ID("externalaudit.googleapis.com/activity")
    AND NOT LOG_ID("cloudaudit.googleapis.com/system_event")
    AND NOT LOG_ID("externalaudit.googleapis.com/system_event")
    AND NOT LOG_ID("cloudaudit.googleapis.com/access_transparency")
    AND NOT LOG_ID("externalaudit.googleapis.com/access_transparency")
    AND NOT resource.type:"fleetengine.googleapis.com"'

See also Four steps to managing your Cloud Logging costs on a budget .