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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@datafire/google_cloudmonitoring

v6.0.0

Published

DataFire integration for Cloud Monitoring

Downloads

4

Readme

@datafire/google_cloudmonitoring

Client library for Cloud Monitoring

Installation and Usage

npm install --save @datafire/google_cloudmonitoring
let google_cloudmonitoring = require('@datafire/google_cloudmonitoring').create({
  access_token: "",
  refresh_token: "",
  client_id: "",
  client_secret: "",
  redirect_uri: ""
});

.then(data => {
  console.log(data);
});

Description

Accesses Google Cloud Monitoring data.

Actions

oauthCallback

Exchange the code passed to your redirect URI for an access_token

google_cloudmonitoring.oauthCallback({
  "code": ""
}, context)

Input

  • input object
    • code required string

Output

  • output object
    • access_token string
    • refresh_token string
    • token_type string
    • scope string
    • expiration string

oauthRefresh

Exchange a refresh_token for an access_token

google_cloudmonitoring.oauthRefresh(null, context)

Input

This action has no parameters

Output

  • output object
    • access_token string
    • refresh_token string
    • token_type string
    • scope string
    • expiration string

metricDescriptors.list

List metric descriptors that match the query. If the query is not set, then all of the metric descriptors will be returned. Large responses will be paginated, use the nextPageToken returned in the response to request subsequent pages of results by setting the pageToken query parameter to the value of the nextPageToken.

google_cloudmonitoring.metricDescriptors.list({
  "project": ""
}, context)

Input

  • input object
    • project required string: The project id. The value can be the numeric project ID or string-based project name.
    • count integer: Maximum number of metric descriptors per page. Used for pagination. If not specified, count = 100.
    • pageToken string: The pagination token, which is used to page through large result sets. Set this value to the value of the nextPageToken to retrieve the next page of results.
    • query string: The query used to search against existing metrics. Separate keywords with a space; the service joins all keywords with AND, meaning that all keywords must match for a metric to be returned. If this field is omitted, all metrics are returned. If an empty string is passed with this field, no metrics are returned.
    • body ListMetricDescriptorsRequest
    • alt string (values: json): Data format for the response.
    • fields string: Selector specifying which fields to include in a partial response.
    • key string: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
    • oauth_token string: OAuth 2.0 token for the current user.
    • prettyPrint boolean: Returns response with indentations and line breaks.
    • quotaUser string: Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.
    • userIp string: IP address of the site where the request originates. Use this if you want to enforce per-user limits.

Output

metricDescriptors.create

Create a new metric.

google_cloudmonitoring.metricDescriptors.create({
  "project": ""
}, context)

Input

  • input object
    • project required string: The project id. The value can be the numeric project ID or string-based project name.
    • body MetricDescriptor
    • alt string (values: json): Data format for the response.
    • fields string: Selector specifying which fields to include in a partial response.
    • key string: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
    • oauth_token string: OAuth 2.0 token for the current user.
    • prettyPrint boolean: Returns response with indentations and line breaks.
    • quotaUser string: Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.
    • userIp string: IP address of the site where the request originates. Use this if you want to enforce per-user limits.

Output

metricDescriptors.delete

Delete an existing metric.

google_cloudmonitoring.metricDescriptors.delete({
  "project": "",
  "metric": ""
}, context)

Input

  • input object
    • project required string: The project ID to which the metric belongs.
    • metric required string: Name of the metric.
    • alt string (values: json): Data format for the response.
    • fields string: Selector specifying which fields to include in a partial response.
    • key string: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
    • oauth_token string: OAuth 2.0 token for the current user.
    • prettyPrint boolean: Returns response with indentations and line breaks.
    • quotaUser string: Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.
    • userIp string: IP address of the site where the request originates. Use this if you want to enforce per-user limits.

Output

timeseries.list

List the data points of the time series that match the metric and labels values and that have data points in the interval. Large responses are paginated; use the nextPageToken returned in the response to request subsequent pages of results by setting the pageToken query parameter to the value of the nextPageToken.

