Skip to content

fix(telemetry): name the configured server and the named stack on Redis telemetry - #282

Merged
cosmin-staicu merged 2 commits into
mainfrom
fix/redis-telemetry-target
Oct 23, 2026
Merged

cosmin-staicu merged 2 commits into
mainfrom
fix/redis-telemetry-target

Conversation

@cosmin-staicu

Copy link
Copy Markdown
Member

Three fixes to the Redis telemetry, most visible on a cluster and with AddNamedCaching.

Dependency target. ProfiledCommandProcessor used the endpoint that served the command as the target, so on a cluster every shard's IP and port showed up as its own dependency target. The target is now the endpoints of RedisConnectionOptions.ConnectionString (with default ports filled in), and the node moves to a new RedisNode property (ProfiledCommandProcessor.NodeField). Without a connection string, as with a ConnectionFactory, the node stays the target.

Named stack tag. A named stack forwarded the application's ICachingTelemetryProvider as is, so the two stacks' dependencies and Caching.Stats.* metrics were indistinguishable, and stream metrics with the same names mixed. The stack now wraps it in StackTelemetryProvider, which adds CachingStack=<name> to every call. The application's stack adds no tag. A provider registered through configureServices is left alone.

Profiler sessions. Each stack has its own RedisProfiler, and a session opened on the application's profiler never reached the stack's, so the stack's commands landed in its default session without the request's session id. The application's profiler now opens and closes each session on the stack's profilers too. Forwarding the application's profiler into the stack still works (it is then the same instance).

Not changed: ICachingTelemetryProvider and the rest of Abstractions.

Tests: processor target and node cases, the decorator on all four calls (including more than nine properties), the profiler link (open, process on close, disposed follower), and the named stack wiring. Each fix was red-checked by mutating it out. Release -warnaserror build clean; the full suite passes on net10.0 and net8.0, with the Redis integration tests.

…is telemetry

A profiled command's dependency target was the node that served it, so on a
cluster each shard showed as its own target; it is now the configured
endpoints, with the node in a RedisNode property.

A named caching stack's telemetry is tagged with a CachingStack property, so
its stream and topic metrics no longer mix with the application's.

A session opened on the application's Redis profiler is opened on each named
stack's profiler too, so the stack's commands keep the request's session.

Signed-off-by: Cosmin Staicu <cosmin.staicu@uipath.com>
@github-actions github-actions Bot added the needs-cla-review A maintainer should assess whether a signed CLA is required (see CONTRIBUTING.md) label Oct 23, 2026
@github-actions

Copy link
Copy Markdown

🔎 Maintainer heads-up: automated triage flagged this PR as potentially material, so it may need a signed CLA in addition to the DCO sign-off.

Strong signals

  • adds public API surface (PublicAPI.Unshipped.txt in src/UiPath.Caching)

This is advisory only — the bot does not decide. Please judge against the CLA criteria (material, product-critical, patent-sensitive, corporate contributor, broad commercial use). Note that thresholds can be gamed by splitting PRs, so use your judgement.

  • If a CLA is needed → add the cla-required label (a contributor comment with signing steps is posted automatically).
  • If it is not needed → replace needs-cla-review with cla-not-required so later pushes don't re-flag it.

@cosmin-staicu cosmin-staicu added cla-not-required Maintainer reviewed: no CLA required for this contribution and removed needs-cla-review A maintainer should assess whether a signed CLA is required (see CONTRIBUTING.md) labels Oct 23, 2026
@cosmin-staicu cosmin-staicu self-assigned this Oct 23, 2026
…corator test's subject

Signed-off-by: Cosmin Staicu <cosmin.staicu@uipath.com>
@sonarqubecloud

Copy link
Copy Markdown

@cosmin-staicu
cosmin-staicu merged commit 5d3ae43 into main Oct 23, 2026
11 checks passed
@cosmin-staicu
cosmin-staicu deleted the fix/redis-telemetry-target branch October 23, 2026 13:06
cosmin-staicu added a commit that referenced this pull request Oct 23, 2026
…is telemetry (2.1) (#283)

Three fixes to the Redis telemetry, most visible on a cluster and with
`AddNamedCaching`.

**Dependency target.** `ProfiledCommandProcessor` used the endpoint that
served the command as the target, so on a cluster every shard's IP and
port showed up as its own dependency target. The target is now the
endpoints of `RedisConnectionOptions.ConnectionString` (with default
ports filled in), and the node moves to a new `RedisNode` property
(`ProfiledCommandProcessor.NodeField`). Without a connection string, as
with a `ConnectionFactory`, the node stays the target.

**Named stack tag.** A named stack forwarded the application's
`ICachingTelemetryProvider` as is, so the two stacks' dependencies and
`Caching.Stats.*` metrics were indistinguishable, and stream metrics
with the same names mixed. The stack now wraps it in
`StackTelemetryProvider`, which adds `CachingStack=<name>` to every
call. The application's stack adds no tag. A provider registered through
`configureServices` is left alone.

**Profiler sessions.** Each stack has its own `RedisProfiler`, and a
session opened on the application's profiler never reached the stack's,
so the stack's commands landed in its default session without the
request's session id. The application's profiler now opens and closes
each session on the stack's profilers too. Forwarding the application's
profiler into the stack still works (it is then the same instance).

Not changed: `ICachingTelemetryProvider` and the rest of Abstractions.

Tests: processor target and node cases, the decorator on all four calls
(including more than nine properties), the profiler link (open, process
on close, disposed follower), and the named stack wiring. Each fix was
red-checked by mutating it out. Release `-warnaserror` build clean; the
full suite passes on net10.0 and net8.0, with the Redis integration
tests.

Backport of #282 to 2.1.x. On 2.1 the telemetry interface takes spans,
so the decorator copies from a span and the tests use the recording
provider instead of a substitute.

---------

Signed-off-by: Cosmin Staicu <cosmin.staicu@uipath.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-not-required Maintainer reviewed: no CLA required for this contribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants