mik-laj commented on a change in pull request #6660: [AIRFLOW-6065] Add Stackdriver Task Handler URL: https://github.com/apache/airflow/pull/6660#discussion_r354521673
########## File path: airflow/utils/log/stackdriver_task_handler.py ########## @@ -0,0 +1,286 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +""" +Handler that integrates with Stackdriver +""" +import logging +from typing import Dict, List, Optional, Tuple, Type + +from cached_property import cached_property +from google.api_core.gapic_v1.client_info import ClientInfo +from google.cloud import logging as gcp_logging +from google.cloud.logging.handlers.transports import BackgroundThreadTransport, Transport +from google.cloud.logging.resource import Resource + +from airflow import version +from airflow.models import TaskInstance + +DEFAULT_LOGGER_NAME = "airflow" +_GLOBAL_RESOURCE = Resource(type="global", labels={}) + + +class StackdriverTaskHandler(logging.Handler): Review comment: I'd rather stick to the project's naming convention. All classes that allow to read logs for tasks have the TaskHandler suffix Elasticsearch**TaskHandler** File**TaskHandler** GCS**TaskHandler** S3**TaskHandler** Wasb**TaskHandler** We can change it, but I'm afraid it would require public discussion on the mailing list. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