google_cloudmonitoring.timeseries.list({
  "project": "",
  "metric": "",
  "youngest": ""
}, context)

Input

  • input object
    • project required string: The project ID to which this time series belongs. The value can be the numeric project ID or string-based project name.
    • metric required string: Metric names are protocol-free URLs as listed in the Supported Metrics page. For example, compute.googleapis.com/instance/disk/read_ops_count.
    • youngest required string: End of the time interval (inclusive), which is expressed as an RFC 3339 timestamp.
    • aggregator string (values: max, mean, min, sum): The aggregation function that will reduce the data points in each window to a single point. This parameter is only valid for non-cumulative metrics with a value type of INT64 or DOUBLE.
    • count integer: Maximum number of data points per page, which is used for pagination of results.
    • labels array: A collection of labels for the matching time series, which are represented as:
    • oldest string: Start of the time interval (exclusive), which is expressed as an RFC 3339 timestamp. If neither oldest nor timespan is specified, the default time interval will be (youngest - 4 hours, youngest]
    • pageToken string: The pagination token, which is used to page through large result sets. Set this value to the value of the nextPageToken to retrieve the next page of results.
    • timespan string: Length of the time interval to query, which is an alternative way to declare the interval: (youngest - timespan, youngest]. The timespan and oldest parameters should not be used together. Units:
    • window string: The sampling window. At most one data point will be returned for each window in the requested time interval. This parameter is only valid for non-cumulative metric types. Units:
    • body ListTimeseriesRequest
    • alt string (values: json): Data format for the response.
    • fields string: Selector specifying which fields to include in a partial response.
    • key string: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
    • oauth_token string: OAuth 2.0 token for the current user.
    • prettyPrint boolean: Returns response with indentations and line breaks.
    • quotaUser string: Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.
    • userIp string: IP address of the site where the request originates. Use this if you want to enforce per-user limits.

Output

timeseries.write

Put data points to one or more time series for one or more metrics. If a time series does not exist, a new time series will be created. It is not allowed to write a time series point that is older than the existing youngest point of that time series. Points that are older than the existing youngest point of that time series will be discarded silently. Therefore, users should make sure that points of a time series are written sequentially in the order of their end time.

google_cloudmonitoring.timeseries.write({
  "project": ""
}, context)

Input

  • input object
    • project required string: The project ID. The value can be the numeric project ID or string-based project name.
    • body WriteTimeseriesRequest
    • alt string (values: json): Data format for the response.
    • fields string: Selector specifying which fields to include in a partial response.
    • key string: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
    • oauth_token string: OAuth 2.0 token for the current user.
    • prettyPrint boolean: Returns response with indentations and line breaks.
    • quotaUser string: Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.
    • userIp string: IP address of the site where the request originates. Use this if you want to enforce per-user limits.

Output

timeseriesDescriptors.list

List the descriptors of the time series that match the metric and labels values and that have data points in the interval. Large responses are paginated; use the nextPageToken returned in the response to request subsequent pages of results by setting the pageToken query parameter to the value of the nextPageToken.

google_cloudmonitoring.timeseriesDescriptors.list({
  "project": "",
  "metric": "",
  "youngest": ""
}, context)

