Spans for HTTP requests - `UnityWebRequest` and `HttpMessageHandler`

Abierto
#737 3 comentarios 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 3 días

@bitsandfoxes ya está trabajando en esto.

Desde el 9/5/2022.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

Improvement Traces Unity

When a user makes an HTTP request to their backend, we want to measure how long that took. And propagate the trace id so we can have end to end tracing.

This can be split in:

HttpMessageHandler

The .NET approach. Used in Sentry Defenses:
https://github.com/getsentry/sentry-defenses/blob/2989949f857f1cccb46814ce0a05d50f603f9222/game/Assets/Scripts/Manager/BugSpawner.cs#L37

We need to find a way add the handler automatically. At least on the one assembly created by Unity when compiling the scripts.

Steps:

  • A PoC that gets a DLL that has new HttpClient(...) and adds the middleware (as done in Sentry defenses) @SimonCropp
  • Find out which Unity hooks can we rely on to get the GameAssembly.dll @bitsandfoxes
  • With the PoC we can discuss next steps such as: Is this a .NET Global Tool? Do we have the code in Sentry.Unity.Editor?

UnityWebRequests (Unity Client)

Example HTTP client usage: https://github.com/getsentry/sentry-unity/blob/7774137c35ce4a3653b934e15ed15f0078a2ee36/src/Sentry.Unity/UnityWebRequestTransport.cs#L75-L81
We need a way to plug Sentry in there. First 'manually' with some C# code. Then automatically, possibly with IL weaving.

  • We need a strategy to get spans/crumbs similar to SentryHttpMessageHandler @bitsandfoxes
  • PoC with IL weaving a DLL using UnityWebRequest and add the new interceptor @SimonCropp
  • With the PoC we can discuss next steps such as: Is this a .NET Global Tool? Do we have the code in Sentry.Unity.Editor?
Lenguaje dominante
C#
Estrellas
294
Forks
63
Merge medio
3 d 17 h
PR fusionados (30 d)
26

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de getsentry/sentry-unity

Todos los issues de getsentry/sentry-unity

Issues similares

Más issues de C#

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.