Skip to content

Commit daaab37

Browse files
author
Chetan Pandey
committed
Making description more clear
1 parent 0894cc0 commit daaab37

1 file changed

Lines changed: 37 additions & 10 deletions

File tree

specs/DiagnosticMonitor.md

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,35 @@ interactive (they expect a response), and each has its own event
1111
shape.
1212

1313
The Diagnostic Monitor API introduces an observation-only monitor
14-
object that delivers diagnostic signals from all layers — WebView,
14+
API that delivers diagnostic signals from all layers — WebView,
1515
Profile, and Environment — through a single `DiagnosticReceived`
16-
event. Host apps create a monitor from the environment and opt in
16+
event. Host apps create monitors from the environment and opt in
1717
per category using `SetDiagnosticFilter`.
1818

1919

2020
# Description
2121

2222
You create an `ICoreWebView2DiagnosticMonitor` from the environment
23-
using `CreateDiagnosticMonitor`. The monitor observes diagnostic
24-
signals across all WebViews, profiles, and the environment itself.
25-
You control which categories of events are delivered by calling
26-
`SetDiagnosticFilter` with a category and an optional JSON
27-
filter string.
23+
using `CreateDiagnosticMonitor`. The monitor is strictly
24+
**observation-only** — it reports diagnostic signals but does not
25+
allow the host to intercept, modify, or respond to them. Unlike
26+
interactive APIs such as `ServerCertificateErrorDetected`, the
27+
monitor never expects a response and has no deferral mechanism.
28+
It is designed purely for logging and telemetry, not for making
29+
runtime decisions.
30+
31+
The monitor observes diagnostic signals across all WebViews,
32+
profiles, and the environment itself. You control which categories
33+
of events are delivered by calling `SetDiagnosticFilter` with a
34+
category and a JSON filter string.
35+
36+
The API is **JSON-in / JSON-out by design**. Filters are expressed
37+
as JSON objects whose schema is defined and maintained as part of
38+
the API contract. Diagnostic details are returned as JSON strings
39+
whose schema is documented per category with a set of guaranteed
40+
fields; the runtime may include additional key-value pairs beyond
41+
the documented set, so consumers should ignore unknown keys and
42+
must not treat the documented schema as exhaustive.
2843

2944
Key scenarios:
3045

@@ -344,7 +359,9 @@ interface ICoreWebView2DiagnosticReceivedEventArgs : IUnknown {
344359
/// }
345360
/// ```
346361
///
347-
/// `errorCode` is the Chromium net error code (integer).
362+
/// `errorCode` is the Chromium net error code (negative
363+
/// integer). See the authoritative list at
364+
/// [net_error_list.h](https://source.chromium.org/chromium/chromium/src/+/main:net/base/net_error_list.h).
348365
/// `statusCode` is the HTTP response status code
349366
/// (integer, 0 if no response was received).
350367
/// `httpMethod` is the HTTP method string.
@@ -353,6 +370,11 @@ interface ICoreWebView2DiagnosticReceivedEventArgs : IUnknown {
353370
/// `protocol` is the protocol scheme (e.g. "https").
354371
/// `uri` is the request URI.
355372
///
373+
/// The runtime may include additional key-value pairs
374+
/// beyond the fields listed above. Consumers should
375+
/// ignore unknown keys and must not treat the documented
376+
/// schema as exhaustive.
377+
///
356378
/// For categories that the runtime does not yet populate,
357379
/// this method returns `"{}"`.
358380
///
@@ -399,6 +421,9 @@ interface ICoreWebView2DiagnosticMonitor : IUnknown {
399421
/// After this call, `DiagnosticReceived` will fire for
400422
/// events in this category that match the JSON criteria.
401423
///
424+
/// The filter JSON schema is defined and maintained as
425+
/// part of the API contract.
426+
///
402427
/// Pass `"{}"` or an empty string as `jsonFilter` to
403428
/// receive all events in the category without
404429
/// field-level filtering.
@@ -524,8 +549,10 @@ namespace Microsoft.Web.WebView2.Core
524549
Int64 Timestamp { get; };
525550

526551
/// Returns category-specific data as a JSON
527-
/// string. Returns "{}" for unrecognized
528-
/// categories.
552+
/// string. The runtime may include additional
553+
/// key-value pairs beyond the documented fields;
554+
/// consumers should ignore unknown keys.
555+
/// Returns "{}" for unrecognized categories.
529556
String GetDetailsAsJson();
530557
}
531558

0 commit comments

Comments
 (0)