Skip to content

feat: add client side metrics for redis#5582

Open
fosky94 wants to merge 15 commits into
GoogleCloudPlatform:mainfrom
fosky94:main
Open

feat: add client side metrics for redis#5582
fosky94 wants to merge 15 commits into
GoogleCloudPlatform:mainfrom
fosky94:main

Conversation

@fosky94

@fosky94 fosky94 commented May 19, 2026

Copy link
Copy Markdown
Member

Description

Added a new sample code to log client side metrics and traces for redis. this will be added to the public docs once this sample code is posted

client libraries that need to be installed:

go get github.com/gomodule/redigo/redis@latest
go get go.opentelemetry.io/otel
go get go.opentelemetry.io/otel/sdk/trace
go get go.opentelemetry.io/otel/sdk/metric
go get github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace
go get github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric

@fosky94 fosky94 requested review from a team as code owners May 19, 2026 23:02
@product-auto-label product-auto-label Bot added the samples Issues that are directly related to samples. label May 19, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new Go application demonstrating the integration of OpenTelemetry with a Redis client. It features telemetry initialization for Google Cloud and a robust smartRedisCall wrapper that provides retry logic, tracing, and metric collection for latency and connectivity errors. The review feedback suggests several improvements: handling errors during metric creation, making the telemetry shutdown and retry backoffs context-aware to prevent hangs, clarifying placeholder logic, and improving error reporting by wrapping the original cause when retries fail.

Comment thread memorystore/redis/client_side_metrics/main.go Outdated
Comment thread memorystore/redis/client_side_metrics/main.go Outdated
Comment thread memorystore/redis/client_side_metrics/main.go Outdated
Comment thread memorystore/redis/client_side_metrics/main.go Outdated
Comment thread memorystore/redis/client_side_metrics/main.go Outdated
Comment thread memorystore/redis/client_side_metrics/main.go Outdated
@amcolin amcolin self-assigned this May 26, 2026
@snippet-bot

snippet-bot Bot commented Jun 9, 2026

Copy link
Copy Markdown

Here is the summary of changes.

You are about to add 1 region tag.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@fosky94 fosky94 left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added region tags

@fosky94 fosky94 left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

feat: add client side metrics for redis

This commit introduces functionality to capture and expose client-side metrics for Memorystore for Redis interactions.

@fosky94 fosky94 changed the title Create Client side metrics for redis feat: add client side metrics for redis Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants