Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Add Custom OpenTelemetry Exporter in for Service Metrics #2270

Closed
wants to merge 3 commits into from

Conversation

ravjotbrar
Copy link

Description

This change adds an implementation for an OpenTelemetry exporter to send the following service metrics that are already present in the Python, Go and Java clients:

operation_latencies
operation_count
attempt_latencies
attempt_count
gfe_latency
gfe_missing_header_count

Files added to a metrics folder in /src/metrics/ folder:

constants.ts - Constant values such as metric and label names to be used by both the exporter and eventual implementing code.
spanner-metrics-exporter.ts - The definition for the exporter
external-types.ts - Type definition for ExporterOptions, MetricKind, and ValueType
transform.ts - Methods that help create a GCM timeseries list from scope metrics.

Based on regular client Google Cloud Monitoring exporter found here

Impact

Integrates Built-in Metrics support into Node.js spanner client library.

Testing

Unit tests were added in /test/metrics

Checklist

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease
  • Appropriate docs were updated
  • Appropriate comments were added, particularly in complex areas or places that require background
  • No new warnings or issues will be generated from this change

Fixes #issue_number_goes_here 🦕

@ravjotbrar ravjotbrar requested review from a team as code owners March 28, 2025 01:33
@product-auto-label product-auto-label bot added size: xl Pull request size is extra large. api: spanner Issues related to the googleapis/nodejs-spanner API. labels Mar 28, 2025
@lszinv
Copy link

lszinv commented Mar 31, 2025

Looking to resolve the CI failures on older node versions.

Will see if I can reduce usage of the new packages

@lszinv
Copy link

lszinv commented Apr 2, 2025

Please close this as edits/changes are being handled in #2272 instead

@rahul2393 rahul2393 closed this Apr 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the googleapis/nodejs-spanner API. size: xl Pull request size is extra large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants