Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions functions/ocr/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def detect_text(bucket: str, filename: str) -> None:
filename: name of the file to be read.

Returns:
None; the output is written to stdout and Stackdriver Logging.
None; the output is written to stdout and cloud logging.
"""
print("Looking for text in image {}".format(filename))

Expand Down Expand Up @@ -123,7 +123,7 @@ def process_image(file_info: dict, context: dict) -> None:
context: a dictionary containing metadata about the event.

Returns:
None; the output is written to stdout and Stackdriver Logging.
None; the output is written to stdout and cloud logging.
"""
bucket = validate_message(file_info, "bucket")
name = validate_message(file_info, "name")
Expand All @@ -148,7 +148,7 @@ def translate_text(event: dict, context: dict) -> None:
context: a dictionary containing metadata about the event.

Returns:
None; the output is written to stdout and Stackdriver Logging.
None; the output is written to stdout and cloud logging.
"""
if event.get("data"):
message_data = base64.b64decode(event["data"]).decode("utf-8")
Expand Down Expand Up @@ -189,7 +189,7 @@ def save_result(event: dict, context: dict) -> None:
context: a dictionary containing metadata about the event.

Returns:
None; the output is written to stdout and Stackdriver Logging.
None; the output is written to stdout and cloud logging.
"""
if event.get("data"):
message_data = base64.b64decode(event["data"]).decode("utf-8")
Expand Down
2 changes: 1 addition & 1 deletion functions/tips-retry/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def retry_or_not(data, context):
data (dict): The event payload.
context (google.cloud.functions.Context): The event metadata.
Returns:
None; output is written to Stackdriver Logging
None; output is written to Cloud Logging
"""

# Retry based on a user-defined parameter
Expand Down
2 changes: 1 addition & 1 deletion functions/v2/tips-avoid-infinite-retries/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def avoid_infinite_retries(cloud_event):
Args:
cloud_event: The cloud event associated with the current trigger
Returns:
None; output is written to Stackdriver Logging
None; output is written to Cloud Logging
"""
timestamp = cloud_event["time"]

