Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Opentracing end to end encryption #5687

Closed
wants to merge 47 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
823c34a
One tracing decorator to rule them all.
JorikSchellekens Jul 22, 2019
565544b
Trace e2e
JorikSchellekens Jun 28, 2019
1e7099d
Fix e2e bugs
JorikSchellekens Jun 28, 2019
d876cda
Trace more e2e stuff and less e2e stuff
JorikSchellekens Jun 28, 2019
fd669e5
Trace devices
JorikSchellekens Jun 28, 2019
c988c02
Trace device messages.
JorikSchellekens Jun 28, 2019
21940ca
Update to new access pattern
JorikSchellekens Jul 2, 2019
d94897e
Include servletname in incoming-request trace
JorikSchellekens Jul 3, 2019
28113ad
typo
JorikSchellekens Jul 3, 2019
d9f0c7f
How did that half of the statement get deleted?
JorikSchellekens Jul 3, 2019
7ae7e79
These functions were not deferreds!
JorikSchellekens Jul 4, 2019
bfc5005
The great logging/ migration
JorikSchellekens Jul 4, 2019
957cd77
Opentracing across streams
JorikSchellekens Jul 17, 2019
1ed790d
Some tracing
JorikSchellekens Jul 8, 2019
01229a4
Clean up room key tracing
JorikSchellekens Jul 8, 2019
794c9e2
Cleanup key upload tracing
JorikSchellekens Jul 8, 2019
d4bdc2b
Trace key claiming
JorikSchellekens Jul 8, 2019
2fd49ce
Nicer tracing
JorikSchellekens Jul 11, 2019
d44f303
Isort of ran out of puns for this one.
JorikSchellekens Jul 17, 2019
a293759
Though style is subjective it depends on a ruthless objectivity: you …
JorikSchellekens Jul 17, 2019
ab191f9
A little extra device_list tracing
JorikSchellekens Jul 15, 2019
e49487f
Better args wrapper
JorikSchellekens Jul 16, 2019
4824e30
Add user _id
JorikSchellekens Jul 16, 2019
30738e9
newsfile
JorikSchellekens Jul 17, 2019
6944c99
Make sure there is an active span here.
JorikSchellekens Jul 17, 2019
d26cbb4
Unbreak json parsing.
JorikSchellekens Jul 17, 2019
cffba28
Trailing .d
JorikSchellekens Jul 17, 2019
d395650
Use better decorator names.
JorikSchellekens Jul 17, 2019
beea2e3
I wish python had a good type system.
JorikSchellekens Jul 17, 2019
1801578
Use unified trace method
JorikSchellekens Jul 22, 2019
08aaad0
Nicer changelog
JorikSchellekens Aug 5, 2019
8b53f8e
Typo
JorikSchellekens Aug 5, 2019
35eb018
Double negatives do not make code that isn't unclear..
JorikSchellekens Aug 5, 2019
46e41ee
Comment for 'context' column in device_lists_outbound_pokes'
JorikSchellekens Aug 5, 2019
d859c34
Nicer use of dict update methods.
JorikSchellekens Aug 5, 2019
e7f4285
Refactor return value so we don't create identical lists each time.
JorikSchellekens Aug 5, 2019
50964d2
String concatenation without the '+'
JorikSchellekens Aug 5, 2019
0395869
Use underscores.
JorikSchellekens Aug 5, 2019
7ab2088
Remove redundent tagging.
JorikSchellekens Aug 5, 2019
f76b071
Remove redundent spans.
JorikSchellekens Aug 5, 2019
22b7e6a
Debug comments gone rampant.
JorikSchellekens Aug 5, 2019
6a355ca
Refactor for clarity.
JorikSchellekens Aug 5, 2019
bd0ed7b
Docstrings shouldn't lie.
JorikSchellekens Aug 5, 2019
4f36a2d
Create and use a method to get the span context as a dict.
JorikSchellekens Aug 5, 2019
82d6eb1
Remove unused import
JorikSchellekens Aug 5, 2019
a68119e
Merge remote-tracking branch 'origin/develop' into joriks/opentracing…
JorikSchellekens Aug 5, 2019
eee4eff
Bind exception to name
JorikSchellekens Aug 5, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Create and use a method to get the span context as a dict.
JorikSchellekens committed Aug 5, 2019
commit 4f36a2dfeca8222898b9b1f5dbb12935a85e234c
25 changes: 25 additions & 0 deletions synapse/logging/opentracing.py
Original file line number Diff line number Diff line change
@@ -527,6 +527,31 @@ def inject_active_span_text_map(carrier, destination=None):
)


def get_active_span_text_map(destination=None):
"""
Gets a span context as a dict. This can be used instead of injecting a span
into an empty carrier.

Args:
destination (str): the name of the remote server. The dict will only
contain a span context if the destination matches the homeserver_whitelist
or if destination is None.

Returns:
A dict containing the span context.
"""

if not opentracing or (destination and not whitelisted_homeserver(destination)):
return {}

carrier = {}
opentracing.tracer.inject(
opentracing.tracer.active_span, opentracing.Format.TEXT_MAP, carrier
)

return carrier


def active_span_context_as_string():
"""
Returns:
3 changes: 1 addition & 2 deletions synapse/storage/devices.py
Original file line number Diff line number Diff line change
@@ -828,8 +828,7 @@ def _add_device_change_txn(self, txn, user_id, device_ids, hosts, stream_id):
],
)

context = {"opentracing": {}}
opentracing.inject_active_span_text_map(context["opentracing"])
context = {"opentracing": opentracing.get_active_span_text_map()}

self._simple_insert_many_txn(
txn,