Input

  • input object
    • project required string: The project ID to which this time series belongs. The value can be the numeric project ID or string-based project name.
    • metric required string: Metric names are protocol-free URLs as listed in the Supported Metrics page. For example, compute.googleapis.com/instance/disk/read_ops_count.
    • youngest required string: End of the time interval (inclusive), which is expressed as an RFC 3339 timestamp.
    • aggregator string (values: max, mean, min, sum): The aggregation function that will reduce the data points in each window to a single point. This parameter is only valid for non-cumulative metrics with a value type of INT64 or DOUBLE.
    • count integer: Maximum number of time series descriptors per page. Used for pagination. If not specified, count = 100.
    • labels array: A collection of labels for the matching time series, which are represented as:
    • oldest string: Start of the time interval (exclusive), which is expressed as an RFC 3339 timestamp. If neither oldest nor timespan is specified, the default time interval will be (youngest - 4 hours, youngest]
    • pageToken string: The pagination token, which is used to page through large result sets. Set this value to the value of the nextPageToken to retrieve the next page of results.
    • timespan string: Length of the time interval to query, which is an alternative way to declare the interval: (youngest - timespan, youngest]. The timespan and oldest parameters should not be used together. Units:
    • window string: The sampling window. At most one data point will be returned for each window in the requested time interval. This parameter is only valid for non-cumulative metric types. Units:
    • body ListTimeseriesDescriptorsRequest
    • alt string (values: json): Data format for the response.
    • fields string: Selector specifying which fields to include in a partial response.
    • key string: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
    • oauth_token string: OAuth 2.0 token for the current user.
    • prettyPrint boolean: Returns response with indentations and line breaks.
    • quotaUser string: Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.
    • userIp string: IP address of the site where the request originates. Use this if you want to enforce per-user limits.

Output

Definitions

DeleteMetricDescriptorResponse

  • DeleteMetricDescriptorResponse object: The response of cloudmonitoring.metricDescriptors.delete.
    • kind string: Identifies what kind of resource this is. Value: the fixed string "cloudmonitoring#deleteMetricDescriptorResponse".

ListMetricDescriptorsRequest

  • ListMetricDescriptorsRequest object: The request of cloudmonitoring.metricDescriptors.list.
    • kind string: Identifies what kind of resource this is. Value: the fixed string "cloudmonitoring#listMetricDescriptorsRequest".

ListMetricDescriptorsResponse

  • ListMetricDescriptorsResponse object: The response of cloudmonitoring.metricDescriptors.list.
    • kind string: Identifies what kind of resource this is. Value: the fixed string "cloudmonitoring#listMetricDescriptorsResponse".
    • metrics array: The returned metric descriptors.
    • nextPageToken string: Pagination token. If present, indicates that additional results are available for retrieval. To access the results past the pagination limit, pass this value to the pageToken query parameter.

ListTimeseriesDescriptorsRequest

  • ListTimeseriesDescriptorsRequest object: The request of cloudmonitoring.timeseriesDescriptors.list
    • kind string: Identifies what kind of resource this is. Value: the fixed string "cloudmonitoring#listTimeseriesDescriptorsRequest".

ListTimeseriesDescriptorsResponse

  • ListTimeseriesDescriptorsResponse object: The response of cloudmonitoring.timeseriesDescriptors.list
    • kind string: Identifies what kind of resource this is. Value: the fixed string "cloudmonitoring#listTimeseriesDescriptorsResponse".
    • nextPageToken string: Pagination token. If present, indicates that additional results are available for retrieval. To access the results past the pagination limit, set this value to the pageToken query parameter.
    • oldest string: The oldest timestamp of the interval of this query, as an RFC 3339 string.
    • timeseries array: The returned time series descriptors.
    • youngest string: The youngest timestamp of the interval of this query, as an RFC 3339 string.

ListTimeseriesRequest

  • ListTimeseriesRequest object: The request of cloudmonitoring.timeseries.list
    • kind string: Identifies what kind of resource this is. Value: the fixed string "cloudmonitoring#listTimeseriesRequest".

ListTimeseriesResponse

  • ListTimeseriesResponse object: The response of cloudmonitoring.timeseries.list
    • kind string: Identifies what kind of resource this is. Value: the fixed string "cloudmonitoring#listTimeseriesResponse".
    • nextPageToken string: Pagination token. If present, indicates that additional results are available for retrieval. To access the results past the pagination limit, set the pageToken query parameter to this value. All of the points of a time series will be returned before returning any point of the subsequent time series.
    • oldest string: The oldest timestamp of the interval of this query as an RFC 3339 string.
    • timeseries array: The returned time series.
    • youngest string: The youngest timestamp of the interval of this query as an RFC 3339 string.

MetricDescriptor

  • MetricDescriptor object: A metricDescriptor defines the name, label keys, and data type of a particular metric.