Expand Down
2 changes: 1 addition & 1 deletion functions/v2/tips-retry/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def retry_or_not(cloud_event):
Args:
cloud_event: The cloud event with a Pub/Sub data payload
Returns:
None; output is written to Stackdriver Logging
None; output is written to Cloud Logging
"""

# The Pub/Sub event payload is passed as the CloudEvent's data payload.
Expand Down
10 changes: 5 additions & 5 deletions monitoring/api/v3/api-client/README.rst
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
.. This file is automatically generated. Do not edit this file directly.

Stackdriver Monitoring Python Samples
Cloud Logging Monitoring Python Samples
===============================================================================

.. image:: https://gstatic.com/cloudssh/images/open-btn.png
:target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=monitoring/api/v3/api-client/README.rst


This directory contains samples for Stackdriver Monitoring. `Stackdriver Monitoring `_ collects metrics, events, and metadata from Google Cloud Platform, Amazon Web Services (AWS), hosted uptime probes, application instrumentation, and a variety of common application components including Cassandra, Nginx, Apache Web Server, Elasticsearch and many others. Stackdriver ingests that data and generates insights via dashboards, charts, and alerts.
This directory contains samples for Cloud Logging Monitoring. `Cloud Logging Monitoring `_ collects metrics, events, and metadata from Google Cloud Platform, Amazon Web Services (AWS), hosted uptime probes, application instrumentation, and a variety of common application components including Cassandra, Nginx, Apache Web Server, Elasticsearch and many others. Cloud Logging ingests that data and generates insights via dashboards, charts, and alerts.




.. _Stackdriver Monitoring: https://cloud.google.com/monitoring/docs
.. _Cloud Logging Monitoring: https://cloud.google.com/monitoring/docs

Setup
-------------------------------------------------------------------------------
Expand Down Expand Up @@ -78,7 +78,7 @@ To run this sample:

usage: list_resources.py [-h] --project_id PROJECT_ID

Sample command-line program for retrieving Stackdriver Monitoring API V3
Sample command-line program for retrieving Cloud Logging Monitoring API V3
data.

See README.md for instructions on setting up your development environment.
Expand Down Expand Up @@ -111,7 +111,7 @@ To run this sample:

usage: custom_metric.py [-h] --project_id PROJECT_ID

Sample command-line program for writing and reading Stackdriver Monitoring
Sample command-line program for writing and reading Cloud Logging Monitoring
API V3 custom metrics.

Simple command-line program to demonstrate connecting to the Google
Expand Down
8 changes: 4 additions & 4 deletions monitoring/api/v3/api-client/README.rst.in
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# This file is used to generate README.rst

product:
name: Stackdriver Monitoring
short_name: Stackdriver Monitoring
name: Cloud Logging Monitoring
short_name: Cloud Logging Monitoring
url: https://cloud.google.com/monitoring/docs
description: >
`Stackdriver Monitoring `_ collects metrics, events, and metadata from
`Cloud Logging Monitoring `_ collects metrics, events, and metadata from
Google Cloud Platform, Amazon Web Services (AWS), hosted uptime probes,
application instrumentation, and a variety of common application components
including Cassandra, Nginx, Apache Web Server, Elasticsearch and many
others. Stackdriver ingests that data and generates insights via
others. Cloud Logging ingests that data and generates insights via
dashboards, charts, and alerts.

setup:
Expand Down
2 changes: 1 addition & 1 deletion monitoring/api/v3/api-client/list_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

"""Sample command-line program for retrieving Stackdriver Monitoring API V3
"""Sample command-line program for retrieving Cloud Logging Monitoring API V3
data.

See README.md for instructions on setting up your development environment.
Expand Down
6 changes: 3 additions & 3 deletions monitoring/snippets/v3/alerts-client/README.rst
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
.. This file is automatically generated. Do not edit this file directly.

Google Stackdriver Alerting API Python Samples
Google Cloud Logging Alerting API Python Samples
===============================================================================

.. image:: https://gstatic.com/cloudssh/images/open-btn.png
:target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=monitoring/api/v3/alerts-client/README.rst


This directory contains samples for Google Stackdriver Alerting API. Stackdriver Monitoring collects metrics, events, and metadata from Google Cloud Platform, Amazon Web Services (AWS), hosted uptime probes, application instrumentation, and a variety of common application components including Cassandra, Nginx, Apache Web Server, Elasticsearch and many others. Stackdriver's Alerting API allows you to create, delete, and make back up copies of your alert policies.
This directory contains samples for Google Cloud Logging Alerting API. Cloud Logging Monitoring collects metrics, events, and metadata from Google Cloud Platform, Amazon Web Services (AWS), hosted uptime probes, application instrumentation, and a variety of common application components including Cassandra, Nginx, Apache Web Server, Elasticsearch and many others. Cloud Logging's Alerting API allows you to create, delete, and make back up copies of your alert policies.




.. _Google Stackdriver Alerting API: https://cloud.google.com/monitoring/alerts/
.. _Google Cloud Logging Alerting API: https://cloud.google.com/monitoring/alerts/

To run the sample, you need to enable the API at: https://console.cloud.google.com/apis/library/monitoring.googleapis.com

Expand Down
8 changes: 4 additions & 4 deletions monitoring/snippets/v3/alerts-client/README.rst.in
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# This file is used to generate README.rst

product:
name: Google Stackdriver Alerting API
short_name: Stackdriver Alerting API
name: Google Cloud Logging Alerting API
short_name: Cloud Logging Alerting API
url: https://cloud.google.com/monitoring/alerts/
description: >
Stackdriver Monitoring collects metrics, events, and metadata from Google
Cloud Logging Monitoring collects metrics, events, and metadata from Google
Cloud Platform, Amazon Web Services (AWS), hosted uptime probes,
application instrumentation, and a variety of common application
components including Cassandra, Nginx, Apache Web Server, Elasticsearch
and many others. Stackdriver's Alerting API allows you to create,
and many others. Cloud Logging's Alerting API allows you to create,
delete, and make back up copies of your alert policies.

required_api_url: https://console.cloud.google.com/apis/library/monitoring.googleapis.com
Expand Down
8 changes: 4 additions & 4 deletions monitoring/snippets/v3/cloud-client/README.rst
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
.. This file is automatically generated. Do not edit this file directly.

Google Stackdriver Monitoring API Python Samples
Google Cloud Logging Monitoring API Python Samples
===============================================================================

.. image:: https://gstatic.com/cloudssh/images/open-btn.png
:target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=monitoring/api/v3/cloud-client/README.rst


This directory contains samples for Google Stackdriver Monitoring API. Stackdriver Monitoring collects metrics, events, and metadata from Google Cloud Platform, Amazon Web Services (AWS), hosted uptime probes, application instrumentation, and a variety of common application components including Cassandra, Nginx, Apache Web Server, Elasticsearch
and many others. Stackdriver ingests that data and generates insights
This directory contains samples for Google Cloud Logging Monitoring API. Cloud Logging Monitoring collects metrics, events, and metadata from Google Cloud Platform, Amazon Web Services (AWS), hosted uptime probes, application instrumentation, and a variety of common application components including Cassandra, Nginx, Apache Web Server, Elasticsearch
and many others. Cloud Logging ingests that data and generates insights
via dashboards, charts, and alerts.




.. _Google Stackdriver Monitoring API: https://cloud.google.com/monitoring/docs/
.. _Google Cloud Logging Monitoring API: https://cloud.google.com/monitoring/docs/

To run the sample, you need to enable the API at: https://console.cloud.google.com/apis/library/monitoring.googleapis.com

Expand Down
8 changes: 4 additions & 4 deletions monitoring/snippets/v3/cloud-client/README.rst.in
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# This file is used to generate README.rst

product:
name: Google Stackdriver Monitoring API
short_name: Stackdriver Monitoring API
name: Google Cloud Logging Monitoring API
short_name: Cloud Logging Monitoring API
url: https://cloud.google.com/monitoring/docs/
description: >
Stackdriver Monitoring collects metrics, events, and metadata from Google
Cloud Logging Monitoring collects metrics, events, and metadata from Google
Cloud Platform, Amazon Web Services (AWS), hosted uptime probes,
application instrumentation, and a variety of common application
components including Cassandra, Nginx, Apache Web Server, Elasticsearch
and many others. Stackdriver ingests that data and generates insights
and many others. Cloud Logging ingests that data and generates insights
via dashboards, charts, and alerts.

required_api_url: https://console.cloud.google.com/apis/library/monitoring.googleapis.com
Expand Down
6 changes: 3 additions & 3 deletions monitoring/snippets/v3/uptime-check-client/README.rst
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
.. This file is automatically generated. Do not edit this file directly.

Google Stackdriver Uptime Checks API Python Samples
Google Cloud Logging Uptime Checks API Python Samples
===============================================================================

.. image:: https://gstatic.com/cloudssh/images/open-btn.png
:target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=monitoring/api/v3/uptime-check-client/README.rst


This directory contains samples for Google Stackdriver Uptime Checks API. Stackdriver Monitoring collects metrics, events, and metadata from Google Cloud Platform, Amazon Web Services (AWS), hosted uptime probes, application instrumentation, and a variety of common application components including Cassandra, Nginx, Apache Web Server, Elasticsearch and many others. Stackdriver's Uptime Checks API allows you to create, delete, and list your project's Uptime Checks.
This directory contains samples for Google Cloud Logging Uptime Checks API. Cloud Logging Monitoring collects metrics, events, and metadata from Google Cloud Platform, Amazon Web Services (AWS), hosted uptime probes, application instrumentation, and a variety of common application components including Cassandra, Nginx, Apache Web Server, Elasticsearch and many others. Cloud Logging's Uptime Checks API allows you to create, delete, and list your project's Uptime Checks.




.. _Google Stackdriver Uptime Checks API: https://cloud.google.com/monitoring/uptime-checks/management
.. _Google Cloud Logging Uptime Checks API: https://cloud.google.com/monitoring/uptime-checks/management

Setup
-------------------------------------------------------------------------------
Expand Down
8 changes: 4 additions & 4 deletions monitoring/snippets/v3/uptime-check-client/README.rst.in
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# This file is used to generate README.rst

product:
name: Google Stackdriver Uptime Checks API
short_name: Stackdriver Uptime Checks API
name: Google Cloud Logging Uptime Checks API
short_name: Cloud Logging Uptime Checks API
url: https://cloud.google.com/monitoring/uptime-checks/management
description: >
Stackdriver Monitoring collects metrics, events, and metadata from Google
Cloud Logging Monitoring collects metrics, events, and metadata from Google
Cloud Platform, Amazon Web Services (AWS), hosted uptime probes,
application instrumentation, and a variety of common application
components including Cassandra, Nginx, Apache Web Server, Elasticsearch
and many others. Stackdriver's Uptime Checks API allows you to create,
and many others. Cloud Logging's Uptime Checks API allows you to create,
delete, and list your project's Uptime Checks.

setup:
Expand Down
2 changes: 1 addition & 1 deletion pubsub/streaming-analytics/PubSubToGCS_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def test_pubsub_to_gcs():

# Check for output files on GCS.
gcs_client = GcsIO()
files = gcs_client.list_prefix(f"gs://{BUCKET}/pubsub/{UUID}")
files = dict(gcs_client.list_files(f"gs://{BUCKET}/pubsub/{UUID}"))
assert len(files) > 0

# Clean up.
Expand Down
2 changes: 1 addition & 1 deletion pubsub/streaming-analytics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Sample(s) showing how to use [Google Cloud Pub/Sub] with [Google Cloud Dataflow]
gcloud init
```

1. [Enable the APIs](https://console.cloud.google.com/flows/enableapi?apiid=dataflow,compute_component,logging,storage_component,storage_api,pubsub,cloudresourcemanager.googleapis.com,cloudscheduler.googleapis.com,appengine.googleapis.com): Dataflow, Compute Engine, Stackdriver Logging, Cloud Storage, Cloud Storage JSON, Pub/Sub, Cloud Scheduler, Cloud Resource Manager, and App Engine.
1. [Enable the APIs](https://console.cloud.google.com/flows/enableapi?apiid=dataflow,compute_component,logging,storage_component,storage_api,pubsub,cloudresourcemanager.googleapis.com,cloudscheduler.googleapis.com,appengine.googleapis.com): Dataflow, Compute Engine, Cloud Logging, Cloud Storage, Cloud Storage JSON, Pub/Sub, Cloud Scheduler, Cloud Resource Manager, and App Engine.

1. Create a service account JSON key via the
[*Create service account key* page],
Expand Down
2 changes: 1 addition & 1 deletion pubsub/streaming-analytics/noxfile_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

TEST_CONFIG_OVERRIDE = {
# You can opt out from the test for specific Python versions.
"ignored_versions": ["2.7", "3.6", "3.9", "3.10", "3.11", "3.12", "3.13"],
"ignored_versions": ["2.7", "3.6", "3.7", "3.8", "3.9", "3.14"],
# Old samples are opted out of enforcing Python type hints
# All new samples should feature them
"enforce_type_hints": False,
Expand Down
2 changes: 1 addition & 1 deletion pubsub/streaming-analytics/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
apache-beam[gcp,test]==2.42.0
apache-beam[gcp,test]==2.72.0
2 changes: 1 addition & 1 deletion run/logging-manual/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Cloud Run Manual Logging Sample

This sample shows how to send structured logs to Stackdriver Logging.
This sample shows how to send structured logs to Cloud Logging.

[![Run in Google Cloud][run_img]][run_link]

Expand Down
6 changes: 3 additions & 3 deletions run/logging-manual/e2e_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ def test_end_to_end(service_url_auth_token, deployed_service):
assert response.status_code == 200
assert "Hello Logger!" in response.content.decode("UTF-8")

# Test that the logs are writing properly to stackdriver
time.sleep(10) # Slight delay writing to stackdriver
# Test that the logs are writing properly to Cloud Logging
time.sleep(10) # Slight delay writing to Cloud Logging
client = LoggingServiceV2Client()
resource_names = [f"projects/{PROJECT}"]
# We add timestamp for making the query faster.
Expand All @@ -184,7 +184,7 @@ def test_end_to_end(service_url_auth_token, deployed_service):
"AND jsonPayload.component=arbitrary-property"
)

# Retry a maximum number of 10 times to find results in stackdriver
# Retry a maximum number of 10 times to find results in Cloud Logging
found = False
for x in range(10):
iterator = client.list_log_entries(
Expand Down
2 changes: 1 addition & 1 deletion run/logging-manual/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pytest==8.2.0
google-cloud-logging==3.11.4
google-cloud-logging==3.15.0
4 changes: 2 additions & 2 deletions run/pubsub/e2e_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def test_end_to_end(pubsub_topic):
future.result()

# Check the logs for "Hello Runner"
time.sleep(20) # Slight delay writing to stackdriver
time.sleep(20) # Slight delay writing to Cloud Logging
client = LoggingServiceV2Client()
resource_names = [f"projects/{PROJECT}"]

Expand All @@ -246,7 +246,7 @@ def test_end_to_end(pubsub_topic):
f"AND resource.labels.service_name={CLOUD_RUN_SERVICE} "
)

# Retry a maximum number of 10 times to find results in stackdriver
# Retry a maximum number of 10 times to find results in Cloud Logging
found = False
for x in range(10):
iterator = client.list_log_entries(
Expand Down
4 changes: 2 additions & 2 deletions run/pubsub/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
backoff==2.2.1
pytest==8.2.0
google-cloud-logging==3.11.4
google-cloud-pubsub==2.28.0
google-cloud-logging==3.15.0
google-cloud-pubsub==2.36.0
6 changes: 3 additions & 3 deletions trace/trace-python-sample-opentelemetry/README.rst.in
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# This file is used to generate README.rst

product:
name: Stackdriver Trace
short_name: Stackdriver Trace
name: Cloud Trace
short_name: Cloud Trace
url: https://cloud.google.com/trace/docs
description: >
`Stackdriver Trace`_ collects latency data from applications and displays
`Cloud Trace`_ collects latency data from applications and displays
it in near real time in the Google Cloud Platform Console.

setup:
Expand Down