Members
MethodName
Represents the names of Bigtable methods. These are used as attributes for metrics, allowing for differentiation of performance by method.
RowStateEnum
Enum for chunk formatter Row state. NEW_ROW: initial state or state after commitRow or resetRow ROW_IN_PROGRESS: state after first valid chunk without commitRow or resetRow CELL_IN_PROGRESS: state when valueSize > 0(partial cell)
(constant) gapicConfig
Client JSON configuration object, loaded from
src/v2/bigtable_client_config.json
.
This file defines retry strategy and timeouts for all API methods in this library.
(constant) gapicConfig
Client JSON configuration object, loaded from
src/v2/bigtable_instance_admin_client_config.json
.
This file defines retry strategy and timeouts for all API methods in this library.
(constant) gapicConfig
Client JSON configuration object, loaded from
src/v2/bigtable_table_admin_client_config.json
.
This file defines retry strategy and timeouts for all API methods in this library.
Methods
createInstruments(projectId, exporter)
This method gets the open telemetry instruments that will store GCP metrics for a particular project.
Parameters:
Name | Type | Description |
---|---|---|
projectId |
The project for which the instruments will be stored. |
|
exporter |
The exporter the metrics will be sent to. |
getDistributionPoints(dataPoint)
This function gets the timeseries data points for metrics that are represented as distributions on the backend. These data points are part of a timeseries object that is recorded to Google Cloud Monitoring.
Parameters:
Name | Type | Description |
---|---|---|
dataPoint |
DataPoint |
The datapoint containing the data we wish to send to the Google Cloud Monitoring dashboard |
getDomain(prefixopt, optionsopt, gaxOptsopt) → {string}
Retrieves the domain to be used for the service path.
This function retrieves the domain from gax.ClientOptions passed in or via an environment variable. It defaults to 'googleapis.com' if none has been set.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
prefix |
string |
<optional> |
The prefix for the domain. |
options |
BigtableOptions |
<optional> |
The options passed into the Bigtable client. |
gaxOpts |
gax.ClientOptions |
<optional> |
The gax client options. |
Returns:
Type | Description |
---|---|
string |
The universe domain. |
getIntegerPoints(dataPoint)
This function gets the timeseries data points for metrics that are represented as integers on the backend. These data points are part of a timeseries object that is recorded to Google Cloud Monitoring.
Parameters:
Name | Type | Description |
---|---|---|
dataPoint |
DataPoint |
The datapoint containing the data we wish to send to the Google Cloud Monitoring dashboard |
getMetric(metricName, dataPoint)
getMetric gets the metric object which is used for building the timeseries object that will be sent to Google Cloud Monitoring dashboard
Parameters:
Name | Type | Description |
---|---|---|
metricName |
string |
The backend name of the metric that we want to record |
dataPoint |
DataPoint |
The datapoint containing the data we wish to send to the Google Cloud Monitoring dashboard |
getProperties(row)
getProperties returns the properties needed to make a request for a table.
Parameters:
Name | Type | Description |
---|---|---|
row |
Row |
The row to make a request for. |
getResource(metricName, dataPoint)
getResource gets the resource object which is used for building the timeseries object that will be sent to Google Cloud Monitoring dashboard
Parameters:
Name | Type | Description |
---|---|---|
metricName |
string |
The backend name of the metric that we want to record |
dataPoint |
DataPoint |
The datapoint containing the data we wish to send to the Google Cloud Monitoring dashboard |
getUniverseDomainOnly(options, gaxOptsopt) → {string|undefined}
Retrieves the universe domain, if configured.
This function checks for a universe domain in the following order:
- The
universeDomain
property within the provided options. - The
universeDomain
oruniverse_domain
property within theopts
object. - The
GOOGLE_CLOUD_UNIVERSE_DOMAIN
environment variable.
If a universe domain is found in any of these locations, it is returned.
Otherwise, the function returns undefined
.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
options |
BigtableOptions |
The Bigtable client options. |
|
gaxOpts |
gax.ClientOptions |
<optional> |
Optional gax client options. |
Returns:
Type | Description |
---|---|
string | undefined |
The universe domain, or |
getUniverseDomainOptions(options, gaxOptsopt) → {Object|null}
Retrieves the universe domain options from the provided options.
This function examines the provided BigtableOptions and an optional
gax.ClientOptions object to determine the universe domain to be used.
It prioritizes the universeDomain
property in the options, then checks
for universeDomain
or universe_domain
in the gax options, and finally
falls back to the GOOGLE_CLOUD_UNIVERSE_DOMAIN
environment variable.
If a universe domain is found, it returns an object containing the
universeDomain
property; otherwise, it returns null
.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
options |
BigtableOptions |
The Bigtable client options. |
|
gaxOpts |
gax.ClientOptions |
<optional> |
Optional gax client options. |
Returns:
Type | Description |
---|---|
Object | null |
An object containing the |
isCounterValue()
Type guard function to determine if a given value is a counter value (a number).
This function checks if a value, which could be either a DistributionValue
object or a number
, is specifically a number
. This is used to differentiate
between counter metrics (which have numeric values) and distribution metrics
(which have more complex, object-based values).
metricsToRequest(exportArgs)
Converts OpenTelemetry metrics data into a format suitable for the Google Cloud
Monitoring API's createTimeSeries
method.
This function transforms the structured metrics data, including resource and metric attributes, data points, and aggregation information, into an object that conforms to the expected request format of the Cloud Monitoring API.
Parameters:
Name | Type | Description |
---|---|---|
exportArgs |
ResourceMetrics |
The OpenTelemetry metrics data to be converted. This object contains resource attributes, scope information, and a list of metrics with their associated data points. |
Returns:
Type | Description |
---|---|
An object representing a |
Throws:
Will throw an error if there are issues converting the data.
Example
const exportInput: ExportInput = { ... }; // Example ExportInput object
const monitoringRequest = metricsToRequest(exportInput);
// monitoringRequest can now be used in monitoringClient.createTimeSeries(monitoringRequest)
Type Definitions
ClientConfig
Properties:
Name | Type | Attributes | Default | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
apiEndpoint |
string |
<optional> |
Override the default API endpoint used to reach Bigtable. This is useful for connecting to your local Bigtable emulator. |
|||||||||||||
projectId |
string |
<optional> |
The project ID from the Google Developer's
Console, e.g. 'grape-spaceship-123'. We will also check the environment
variable |
|||||||||||||
keyFilename |
string |
<optional> |
Full path to the a .json, .pem, or .p12 key
downloaded from the Google Developers Console. If you provide a path to a
JSON file, the |
|||||||||||||
appProfileId |
string |
<optional> |
An application profile ID, a configuration string value describing how Cloud Bigtable should treat traffic from a particular end user application. |
|||||||||||||
email |
string |
<optional> |
Account email address. Required when using a .pem or .p12 keyFilename. |
|||||||||||||
credentials |
object |
<optional> |
Credentials object. Properties
|
|||||||||||||
autoRetry |
boolean |
<optional> |
true |
Automatically retry requests if the response is related to rate limits or certain intermittent server errors. We will exponentially backoff subsequent requests by default. |
||||||||||||
maxRetries |
number |
<optional> |
3 |
Maximum number of automatic retries attempted before returning the error. |
GetInstancesCallback(errnullable, instances, locations, apiResponse)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
err |
Error |
<nullable> |
Request error, if any. |
instances |
Array.<Instance> |
Array of Instance instances. |
|
locations |
Array.<string> |
from which Instance information could not be retrieved |
|
apiResponse |
object |
The full API response.
Note: 'failedLocations' property may contain locations from which
Instance information could not be retrieved.
Values are of the form |
GetInstancesResponse
Properties:
Name | Type | Description |
---|---|---|
0 |
Array.<Instance> |
Array of Instance instances. |
1 |
Array.<string> |
locations from which Instance information could not be retrieved |
2 |
object |
The full API response.
Note: 'failedLocations' property may contain locations from which
Instance information could not be retrieved.
Values are of the form |