MetricDescriptorLabelDescriptor

  • MetricDescriptorLabelDescriptor object: A label in a metric is a description of this metric, including the key of this description (what the description is), and the value for this description.
    • description string: Label description.
    • key string: Label key.

MetricDescriptorTypeDescriptor

  • MetricDescriptorTypeDescriptor object: A type in a metric contains information about how the metric is collected and what its data points look like.
    • metricType string: The method of collecting data for the metric. See Metric types.
    • valueType string: The data type of of individual points in the metric's time series. See Metric value types.

Point

  • Point object: Point is a single point in a time series. It consists of a start time, an end time, and a value.
    • boolValue boolean: The value of this data point. Either "true" or "false".
    • distributionValue PointDistribution
    • doubleValue number: The value of this data point as a double-precision floating-point number.
    • end string: The interval [start, end] is the time period to which the point's value applies. For gauge metrics, whose values are instantaneous measurements, this interval should be empty (start should equal end). For cumulative metrics (of which deltas and rates are special cases), the interval should be non-empty. Both start and end are RFC 3339 strings.
    • int64Value string: The value of this data point as a 64-bit integer.
    • start string: The interval [start, end] is the time period to which the point's value applies. For gauge metrics, whose values are instantaneous measurements, this interval should be empty (start should equal end). For cumulative metrics (of which deltas and rates are special cases), the interval should be non-empty. Both start and end are RFC 3339 strings.
    • stringValue string: The value of this data point in string format.

PointDistribution

PointDistributionBucket

  • PointDistributionBucket object: The histogram's bucket. Buckets that form the histogram of a distribution value. If the upper bound of a bucket, say U1, does not equal the lower bound of the next bucket, say L2, this means that there is no event in [U1, L2).
    • count string: The number of events whose values are in the interval defined by this bucket.
    • lowerBound number: The lower bound of the value interval of this bucket (inclusive).
    • upperBound number: The upper bound of the value interval of this bucket (exclusive).

PointDistributionOverflowBucket

  • PointDistributionOverflowBucket object: The overflow bucket is a special bucket that does not have the upperBound field; it includes all of the events that are no less than its lower bound.
    • count string: The number of events whose values are in the interval defined by this bucket.
    • lowerBound number: The lower bound of the value interval of this bucket (inclusive).

PointDistributionUnderflowBucket

  • PointDistributionUnderflowBucket object: The underflow bucket is a special bucket that does not have the lowerBound field; it includes all of the events that are less than its upper bound.
    • count string: The number of events whose values are in the interval defined by this bucket.
    • upperBound number: The upper bound of the value interval of this bucket (exclusive).

Timeseries

  • Timeseries object: The monitoring data is organized as metrics and stored as data points that are recorded over time. Each data point represents information like the CPU utilization of your virtual machine. A historical record of these data points is called a time series.
    • points array: The data points of this time series. The points are listed in order of their end timestamp, from younger to older.
    • timeseriesDesc TimeseriesDescriptor

TimeseriesDescriptor

  • TimeseriesDescriptor object: TimeseriesDescriptor identifies a single time series.
    • labels object: The label's name.
    • metric string: The name of the metric.
    • project string: The Developers Console project number to which this time series belongs.

TimeseriesDescriptorLabel

  • TimeseriesDescriptorLabel object
    • key string: The label's name.
    • value string: The label's value.

TimeseriesPoint

  • TimeseriesPoint object: When writing time series, TimeseriesPoint should be used instead of Timeseries, to enforce single point for each time series in the timeseries.write request.

WriteTimeseriesRequest

  • WriteTimeseriesRequest object: The request of cloudmonitoring.timeseries.write
    • commonLabels object: The label's name.
    • timeseries array: Provide time series specific labels and the data points for each time series. The labels in timeseries and the common_labels should form a complete list of labels that required by the metric.

WriteTimeseriesResponse

  • WriteTimeseriesResponse object: The response of cloudmonitoring.timeseries.write
    • kind string: Identifies what kind of resource this is. Value: the fixed string "cloudmonitoring#writeTimeseriesResponse".