npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@rawdash/connector-gcp-monitoring

v0.29.2

Published

Rawdash connector for Google Cloud Monitoring — syncs declared metric time series via the Cloud Monitoring v3 API into the six-shape storage model

Downloads

160

Readme

@rawdash/connector-gcp-monitoring

npm version license

Pull declared Cloud Monitoring metric time series (any metric type, aligner, and period) into a single metric series per query.

Install

npm install @rawdash/connector-gcp-monitoring

Authentication

Authenticate against the Cloud Monitoring v3 API with a Google service account JSON key. The service account needs the Monitoring Viewer role (roles/monitoring.viewer) on the project whose metrics it reads.

  1. Identify the GCP project whose metrics you want to sync.
  2. Create a service account at Google Cloud -> IAM & Admin -> Service Accounts in that project (or grant an existing one access).
  3. Grant the service account the Monitoring Viewer role (roles/monitoring.viewer) on the project. The API enables this role automatically for owners and editors.
  4. Generate a JSON key for the service account and store its contents as a secret (e.g. GCP_MONITORING_SA_JSON).
  5. Reference the key from config as serviceAccountJson: secret("GCP_MONITORING_SA_JSON") and set projectId to the same project.

Configuration

| Field | Type | Required | Description | | -------------------- | ------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | projectId | string | Yes | Google Cloud project ID whose metrics should be synced (the project that owns the monitored resources). | | serviceAccountJson | secret | Yes | Contents of the JSON key file for a Google service account with the role required by this connector. Create one at Google Cloud -> IAM & Admin -> Service Accounts and store the JSON as a secret. | | metricQueries | array | Yes | Cloud Monitoring is too broad to mirror wholesale; declare the specific metrics to pull. Each query needs an id, metric type, alignment period (e.g. 300s), and a perSeriesAligner statistic, with an optional filter on resource labels. | | lookbackMinutes | number | No | How far back to pull data points on a full sync when the host does not supply a since bound. Defaults to 180. |

Resources

  • <metricType> (metric) - One metric series per declared metric query. The series name is the configured metric type (e.g. compute.googleapis.com/instance/cpu/utilization), so the actual keys depend on the configured metricQueries. Each sample carries the aligner, alignment period, query id, and metric/resource labels as attributes.
    • Endpoint: GET /v3/projects/{projectId}/timeSeries
    • Granularity: Per alignmentPeriod (a duration in seconds, e.g. 300s)
    • Dimensions: perSeriesAligner, alignmentPeriod, queryId, resourceType
    • Each sync replaces the full set of samples for the metric names it owns (idempotent). Distribution-valued points are dropped unless reduced to a scalar by the perSeriesAligner.

Example

import {
  defineConfig,
  defineDashboard,
  defineMetric,
  secret,
} from '@rawdash/core';

const gcpMonitoring = {
  name: 'gcpMonitoring',
  connectorId: 'gcp-monitoring',
  config: {
    projectId: 'my-project-123',
    serviceAccountJson: secret('GCP_MONITORING_SA_JSON'),
    metricQueries: [
      {
        id: 'gce_cpu',
        metricType: 'compute.googleapis.com/instance/cpu/utilization',
        alignmentPeriod: '300s',
        perSeriesAligner: 'ALIGN_MEAN',
      },
    ],
    lookbackMinutes: 180,
  },
};

export default defineConfig({
  connectors: [gcpMonitoring],
  dashboards: {
    infra: defineDashboard({
      widgets: {
        cpu: {
          kind: 'timeseries',
          title: 'GCE CPU utilization',
          window: '24h',
          metric: defineMetric({
            connector: gcpMonitoring,
            shape: 'metric',
            name: 'compute.googleapis.com/instance/cpu/utilization',
            fn: 'avg',
          }),
        },
      },
    }),
  },
});

Rate limits

Cloud Monitoring projects.timeSeries.list is rate-limited per project; 429 / RESOURCE_EXHAUSTED responses are retried with backoff. Pagination uses nextPageToken.

Limitations

  • Cloud Monitoring is too broad to mirror wholesale; only the metrics declared in metricQueries are synced; there is no automatic metric discovery.
  • The series name is derived from the metric type, so two queries against the same metricType with different aligners or filters share one series name and are distinguished only by sample attributes.
  • Each query alignmentPeriod must be expressed as a duration in seconds, e.g. 60s or 300s.
  • A full sync uses lookbackMinutes; a latest sync uses a short window covering the last few alignment periods.
  • Distribution-valued metrics (e.g. latency histograms) require a perSeriesAligner that reduces them to a scalar (ALIGN_PERCENTILE_99, ALIGN_MEAN, etc.); raw distributions are not stored.

Links

License

Apache-2.0