Commit Graph

45 Commits

Author SHA1 Message Date
Robin
7221b7c3a2
Merge pull request #998 from robintown/rageshake-processor
Include unended spans in rageshakes
2023-04-14 11:55:16 -04:00
Robin Townsend
da7760d7ab Send rejoin events to PostHog in realtime
By converting PosthogSpanExporter to a SpanProcessor just like the RageshakeSpanProcessor, it can now monitor spans in realtime as they are started.
2023-04-12 18:14:59 -04:00
Robin Townsend
a17ffcc327 Include unended spans in rageshakes
By turning the RageshakeSpanExporter into a SpanProcessor, it can now be notified of spans as soon as they're started.
2023-04-12 17:12:02 -04:00
Robin Townsend
0637804d61 Fix a crash when adding call events to telemetry
Since typeof null is 'object', the flattenVoipEventRecursive function was mistakenly casting nulls to Record<string, unknown> in its typeof v === "object" case, causing Object.entries to explode.
2023-04-11 23:05:37 -04:00
Robin Townsend
95eca18207 Include OpenTelemetry traces in rageshakes 2023-04-11 01:13:19 -04:00
Enrico Schwendig
bb5c382fd0
separate summary report from stats report (#986)
* stats: separate summary report from stats report

* stats: switch to last summery stats builder

* stats: update matrix-js-sdk
2023-04-06 13:19:39 +02:00
David Baker
dd1485a277
Merge pull request #988 from vector-im/dbkr/enable_otel_by_collector
Allow different OpenTelemetry collectors to be enabled/disabled
2023-04-05 20:05:41 +01:00
David Baker
caea22fa89 Remove the recheck callback since it isn't necessary for now 2023-04-05 19:00:07 +01:00
David Baker
88f3b30040 Allow different OpenTelemetry collectors to be enabled/disabled
Always enable OpenTelemetry, but conditionally enable the OTLP
exporter, as per comment.

Fixes https://github.com/vector-im/element-call/issues/987
2023-04-05 18:21:29 +01:00
Robin Townsend
928f1c1d6f Address review feedback 2023-04-05 12:56:50 -04:00
Robin Townsend
711cdf9a60 Merge branch 'main' into audio-observability 2023-04-05 12:50:38 -04:00
David Baker
fec299ab20 Skip whole block if no otel instance 2023-04-05 15:11:51 +01:00
David Baker
0dcaa90650 Fix exception when loading PostHog
PostHog was expecting the matrix client object to be initialised at
the point it ran its setup, which wasn't the case. Check to see if it's
there on login and add an onLoginStatusChanged hook that to re-check.

Also make a few methods private that didn't need to be public.

Also fix a few instances where the OpenTelemetry group call tried to
report metrics using a tracer which didn't exist anymore, if the user
disabled analytics and then joined the same call again.
2023-04-05 13:06:55 +01:00
David Baker
b061cbfb2f Remove the other listeners 2023-04-05 10:01:58 +01:00
David Baker
23ddd73f4f Merge remote-tracking branch 'origin/main' into dbkr/otel_peerconn_events 2023-04-05 09:35:43 +01:00
Enrico Schwendig
390442a4c3
Add webrtc metric to OTel (#974)
* stats: Add summery report

---------

Co-authored-by: David Baker <dave@matrix.org>
2023-04-05 10:25:26 +02:00
David Baker
c824ea6f9a Add OpenTelemetry events for PeerConnection state changes / errors
Creates a new class to represent individual calls and adds the listeners
there.

Requires https://github.com/matrix-org/matrix-js-sdk/pull/3251
Based on https://github.com/vector-im/element-call/pull/974
2023-04-04 18:00:45 +01:00
David Baker
28196a2e9d
Merge pull request #981 from vector-im/dbkr/call_events_to_call_span
Move call events to the call span
2023-04-04 17:52:41 +01:00
David Baker
5b70def4d2 Add null check for call span 2023-04-04 17:49:49 +01:00
David Baker
2cd549cdc8
Merge pull request #982 from vector-im/dbkr/otel_flatten_include_booleans
Include booleans in flattened OpenTelemetry object
2023-04-04 17:26:20 +01:00
David Baker
30f75c6cd2 Don't pass null / undefined as attribute value 2023-04-03 17:41:40 +01:00
David Baker
8fa23b7da9 Include booleans in flattened OpenTelemetry object 2023-04-03 16:58:29 +01:00
David Baker
277081ee2a Move call events to the call span 2023-04-03 14:35:04 +01:00
David Baker
3a7983d2de Add displayname on call spans 2023-04-03 14:31:17 +01:00
Enrico Schwendig
3b06258e40 stats: rename enum to avoid shadow values 2023-04-03 14:07:29 +02:00
Enrico Schwendig
889a31489b stats: fix typo 2023-04-03 12:37:55 +02:00
Enrico Schwendig
dd67a45671 stats: Add summery report 2023-03-31 14:57:56 +02:00
Enrico Schwendig
707272bf19 Merge branch 'dbkr/otel' into enricoschw/real-time-media-statistics-for-full-mesh 2023-03-31 13:14:49 +02:00
David Baker
c2b78d59c6 Add more events:
* VoIP events received
 * Call errors
 * Group call errors
 * Undecryptable to-device events
2023-03-30 16:54:10 +01:00
David Baker
f96ce8985d Only enable otel if we have a collector URL 2023-03-29 16:04:11 +01:00
David Baker
4bf1fbfd8e Gah, the sentry logger 2023-03-29 13:31:47 +01:00
David Baker
77c6357b08 Use js-sdk from hangup refactor branch
https://github.com/matrix-org/matrix-js-sdk/pull/3234
2023-03-29 12:28:04 +01:00
Enrico Schwendig
66c3d05ae9 docu: Add webrtc metric to OTel 2023-03-28 11:51:15 +02:00
Robin Townsend
313ebe258e Add end-to-end audio observability
This reports via OpenTelemetry when particular participants are speaking, as an easy way to observe the delivery of audio in calls.
2023-03-22 14:23:26 -04:00
David Baker
48493a96e1 Wait until config is loaded to load otel 2023-03-22 12:41:33 +00:00
David Baker
3d6ae3fbc3 Enable/disable opentelemetry based on config/user preference
Add config to set collector URL, obey the same analytics setting as
posthog. Also refactor into a class to make it easier to manage.
2023-03-22 11:55:21 +00:00
David Baker
359e055314 Make callMembershipSpan optional 2023-03-21 12:13:51 +00:00
David Baker
6b36604c84 Update js-sdk 2023-03-20 19:17:50 +00:00
David Baker
63ede0b51a Version using events for call joins / leaves and matrix events
This is probably conceptually nicer although isn't quite as nice in
the jaeger / stalk UI.

Also this may no loger work with the posthog exporter (unsure what it
will do with events on spans).
2023-03-17 19:26:23 +00:00
David Baker
2d91b43a7d Set attributes on the root span
Setting them on the context doesn't actually make them show up in
jaeger, it's just a way to propagate the info around between
different things.
2023-03-17 19:03:43 +00:00
David Baker
f8f5d2011d Add CORS to jaeger query endpoint and make spans nested
Adds an nginx in front of the query endpoint so we can use stalk
without faffing with browser extension to bypass CORS.

Also make the spans correctly have the call membership span as parent,
which they didn't because we hadn't set the span at the point we made
the context.
2023-03-17 17:01:59 +00:00
David Baker
521b0a857a Send spans for state events 2023-03-16 18:08:28 +00:00
David Baker
31450219c8 More work on opentelemetry event reporting
Moastly a re-org to avoid new contexts over React component unmounts/
remounts.
2023-03-16 14:41:55 +00:00
David Baker
c519e13885 Version that does at least send some traces 2023-03-15 16:00:39 +00:00
David Baker
0cca5ae174 Slightly evolved but not-yet-working OpenTelemetry
More usefully, including docker config for starting a CORS enabled
OTLP collector so we don't have to use zipkin.
2023-03-15 14:35:10 +00:00