Open
Conversation
added 4 commits
February 20, 2026 17:33
… metrics after checking the OpenTelemetry documentation. Add comments.
Author
|
@microsoft-github-policy-service agree company="Element44 GmbH" |
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request implements OpenTelemetry metrics export functionality for the Garnet server, enabling observability through the OTLP (OpenTelemetry Protocol) by exposing server-level, session-level, and latency metrics via the OpenTelemetry SDK.
Changes:
- Added OpenTelemetry SDK integration with configurable endpoint, protocol, timeout, and interval settings
- Exposed server connection metrics (active, received, disposed), session metrics (commands, network I/O, cache lookups), and latency metrics (command processing time, bytes/ops per call) as OpenTelemetry instruments
- Added comprehensive configuration options in GarnetServerOptions and command-line interface
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| Directory.Packages.props | Added OpenTelemetry and OpenTelemetry.Exporter.OpenTelemetryProtocol package dependencies (version 1.13.1) |
| libs/server/Garnet.server.csproj | Referenced OpenTelemetry.Exporter.OpenTelemetryProtocol package |
| libs/server/Servers/GarnetServerOptions.cs | Added OpenTelemetry configuration properties and validation logic |
| libs/server/StoreWrapper.cs | Integrated GarnetOpenTelemetryServerMonitor lifecycle management |
| libs/server/Metrics/GarnetOpenTelemetryServerMonitor.cs | Central coordinator for OpenTelemetry metrics registration and OTLP exporter configuration |
| libs/server/Metrics/GarnetOpenTelemetryServerMetrics.cs | Exposes server connection metrics as OpenTelemetry instruments |
| libs/server/Metrics/GarnetOpenTelemetrySessionMetrics.cs | Exposes session-level metrics (commands, network, cache) as OpenTelemetry instruments |
| libs/server/Metrics/Latency/GarnetOpenTelemetryLatencyMetrics.cs | Provides latency metrics using histograms for command processing time and per-call metrics |
| libs/server/Metrics/Latency/GarnetLatencyMetricsSession.cs | Integrated OpenTelemetry latency recording into existing latency tracking |
| libs/server/Metrics/Info/GarnetInfoMetrics.cs | Added OpenTelemetry endpoint and export status to INFO command output |
| libs/host/Configuration/Options.cs | Added command-line options for OpenTelemetry configuration |
| libs/host/defaults.conf | Added default OpenTelemetry configuration values |
| test/Garnet.test/TestUtils.cs | Added enableOpenTelemetry parameter to test server creation |
| test/Garnet.test/OpenTelemetryTests.cs | Added comprehensive tests for OpenTelemetry functionality including disabled, invalid, and enabled scenarios |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
libs/server/Metrics/Latency/GarnetOpenTelemetryLatencyMetrics.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…lem/opentelemetry
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implemented sending metrics via OpenTelemetry protocol.