{"id":13846451,"url":"https://github.com/googleapis/nodejs-monitoring","last_synced_at":"2025-07-12T07:32:46.111Z","repository":{"id":26131658,"uuid":"98464636","full_name":"googleapis/nodejs-monitoring","owner":"googleapis","description":"This repository is deprecated. All of its content and history has been moved to googleapis/google-cloud-node.","archived":true,"fork":false,"pushed_at":"2023-07-13T01:59:50.000Z","size":3694,"stargazers_count":71,"open_issues_count":0,"forks_count":33,"subscribers_count":46,"default_branch":"main","last_synced_at":"2024-11-21T21:42:22.774Z","etag":null,"topics":["monitoring","nodejs","stackdriver"],"latest_commit_sha":null,"homepage":"https://cloud.google.com/monitoring/","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/googleapis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-07-26T20:48:28.000Z","updated_at":"2024-10-11T17:28:36.000Z","dependencies_parsed_at":"2024-01-18T09:04:38.372Z","dependency_job_id":"a8626211-2079-48d8-98e9-ed96b1492e1a","html_url":"https://github.com/googleapis/nodejs-monitoring","commit_stats":{"total_commits":508,"total_committers":46,"mean_commits":"11.043478260869565","dds":0.8385826771653544,"last_synced_commit":"287da4b7106e877cb69b1001abada2f98a298d03"},"previous_names":[],"tags_count":48,"template":false,"template_full_name":null,"purl":"pkg:github/googleapis/nodejs-monitoring","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleapis%2Fnodejs-monitoring","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleapis%2Fnodejs-monitoring/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleapis%2Fnodejs-monitoring/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleapis%2Fnodejs-monitoring/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/googleapis","download_url":"https://codeload.github.com/googleapis/nodejs-monitoring/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleapis%2Fnodejs-monitoring/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264958166,"owners_count":23689010,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["monitoring","nodejs","stackdriver"],"created_at":"2024-08-04T18:00:34.264Z","updated_at":"2025-07-12T07:32:45.834Z","avatar_url":"https://github.com/googleapis.png","language":null,"funding_links":[],"categories":["Google Cloud Trace"],"sub_categories":["Client libraries"],"readme":"**_THIS REPOSITORY IS DEPRECATED. ALL OF ITS CONTENT AND HISTORY HAS BEEN MOVED TO [GOOGLE-CLOUD-NODE](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-monitoring)_**\n\n[//]: # \"This README.md file is auto-generated, all changes to this file will be lost.\"\n[//]: # \"To regenerate it, use `python -m synthtool`.\"\n\u003cimg src=\"https://avatars2.githubusercontent.com/u/2810941?v=3\u0026s=96\" alt=\"Google Cloud Platform logo\" title=\"Google Cloud Platform\" align=\"right\" height=\"96\" width=\"96\"/\u003e\n\n# [Stackdriver Monitoring: Node.js Client](https://github.com/googleapis/nodejs-monitoring)\n\n[![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages)\n[![npm version](https://img.shields.io/npm/v/@google-cloud/monitoring.svg)](https://www.npmjs.org/package/@google-cloud/monitoring)\n\n\n\n\n[Stackdriver Monitoring](https://cloud.google.com/monitoring/docs) collects metrics, events, and metadata from\nGoogle Cloud Platform, Amazon Web Services (AWS), hosted uptime probes, application instrumentation,\nand a variety of common application components including Cassandra, Nginx, Apache Web Server, Elasticsearch and many others.\n\n\nA comprehensive list of changes in each version may be found in\n[the CHANGELOG](https://github.com/googleapis/nodejs-monitoring/blob/main/CHANGELOG.md).\n\n* [Stackdriver Monitoring Node.js Client API Reference][client-docs]\n* [Stackdriver Monitoring Documentation][product-docs]\n* [github.com/googleapis/nodejs-monitoring](https://github.com/googleapis/nodejs-monitoring)\n\nRead more about the client libraries for Cloud APIs, including the older\nGoogle APIs Client Libraries, in [Client Libraries Explained][explained].\n\n[explained]: https://cloud.google.com/apis/docs/client-libraries-explained\n\n**Table of contents:**\n\n\n* [Quickstart](#quickstart)\n  * [Before you begin](#before-you-begin)\n  * [Installing the client library](#installing-the-client-library)\n  * [Using the client library](#using-the-client-library)\n* [Samples](#samples)\n* [Versioning](#versioning)\n* [Contributing](#contributing)\n* [License](#license)\n\n## Quickstart\n\n### Before you begin\n\n1.  [Select or create a Cloud Platform project][projects].\n1.  [Enable billing for your project][billing].\n1.  [Enable the Stackdriver Monitoring API][enable_api].\n1.  [Set up authentication with a service account][auth] so you can access the\n    API from your local workstation.\n\n### Installing the client library\n\n```bash\nnpm install @google-cloud/monitoring\n```\n\n\n### Using the client library\n\n```javascript\n// Imports the Google Cloud client library\nconst monitoring = require('@google-cloud/monitoring');\n\nasync function quickstart() {\n  // Creates a client\n  const client = new monitoring.MetricServiceClient();\n\n  // TODO(developer): Uncomment and set the following variables\n  // const projectId = \"PROJECT_ID\"\n\n  // Prepares an individual data point\n  const dataPoint = {\n    interval: {\n      endTime: {\n        seconds: Date.now() / 1000,\n      },\n    },\n    value: {\n      // The amount of sales\n      doubleValue: 123.45,\n    },\n  };\n\n  // Prepares the time series request\n  const request = {\n    name: client.projectPath(projectId),\n    timeSeries: [\n      {\n        // Ties the data point to a custom metric\n        metric: {\n          type: 'custom.googleapis.com/stores/daily_sales',\n          labels: {\n            store_id: 'Pittsburgh',\n          },\n        },\n        resource: {\n          type: 'global',\n          labels: {\n            project_id: projectId,\n          },\n        },\n        points: [dataPoint],\n      },\n    ],\n  };\n\n  // Writes time series data\n  const [result] = await client.createTimeSeries(request);\n  console.log('Done writing time series data.', result);\n}\nquickstart();\n\n```\n\n\n\n## Samples\n\nSamples are in the [`samples/`](https://github.com/googleapis/nodejs-monitoring/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample.\n\n| Sample                      | Source Code                       | Try it |\n| --------------------------- | --------------------------------- | ------ |\n| Alerts.backup Policies | [source code](https://github.com/googleapis/nodejs-monitoring/blob/main/samples/alerts.backupPolicies.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-monitoring\u0026page=editor\u0026open_in_editor=samples/alerts.backupPolicies.js,samples/README.md) |\n| Alerts.delete Channels | [source code](https://github.com/googleapis/nodejs-monitoring/blob/main/samples/alerts.deleteChannels.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-monitoring\u0026page=editor\u0026open_in_editor=samples/alerts.deleteChannels.js,samples/README.md) |\n| Alerts.enable Policies | [source code](https://github.com/googleapis/nodejs-monitoring/blob/main/samples/alerts.enablePolicies.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-monitoring\u0026page=editor\u0026open_in_editor=samples/alerts.enablePolicies.js,samples/README.md) |\n| Alerts.list Policies | [source code](https://github.com/googleapis/nodejs-monitoring/blob/main/samples/alerts.listPolicies.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-monitoring\u0026page=editor\u0026open_in_editor=samples/alerts.listPolicies.js,samples/README.md) |\n| Alerts.replace Channels | [source code](https://github.com/googleapis/nodejs-monitoring/blob/main/samples/alerts.replaceChannels.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-monitoring\u0026page=editor\u0026open_in_editor=samples/alerts.replaceChannels.js,samples/README.md) |\n| Alerts.restore Policies | [source code](https://github.com/googleapis/nodejs-monitoring/blob/main/samples/alerts.restorePolicies.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-monitoring\u0026page=editor\u0026open_in_editor=samples/alerts.restorePolicies.js,samples/README.md) |\n| Create Metric Descriptor | [source code](https://github.com/googleapis/nodejs-monitoring/blob/main/samples/metrics.createDescriptor.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-monitoring\u0026page=editor\u0026open_in_editor=samples/metrics.createDescriptor.js,samples/README.md) |\n| Delete Metric Descriptor | [source code](https://github.com/googleapis/nodejs-monitoring/blob/main/samples/metrics.deleteDescriptor.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-monitoring\u0026page=editor\u0026open_in_editor=samples/metrics.deleteDescriptor.js,samples/README.md) |\n| Get Metric Descriptor | [source code](https://github.com/googleapis/nodejs-monitoring/blob/main/samples/metrics.getDescriptor.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-monitoring\u0026page=editor\u0026open_in_editor=samples/metrics.getDescriptor.js,samples/README.md) |\n| Get Monitored Resource Descriptor | [source code](https://github.com/googleapis/nodejs-monitoring/blob/main/samples/metrics.getMonitoredResourceDescriptor.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-monitoring\u0026page=editor\u0026open_in_editor=samples/metrics.getMonitoredResourceDescriptor.js,samples/README.md) |\n| List Metric Descriptors | [source code](https://github.com/googleapis/nodejs-monitoring/blob/main/samples/metrics.listDescriptors.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-monitoring\u0026page=editor\u0026open_in_editor=samples/metrics.listDescriptors.js,samples/README.md) |\n| List Monitored Resource Descriptors | [source code](https://github.com/googleapis/nodejs-monitoring/blob/main/samples/metrics.listMonitoredResourceDescriptors.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-monitoring\u0026page=editor\u0026open_in_editor=samples/metrics.listMonitoredResourceDescriptors.js,samples/README.md) |\n| Read Time Series Aggregate | [source code](https://github.com/googleapis/nodejs-monitoring/blob/main/samples/metrics.readTimeSeriesAggregate.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-monitoring\u0026page=editor\u0026open_in_editor=samples/metrics.readTimeSeriesAggregate.js,samples/README.md) |\n| Read Time Series Data | [source code](https://github.com/googleapis/nodejs-monitoring/blob/main/samples/metrics.readTimeSeriesData.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-monitoring\u0026page=editor\u0026open_in_editor=samples/metrics.readTimeSeriesData.js,samples/README.md) |\n| Read Time Series Fields | [source code](https://github.com/googleapis/nodejs-monitoring/blob/main/samples/metrics.readTimeSeriesFields.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-monitoring\u0026page=editor\u0026open_in_editor=samples/metrics.readTimeSeriesFields.js,samples/README.md) |\n| Read Time Series Reduce | [source code](https://github.com/googleapis/nodejs-monitoring/blob/main/samples/metrics.readTimeSeriesReduce.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-monitoring\u0026page=editor\u0026open_in_editor=samples/metrics.readTimeSeriesReduce.js,samples/README.md) |\n| Write Time Series Data | [source code](https://github.com/googleapis/nodejs-monitoring/blob/main/samples/metrics.writeTimeSeriesData.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-monitoring\u0026page=editor\u0026open_in_editor=samples/metrics.writeTimeSeriesData.js,samples/README.md) |\n| Quickstart | [source code](https://github.com/googleapis/nodejs-monitoring/blob/main/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-monitoring\u0026page=editor\u0026open_in_editor=samples/quickstart.js,samples/README.md) |\n| Uptime | [source code](https://github.com/googleapis/nodejs-monitoring/blob/main/samples/uptime.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-monitoring\u0026page=editor\u0026open_in_editor=samples/uptime.js,samples/README.md) |\n\n\n\nThe [Stackdriver Monitoring Node.js Client API Reference][client-docs] documentation\nalso contains samples.\n\n## Supported Node.js Versions\n\nOur client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/).\nLibraries are compatible with all current _active_ and _maintenance_ versions of\nNode.js.\nIf you are using an end-of-life version of Node.js, we recommend that you update\nas soon as possible to an actively supported LTS version.\n\nGoogle's client libraries support legacy versions of Node.js runtimes on a\nbest-efforts basis with the following warnings:\n\n* Legacy versions are not tested in continuous integration.\n* Some security patches and features cannot be backported.\n* Dependencies cannot be kept up-to-date.\n\nClient libraries targeting some end-of-life versions of Node.js are available, and\ncan be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag).\nThe dist-tags follow the naming convention `legacy-(version)`.\nFor example, `npm install @google-cloud/monitoring@legacy-8` installs client libraries\nfor versions compatible with Node.js 8.\n\n## Versioning\n\nThis library follows [Semantic Versioning](http://semver.org/).\n\n\n\nThis library is considered to be **stable**. The code surface will not change in backwards-incompatible ways\nunless absolutely necessary (e.g. because of critical security issues) or with\nan extensive deprecation period. Issues and requests against **stable** libraries\nare addressed with the highest priority.\n\n\n\n\n\n\nMore Information: [Google Cloud Platform Launch Stages][launch_stages]\n\n[launch_stages]: https://cloud.google.com/terms/launch-stages\n\n## Contributing\n\nContributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-monitoring/blob/main/CONTRIBUTING.md).\n\nPlease note that this `README.md`, the `samples/README.md`,\nand a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`)\nare generated from a central template. To edit one of these files, make an edit\nto its templates in\n[directory](https://github.com/googleapis/synthtool).\n\n## License\n\nApache Version 2.0\n\nSee [LICENSE](https://github.com/googleapis/nodejs-monitoring/blob/main/LICENSE)\n\n[client-docs]: https://cloud.google.com/nodejs/docs/reference/monitoring/latest\n[product-docs]: https://cloud.google.com/monitoring/docs\n[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png\n[projects]: https://console.cloud.google.com/project\n[billing]: https://support.google.com/cloud/answer/6293499#enable-billing\n[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=monitoring.googleapis.com\n[auth]: https://cloud.google.com/docs/authentication/getting-started\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogleapis%2Fnodejs-monitoring","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoogleapis%2Fnodejs-monitoring","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogleapis%2Fnodejs-monitoring/lists"}