{"id":9782,"library":"google-cloud-monitoring-dashboards","title":"Google Cloud Monitoring Dashboards","description":"The `google-cloud-monitoring-dashboards` client library provides Python access to the Google Cloud Monitoring Dashboards API. It allows programmatic creation, management, and listing of custom dashboards for visualizing metrics in Google Cloud Monitoring. Part of the larger `google-cloud-python` monorepo, it receives frequent updates alongside other Google Cloud client libraries.","status":"active","version":"2.21.0","language":"python","source_language":"en","source_url":"https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-monitoring-dashboards","tags":["Google Cloud","Monitoring","Dashboards","observability","metrics","cloud"],"install":[{"cmd":"pip install google-cloud-monitoring-dashboards","lang":"bash","label":"Install stable version"}],"dependencies":[],"imports":[{"wrong":"from google.cloud import monitoring_dashboards","symbol":"DashboardsServiceClient","correct":"from google.cloud import monitoring_dashboards_v1"}],"quickstart":{"code":"import os\nfrom google.cloud import monitoring_dashboards_v1\n\n# Set your Google Cloud Project ID\nproject_id = os.environ.get(\"GOOGLE_CLOUD_PROJECT_ID\", \"your-gcp-project-id\") \n\ntry:\n    # Initialize the client\n    client = monitoring_dashboards_v1.DashboardsServiceClient()\n    \n    # The parent resource name for listing dashboards\n    parent = f\"projects/{project_id}\"\n\n    print(f\"Listing up to 5 dashboards for project: {project_id}\")\n    \n    # Iterate over and print dashboard display names\n    for dashboard in client.list_dashboards(request={\"parent\": parent}, page_size=5):\n        print(f\"  - {dashboard.display_name} (ID: {dashboard.name.split('/')[-1]})\")\n\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\n    print(\"\\nEnsure you have authenticated (e.g., `gcloud auth application-default login` or set `GOOGLE_APPLICATION_CREDENTIALS`) and provided a valid project ID.\")","lang":"python","description":"Initializes the Monitoring Dashboards client and lists the first 5 dashboards in a specified Google Cloud project. Requires `GOOGLE_CLOUD_PROJECT_ID` environment variable or direct replacement of 'your-gcp-project-id'."},"warnings":[{"fix":"Authenticate using `gcloud auth application-default login` for local development or set the `GOOGLE_APPLICATION_CREDENTIALS` environment variable to a service account key file path for production/CI.","message":"Google Cloud client libraries expect specific authentication. If not configured, you'll encounter 'PermissionDenied' errors.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Always ensure the correct Google Cloud project ID is provided, often in the `parent` argument of requests, and that resource names follow the API's expected format (e.g., `projects/{project_id}/dashboards/{dashboard_id}`).","message":"Many methods require a `project_id` or a fully qualified resource name (e.g., `projects/PROJECT_ID`). Misformed or missing project IDs lead to `NotFound` or `InvalidArgument` errors.","severity":"gotcha","affected_versions":"All versions"},{"fix":"The current version requires Python >=3.9. Upgrade your Python environment to 3.9 or higher if you encounter installation issues or runtime errors related to unsupported Python versions. Check `requires_python` in `setup.py` or PyPI metadata for exact requirements.","message":"Older versions of Google Cloud client libraries might drop support for End-of-Life Python versions. Ensure your environment uses a supported Python version.","severity":"breaking","affected_versions":"<=2.x.x"}],"env_vars":null,"search_vec":"'access':15 'allow':24 'alongsid':53 'api':22 'client':11,57 'cloud':2,8,19,38,46,56,60,65 'creation':26 'custom':31 'dashboard':4,10,21,32,62 'frequent':51 'googl':1,7,18,37,45,55,59 'google-cloud-monitoring-dashboard':6 'google-cloud-python':44 'larger':43 'librari':12,58 'list':29 'manag':27 'metric':35,64 'monitor':3,9,20,39,61 'monorepo':48 'observ':63 'part':40 'programmat':25 'provid':13 'python':14,47 'receiv':50 'updat':52 'visual':34","created_at":"2026-04-17T01:20:41.872506+00:00","updated_at":"2026-04-17T01:20:41.872506+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\nImportError: cannot import name 'monitoring_dashboards_v1' from 'google.cloud' (unknown location)"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"2.21.0","cli_name":"","cli_version":null,"type":"library","homepage":"https://cloud.google.com/monitoring","github":"https://github.com/googleapis/google-cloud-python","docs":null,"changelog":null,"pypi":"https://pypi.org/project/google-cloud-monitoring-dashboards/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["gcp","observability"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"import_fail","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-07-10","install_tag":null}}