google-cloud-logging 3.7.0__tar.gz → 3.8.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {google-cloud-logging-3.7.0/google_cloud_logging.egg-info → google-cloud-logging-3.8.0}/PKG-INFO +1 -1
- {google-cloud-logging-3.7.0/google/cloud/logging_v2 → google-cloud-logging-3.8.0/google/cloud/logging}/gapic_version.py +1 -1
- {google-cloud-logging-3.7.0/google/cloud/logging → google-cloud-logging-3.8.0/google/cloud/logging_v2}/gapic_version.py +1 -1
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/handlers/_monitored_resources.py +36 -5
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0/google_cloud_logging.egg-info}/PKG-INFO +1 -1
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/tests/unit/handlers/test__monitored_resources.py +34 -6
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/LICENSE +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/MANIFEST.in +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/README.rst +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/__init__.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/__init__.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging/__init__.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging/handlers/__init__.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging/handlers/middleware/__init__.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging/handlers/transports/__init__.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging/py.typed +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/__init__.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/_gapic.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/_helpers.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/_http.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/_instrumentation.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/client.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/entries.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/gapic_metadata.json +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/handlers/__init__.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/handlers/_helpers.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/handlers/app_engine.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/handlers/container_engine.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/handlers/handlers.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/handlers/middleware/__init__.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/handlers/middleware/request.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/handlers/structured_log.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/handlers/transports/__init__.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/handlers/transports/background_thread.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/handlers/transports/base.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/handlers/transports/sync.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/logger.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/metric.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/py.typed +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/resource.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/services/__init__.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/services/config_service_v2/__init__.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/services/config_service_v2/async_client.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/services/config_service_v2/client.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/services/config_service_v2/pagers.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/services/config_service_v2/transports/__init__.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/services/config_service_v2/transports/base.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/services/config_service_v2/transports/grpc.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/services/config_service_v2/transports/grpc_asyncio.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/services/logging_service_v2/__init__.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/services/logging_service_v2/async_client.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/services/logging_service_v2/client.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/services/logging_service_v2/pagers.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/services/logging_service_v2/transports/__init__.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/services/logging_service_v2/transports/base.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/services/logging_service_v2/transports/grpc.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/services/logging_service_v2/transports/grpc_asyncio.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/services/metrics_service_v2/__init__.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/services/metrics_service_v2/async_client.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/services/metrics_service_v2/client.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/services/metrics_service_v2/pagers.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/services/metrics_service_v2/transports/__init__.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/services/metrics_service_v2/transports/base.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/services/metrics_service_v2/transports/grpc.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/services/metrics_service_v2/transports/grpc_asyncio.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/sink.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/types/__init__.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/types/log_entry.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/types/logging.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/types/logging_config.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/types/logging_metrics.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google_cloud_logging.egg-info/SOURCES.txt +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google_cloud_logging.egg-info/dependency_links.txt +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google_cloud_logging.egg-info/namespace_packages.txt +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google_cloud_logging.egg-info/not-zip-safe +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google_cloud_logging.egg-info/requires.txt +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google_cloud_logging.egg-info/top_level.txt +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/setup.cfg +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/setup.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/tests/__init__.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/tests/performance/noxfile.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/tests/performance/test_performance.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/tests/system/gapic/v2/test_system_logging_service_v2_v2.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/tests/system/test_system.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/tests/unit/__init__.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/tests/unit/gapic/__init__.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/tests/unit/gapic/logging_v2/__init__.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/tests/unit/gapic/logging_v2/test_config_service_v2.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/tests/unit/gapic/logging_v2/test_logging_service_v2.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/tests/unit/gapic/logging_v2/test_metrics_service_v2.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/tests/unit/handlers/__init__.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/tests/unit/handlers/middleware/test_request.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/tests/unit/handlers/test__helpers.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/tests/unit/handlers/test_app_engine.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/tests/unit/handlers/test_container_engine.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/tests/unit/handlers/test_handlers.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/tests/unit/handlers/test_structured_log.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/tests/unit/handlers/transports/__init__.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/tests/unit/handlers/transports/test_background_thread.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/tests/unit/handlers/transports/test_base.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/tests/unit/handlers/transports/test_sync.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/tests/unit/test__gapic.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/tests/unit/test__helpers.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/tests/unit/test__http.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/tests/unit/test__instrumentation.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/tests/unit/test_client.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/tests/unit/test_entries.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/tests/unit/test_logger.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/tests/unit/test_logging_shim.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/tests/unit/test_metric.py +0 -0
- {google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/tests/unit/test_sink.py +0 -0
|
@@ -26,11 +26,21 @@ _GAE_ENV_VARS = [_GAE_SERVICE_ENV, _GAE_VERSION_ENV, _GAE_INSTANCE_ENV]
|
|
|
26
26
|
_CLOUD_RUN_SERVICE_ID = "K_SERVICE"
|
|
27
27
|
_CLOUD_RUN_REVISION_ID = "K_REVISION"
|
|
28
28
|
_CLOUD_RUN_CONFIGURATION_ID = "K_CONFIGURATION"
|
|
29
|
-
|
|
29
|
+
_CLOUD_RUN_SERVICE_ENV_VARS = [
|
|
30
30
|
_CLOUD_RUN_SERVICE_ID,
|
|
31
31
|
_CLOUD_RUN_REVISION_ID,
|
|
32
32
|
_CLOUD_RUN_CONFIGURATION_ID,
|
|
33
33
|
]
|
|
34
|
+
_CLOUD_RUN_JOB_ID = "CLOUD_RUN_JOB"
|
|
35
|
+
_CLOUD_RUN_EXECUTION_ID = "CLOUD_RUN_EXECUTION"
|
|
36
|
+
_CLOUD_RUN_TASK_INDEX = "CLOUD_RUN_TASK_INDEX"
|
|
37
|
+
_CLOUD_RUN_TASK_ATTEMPT = "CLOUD_RUN_TASK_ATTEMPT"
|
|
38
|
+
_CLOUD_RUN_JOB_ENV_VARS = [
|
|
39
|
+
_CLOUD_RUN_JOB_ID,
|
|
40
|
+
_CLOUD_RUN_EXECUTION_ID,
|
|
41
|
+
_CLOUD_RUN_TASK_INDEX,
|
|
42
|
+
_CLOUD_RUN_TASK_ATTEMPT,
|
|
43
|
+
]
|
|
34
44
|
"""Environment variables set in Cloud Run environment."""
|
|
35
45
|
|
|
36
46
|
_FUNCTION_TARGET = "FUNCTION_TARGET"
|
|
@@ -118,8 +128,8 @@ def _create_compute_resource():
|
|
|
118
128
|
return resource
|
|
119
129
|
|
|
120
130
|
|
|
121
|
-
def
|
|
122
|
-
"""Create a standardized Cloud Run resource.
|
|
131
|
+
def _create_cloud_run_service_resource():
|
|
132
|
+
"""Create a standardized Cloud Run service resource.
|
|
123
133
|
Returns:
|
|
124
134
|
google.cloud.logging.Resource
|
|
125
135
|
"""
|
|
@@ -138,6 +148,24 @@ def _create_cloud_run_resource():
|
|
|
138
148
|
return resource
|
|
139
149
|
|
|
140
150
|
|
|
151
|
+
def _create_cloud_run_job_resource():
|
|
152
|
+
"""Create a standardized Cloud Run job resource.
|
|
153
|
+
Returns:
|
|
154
|
+
google.cloud.logging.Resource
|
|
155
|
+
"""
|
|
156
|
+
region = retrieve_metadata_server(_REGION_ID)
|
|
157
|
+
project = retrieve_metadata_server(_PROJECT_NAME)
|
|
158
|
+
resource = Resource(
|
|
159
|
+
type="cloud_run_job",
|
|
160
|
+
labels={
|
|
161
|
+
"project_id": project if project else "",
|
|
162
|
+
"job_name": os.environ.get(_CLOUD_RUN_JOB_ID, ""),
|
|
163
|
+
"location": region.split("/")[-1] if region else "",
|
|
164
|
+
},
|
|
165
|
+
)
|
|
166
|
+
return resource
|
|
167
|
+
|
|
168
|
+
|
|
141
169
|
def _create_app_engine_resource():
|
|
142
170
|
"""Create a standardized App Engine resource.
|
|
143
171
|
Returns:
|
|
@@ -190,9 +218,12 @@ def detect_resource(project=""):
|
|
|
190
218
|
):
|
|
191
219
|
# Cloud Functions
|
|
192
220
|
return _create_functions_resource()
|
|
193
|
-
elif all([env in os.environ for env in
|
|
221
|
+
elif all([env in os.environ for env in _CLOUD_RUN_SERVICE_ENV_VARS]):
|
|
222
|
+
# Cloud Run
|
|
223
|
+
return _create_cloud_run_service_resource()
|
|
224
|
+
elif all([env in os.environ for env in _CLOUD_RUN_JOB_ENV_VARS]):
|
|
194
225
|
# Cloud Run
|
|
195
|
-
return
|
|
226
|
+
return _create_cloud_run_job_resource()
|
|
196
227
|
elif gce_instance_name is not None:
|
|
197
228
|
# Compute Engine
|
|
198
229
|
return _create_compute_resource()
|
|
@@ -28,7 +28,10 @@ from google.cloud.logging_v2.handlers._monitored_resources import (
|
|
|
28
28
|
_create_kubernetes_resource,
|
|
29
29
|
)
|
|
30
30
|
from google.cloud.logging_v2.handlers._monitored_resources import (
|
|
31
|
-
|
|
31
|
+
_create_cloud_run_service_resource,
|
|
32
|
+
)
|
|
33
|
+
from google.cloud.logging_v2.handlers._monitored_resources import (
|
|
34
|
+
_create_cloud_run_job_resource,
|
|
32
35
|
)
|
|
33
36
|
from google.cloud.logging_v2.handlers._monitored_resources import (
|
|
34
37
|
_create_compute_resource,
|
|
@@ -160,7 +163,7 @@ class Test_Create_Resources(unittest.TestCase):
|
|
|
160
163
|
self.assertEqual(resource.labels["instance_id"], self.NAME)
|
|
161
164
|
self.assertEqual(resource.labels["zone"], self.LOCATION)
|
|
162
165
|
|
|
163
|
-
def
|
|
166
|
+
def test_cloud_run_service_resource(self):
|
|
164
167
|
patch = mock.patch(
|
|
165
168
|
"google.cloud.logging_v2.handlers._monitored_resources.retrieve_metadata_server",
|
|
166
169
|
wraps=self._mock_metadata,
|
|
@@ -169,7 +172,7 @@ class Test_Create_Resources(unittest.TestCase):
|
|
|
169
172
|
os.environ[_monitored_resources._CLOUD_RUN_REVISION_ID] = self.VERSION
|
|
170
173
|
os.environ[_monitored_resources._CLOUD_RUN_CONFIGURATION_ID] = self.CONFIG
|
|
171
174
|
with patch:
|
|
172
|
-
resource =
|
|
175
|
+
resource = _create_cloud_run_service_resource()
|
|
173
176
|
self.assertIsInstance(resource, Resource)
|
|
174
177
|
self.assertEqual(resource.type, "cloud_run_revision")
|
|
175
178
|
self.assertEqual(resource.labels["project_id"], self.PROJECT)
|
|
@@ -178,6 +181,23 @@ class Test_Create_Resources(unittest.TestCase):
|
|
|
178
181
|
self.assertEqual(resource.labels["configuration_name"], self.CONFIG)
|
|
179
182
|
self.assertEqual(resource.labels["location"], self.LOCATION)
|
|
180
183
|
|
|
184
|
+
def test_cloud_run_job_resource(self):
|
|
185
|
+
patch = mock.patch(
|
|
186
|
+
"google.cloud.logging_v2.handlers._monitored_resources.retrieve_metadata_server",
|
|
187
|
+
wraps=self._mock_metadata,
|
|
188
|
+
)
|
|
189
|
+
os.environ[_monitored_resources._CLOUD_RUN_JOB_ID] = self.NAME
|
|
190
|
+
os.environ[_monitored_resources._CLOUD_RUN_EXECUTION_ID] = self.VERSION
|
|
191
|
+
os.environ[_monitored_resources._CLOUD_RUN_TASK_INDEX] = self.CONFIG
|
|
192
|
+
os.environ[_monitored_resources._CLOUD_RUN_TASK_ATTEMPT] = self.CLUSTER
|
|
193
|
+
with patch:
|
|
194
|
+
resource = _create_cloud_run_job_resource()
|
|
195
|
+
self.assertIsInstance(resource, Resource)
|
|
196
|
+
self.assertEqual(resource.type, "cloud_run_job")
|
|
197
|
+
self.assertEqual(resource.labels["project_id"], self.PROJECT)
|
|
198
|
+
self.assertEqual(resource.labels["job_name"], self.NAME)
|
|
199
|
+
self.assertEqual(resource.labels["location"], self.LOCATION)
|
|
200
|
+
|
|
181
201
|
def test_app_engine_resource(self):
|
|
182
202
|
patch = mock.patch(
|
|
183
203
|
"google.cloud.logging_v2.handlers._monitored_resources.retrieve_metadata_server",
|
|
@@ -214,7 +234,8 @@ class Test_Create_Resources(unittest.TestCase):
|
|
|
214
234
|
resource_fns = [
|
|
215
235
|
_global_resource_patched,
|
|
216
236
|
_create_app_engine_resource,
|
|
217
|
-
|
|
237
|
+
_create_cloud_run_service_resource,
|
|
238
|
+
_create_cloud_run_job_resource,
|
|
218
239
|
_create_compute_resource,
|
|
219
240
|
_create_kubernetes_resource,
|
|
220
241
|
_create_functions_resource,
|
|
@@ -285,13 +306,20 @@ class Test_Resource_Detection(unittest.TestCase):
|
|
|
285
306
|
self.assertIsInstance(resource, Resource)
|
|
286
307
|
self.assertEqual(resource.type, "cloud_function")
|
|
287
308
|
|
|
288
|
-
def
|
|
289
|
-
for env in _monitored_resources.
|
|
309
|
+
def test_detect_cloud_run_service(self):
|
|
310
|
+
for env in _monitored_resources._CLOUD_RUN_SERVICE_ENV_VARS:
|
|
290
311
|
os.environ[env] = "TRUE"
|
|
291
312
|
resource = detect_resource(self.PROJECT)
|
|
292
313
|
self.assertIsInstance(resource, Resource)
|
|
293
314
|
self.assertEqual(resource.type, "cloud_run_revision")
|
|
294
315
|
|
|
316
|
+
def test_detect_cloud_run_job(self):
|
|
317
|
+
for env in _monitored_resources._CLOUD_RUN_JOB_ENV_VARS:
|
|
318
|
+
os.environ[env] = "TRUE"
|
|
319
|
+
resource = detect_resource(self.PROJECT)
|
|
320
|
+
self.assertIsInstance(resource, Resource)
|
|
321
|
+
self.assertEqual(resource.type, "cloud_run_job")
|
|
322
|
+
|
|
295
323
|
def test_detect_compute_engine(self):
|
|
296
324
|
patch = mock.patch(
|
|
297
325
|
"google.cloud.logging_v2.handlers._monitored_resources.retrieve_metadata_server",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging/handlers/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/_helpers.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/entries.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/resource.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/types/__init__.py
RENAMED
|
File without changes
|
{google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/types/log_entry.py
RENAMED
|
File without changes
|
{google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google/cloud/logging_v2/types/logging.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google_cloud_logging.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google_cloud_logging.egg-info/not-zip-safe
RENAMED
|
File without changes
|
{google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/google_cloud_logging.egg-info/requires.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/tests/performance/test_performance.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/tests/unit/gapic/logging_v2/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/tests/unit/handlers/test__helpers.py
RENAMED
|
File without changes
|
{google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/tests/unit/handlers/test_app_engine.py
RENAMED
|
File without changes
|
|
File without changes
|
{google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/tests/unit/handlers/test_handlers.py
RENAMED
|
File without changes
|
{google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/tests/unit/handlers/test_structured_log.py
RENAMED
|
File without changes
|
{google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/tests/unit/handlers/transports/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{google-cloud-logging-3.7.0 → google-cloud-logging-3.8.0}/tests/unit/test__instrumentation.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|