[Feature]: OpenTelemetry ActivitySource and ILogger integration

Chiusa
#3,439 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
54/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
csharp

Direzione di ricerca

Start with Connection.cs around WrapApiCallAsync at lines 532–560, where the issue says titles and stack frames are already built. Trace how API calls and pw:api / pw:channel logs are currently emitted, then identify the existing tests for those paths. Done means public API calls produce the requested spans and an optional ILoggerFactory can receive those logs.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

🚀 Feature Request
  • Emit a System.Diagnostics.ActivitySource("Microsoft.Playwright") span per public API call, with the title and caller source location.
  • Accept an optional ILoggerFactory (e.g. Playwright.CreateAsync(new() { LoggerFactory = ... })) for the pw:api / pw:channel logs that currently go to Console.Error / Trace only.
Example
using var tp = Sdk.CreateTracerProviderBuilder()
    .AddSource("Microsoft.Playwright").AddOtlpExporter().Build();
// spans: Page.GotoAsync (ExampleTests.cs:42) -> Locator.ClickAsync (ExampleTests.cs:43) ...
Motivation

The data is already computed: Connection.WrapApiCallAsync builds a title and stack frames for every call (Connection.cs#L532-L560). Exposing them as spans puts Playwright steps in the same trace as the app under test (ASP.NET Core, HttpClient, EF), which helps a lot when debugging slow or flaky end-to-end tests in CI.

Lingua principale
C#
Stelle
3k
Fork
307
Merge medio
1g 14h
PR unite (30g)
32

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di microsoft/playwright-dotnet

Tutte le issue di microsoft/playwright-dotnet

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.