Skip to content

Commit 13b7ea4

Browse files
committed
Remove endpoint request metric
1 parent a375425 commit 13b7ea4

3 files changed

Lines changed: 1 addition & 30 deletions

File tree

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,12 +418,11 @@ Authentication activities also add `hashgate.content_hash.validated` when the re
418418
| `hashgate.auth.duration` | Histogram | `ms` | Duration of HMAC authentication attempts |
419419
| `hashgate.replay_protection.checks` | Counter | `{check}` | Number of HMAC replay protection checks |
420420
| `hashgate.replay_protection.replays` | Counter | `{replay}` | Number of rejected replayed HMAC signatures |
421-
| `hashgate.endpoint.requests` | Counter | `{request}` | Number of rate-limited endpoint requests resolved by HashGate |
422421
| `hashgate.rate_limit.rejections` | Counter | `{rejection}` | Number of requests rejected by HashGate rate limiting |
423422
| `hashgate.rate_limit.provider.lookup` | Counter | `{lookup}` | Number of per-client rate limit provider lookups |
424423
| `hashgate.rate_limit.provider.miss` | Counter | `{miss}` | Number of per-client rate limit provider lookups that fell back to default limits |
425424

426-
Authentication metrics include `hashgate.auth.scheme`, `hashgate.auth.result`, `hashgate.client`, `hashgate.endpoint`, and, for failures, `hashgate.auth.failure_reason`. Use `hashgate.auth.requests` grouped by `hashgate.client` and `hashgate.endpoint` to track which clients are using which API endpoints. Replay protection metrics include `hashgate.replay_protection.result`. Rate limit metrics include `hashgate.rate_limit.policy`; endpoint request metrics also include `hashgate.client` and `hashgate.endpoint`; provider lookup metrics also include `hashgate.rate_limit.provider_found`.
425+
Authentication metrics include `hashgate.auth.scheme`, `hashgate.auth.result`, `hashgate.client`, `hashgate.endpoint`, and, for failures, `hashgate.auth.failure_reason`. Use `hashgate.auth.requests` grouped by `hashgate.client` and `hashgate.endpoint` to track which clients are using which API endpoints. Replay protection metrics include `hashgate.replay_protection.result`. Rate limit metrics include `hashgate.rate_limit.policy`; provider lookup metrics also include `hashgate.rate_limit.provider_found`.
427426

428427
### Custom Key Provider
429428

src/HashGate.AspNetCore/HashGateDiagnostics.cs

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,6 @@ public static class HashGateDiagnostics
4545
/// </summary>
4646
public const string ReplayProtectionReplaysName = "hashgate.replay_protection.replays";
4747

48-
/// <summary>
49-
/// The metric name for rate-limited endpoint requests resolved by HashGate.
50-
/// </summary>
51-
public const string EndpointRequestsName = "hashgate.endpoint.requests";
52-
5348
/// <summary>
5449
/// The metric name for requests rejected by HashGate rate limiting.
5550
/// </summary>
@@ -181,13 +176,6 @@ public static class HashGateDiagnostics
181176
unit: "{replay}",
182177
description: "Number of rejected replayed HMAC signatures.");
183178

184-
185-
internal static readonly Counter<long> EndpointRequests = Meter.CreateCounter<long>(
186-
name: EndpointRequestsName,
187-
unit: "{request}",
188-
description: "Number of rate-limited endpoint requests resolved by HashGate.");
189-
190-
191179
internal static readonly Counter<long> RateLimitRejections = Meter.CreateCounter<long>(
192180
name: RateLimitRejectionsName,
193181
unit: "{rejection}",
@@ -262,21 +250,6 @@ internal static void RecordReplayProtectionCheck(string result, double ttlMillis
262250
ReplayProtectionReplays.Add(1, in tags);
263251
}
264252

265-
internal static void RecordEndpointRequest(string policy, string endpoint, string client)
266-
{
267-
if (!EndpointRequests.Enabled)
268-
return;
269-
270-
TagList tags =
271-
[
272-
new(RateLimitPolicyTagName, policy),
273-
new(EndpointTagName, endpoint),
274-
new(ClientTagName, client)
275-
];
276-
277-
EndpointRequests.Add(1, in tags);
278-
}
279-
280253
internal static void RecordRateLimitRejection(string policy, double retryAfterMilliseconds)
281254
{
282255
if (!RateLimitRejections.Enabled)

src/HashGate.AspNetCore/RequestLimitExtensions.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ private static RateLimitPartition<string> Partition(HttpContext httpContext, str
202202
Activity.Current?.SetTag(HashGateDiagnostics.RateLimitBurstFactorTagName, limit.BurstFactor);
203203
Activity.Current?.SetTag(HashGateDiagnostics.RateLimitPartitionSourceTagName, partitionSource);
204204

205-
HashGateDiagnostics.RecordEndpointRequest(policy, endpoint, client);
206205
HashGateDiagnostics.RecordRateLimitProviderLookup(policy, hasConfiguredLimit);
207206

208207
// Include a content-derived version so that limit changes in configuration

0 commit comments

Comments
 (0)