Skip to content

Amehlem/opentelemetry#1574

Open
AMehlem wants to merge 18 commits intomicrosoft:mainfrom
AMehlem:amehlem/opentelemetry
Open

Amehlem/opentelemetry#1574
AMehlem wants to merge 18 commits intomicrosoft:mainfrom
AMehlem:amehlem/opentelemetry

Conversation

@AMehlem
Copy link

@AMehlem AMehlem commented Feb 24, 2026

Implemented sending metrics via OpenTelemetry protocol.

Copilot AI review requested due to automatic review settings February 24, 2026 13:53
@AMehlem
Copy link
Author

AMehlem commented Feb 24, 2026

@microsoft-github-policy-service agree company="Element44 GmbH"

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants