Production engineering
using System;
using System.Linq;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using System.Text.Json;
using System.Threading;
using System.Threading.Tasks;
string Map(string value)=>value is "quote" or "search"?value:"other"; var labels=new SortedSet<string>(new[]{"quote","user-a","user-b","search"}.Select(Map),StringComparer.Ordinal); Console.WriteLine("dimensions:"+labels.Count); Console.WriteLine(string.Join(",",labels)); Console.WriteLine("identity:redacted");
Reveal answer and reasoning
The output lines, in order, are “dimensions:3”; “other,quote,search”; “identity:redacted”. The portable .NET9 console program maps quote and search to themselves and every other supplied label to other. user-a and user-b therefore collapse into one dimension. SortedSet with ordinal comparison stores the three distinct labels and prints dimensions:3 followed by other,quote,search. The final identity:redacted line is a supplied domain label, not an exporter operation or an irreversible transformation of an identifier.
No logger, MeterListener or telemetry backend runs in this companion. The deterministic set result explains cardinality reduction, while real signal emission and application logging are separate external observations.
A hashed user identifier can remain linkable and create as many series as the original identifiers, so changing spelling is not automatically anonymization or bounded cardinality. Query parameters can also appear in systems outside this logger's filter. The endpoint's email-like input should remain artificial classroom data, and the response does not certify deployment-wide handling of real personal information. Error messages, request bodies, retained source stores, trace baggage and third-party exporters require separate policy.
Even within one process, another logging provider or category could have a different exposure path, so inspection must follow actual configured owners rather than one safe message template.
What a strong answer covers
- Exact output: dimensions:3 | other,quote,search | identity:redacted
- The portable .NET9 console program maps quote and search to themselves and every other supplied label to other.
- A hashed user identifier can remain linkable and create as many series as the original identifiers, so changing spelling is not automatically anonymization or bounded cardinality.
Common pitfall
A hashed user identifier can remain linkable and create as many series as the original identifiers, so changing spelling is not automatically anonymization or bounded cardinality. Query parameters can also appear in systems outside this logger's filter. The endpoint's email-like input should remain artificial classroom data, and the response does not certify deployment-wide handling of real personal information. Error messages, request bodies, retained source stores, trace baggage and third-party exporters require separate policy. Even within one process, another logging provider or category could have a different exposure path, so inspection must follow actual configured owners rather than one safe message template.
Follow-up questions
- Why can hashing every user ID preserve both high metric cardinality and cross-event linkability?
- Which downstream owner could still record the original request URL despite this application logger filter?
Self-review
Choose what to revisit. These marks are your own assessment and are separate from lesson completion.