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

Draft: Migrate to OpenTelemetry tracing #13400

Closed

Commits on Jul 26, 2022

  1. Configuration menu
    Copy the full SHA
    0cc610e View commit details
    Browse the repository at this point in the history

Commits on Jul 27, 2022

  1. Some shim and some new

    MadLittleMods committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    2fe6911 View commit details
    Browse the repository at this point in the history
  2. Progress towards OTEL

    MadLittleMods committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    6984cef View commit details
    Browse the repository at this point in the history
  3. Server running

    MadLittleMods committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    6406fd5 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    2428172 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    0d7a2b9 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    9e1de86 View commit details
    Browse the repository at this point in the history
  7. Fix some lints

    MadLittleMods committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    f6c3b22 View commit details
    Browse the repository at this point in the history

Commits on Jul 28, 2022

  1. Fixup some todos

    MadLittleMods committed Jul 28, 2022
    Configuration menu
    Copy the full SHA
    3a25996 View commit details
    Browse the repository at this point in the history

Commits on Jul 29, 2022

  1. Fix some lints

    MadLittleMods committed Jul 29, 2022
    Configuration menu
    Copy the full SHA
    1b0840e View commit details
    Browse the repository at this point in the history
  2. Fix invalid attribute type

    ```
    Invalid type StreamToken for attribute value. Expected one of ['bool', 'str', 'bytes', 'int', 'float'] or a sequence of those types
    ```
    
    Had to add a few more logs to find this instance since the warning doens't give much info where I am setting this invalid attribute.
    This was good enough to find it in the code.
    ```
    BoundedAttributes __setitem__ key=since_token value=StreamToken(room_key=RoomStreamToken(topological=None, stream=1787, instance_map=frozendict.frozendict({})), presence_key=481272, typing_key=0, receipt_key=340, account_data_key=1233, push_rules_key=8, to_device_key=57, device_list_key=199, groups_key=0)
    
    BoundedAttributes __setitem__ key=now_token value=StreamToken(room_key=RoomStreamToken(topological=None, stream=1787, instance_map=frozendict.frozendict({})), presence_key=481287, typing_key=0, receipt_key=340, account_data_key=1233, push_rules_key=8, to_device_key=57, device_list_key=199, groups_key=0)
    
    BoundedAttributes __setitem__ key=token value=StreamToken(room_key=RoomStreamToken(topological=None, stream=1787, instance_map=frozendict.frozendict({})), presence_key=481291, typing_key=0, receipt_key=340, account_data_key=1237, push_rules_key=8, to_device_key=57, device_list_key=199, groups_key=0)
    ```
    MadLittleMods committed Jul 29, 2022
    Configuration menu
    Copy the full SHA
    1d208fa View commit details
    Browse the repository at this point in the history
  3. Fix using wrong type of context (Context vs SpanContext)

    Fix error:
    ```
    AttributeError: 'SpanContext' object has no attribute 'get'
    ```
    
    `Context`:
    ```
    {'current-span-1a226c96-a5db-4412-bcaa-1fdd34213c5c': _Span(name="sendToDevice", context=SpanContext(trace_id=0x5d2dcc3fdc8205046d60a5cd18672ac6, span_id=0x715c736ff5f4d208, trace_flags=0x01, trace_state=[], is_remote=False))}
    ```
    
    `SpanContext`:
    ```
    SpanContext(trace_id=0xf7cd9d058b7b76f364bdd649c4ba7b8a, span_id=0x287ce71bac31bfc4, trace_flags=0x01, trace_state=[], is_remote=False)
    ```
    MadLittleMods committed Jul 29, 2022
    Configuration menu
    Copy the full SHA
    2011ac2 View commit details
    Browse the repository at this point in the history
  4. Record exception

    MadLittleMods committed Jul 29, 2022
    Configuration menu
    Copy the full SHA
    19d20b5 View commit details
    Browse the repository at this point in the history
  5. Explain weird function

    MadLittleMods committed Jul 29, 2022
    Configuration menu
    Copy the full SHA
    786dd9b View commit details
    Browse the repository at this point in the history

Commits on Jul 30, 2022

  1. Easier to follow local vs remote span tracing

    The `incoming-federation-request` vs `process-federation_request` was first introduced in
    #11870
    
     - Span for remote trace: `incoming-federation-request`
        - `child_of` reference: `origin_span_context`
        - `follows_from` reference: `servlet_span`
     - Span for local trace: `process-federation-request`
        - `child_of` reference: `servlet_span` (by the nature of it being active)
        - `follows_from` reference: `incoming-federation-request`
    MadLittleMods committed Jul 30, 2022
    Configuration menu
    Copy the full SHA
    7c135b9 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d29a4af View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    041acdf View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    d848156 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    070195a View commit details
    Browse the repository at this point in the history
  6. Use HTTP_HOST attribute

    MadLittleMods committed Jul 30, 2022
    Configuration menu
    Copy the full SHA
    7772f50 View commit details
    Browse the repository at this point in the history

Commits on Aug 1, 2022

  1. Fix some lints

    MadLittleMods committed Aug 1, 2022
    Configuration menu
    Copy the full SHA
    322da51 View commit details
    Browse the repository at this point in the history
  2. todos

    MadLittleMods committed Aug 1, 2022
    Configuration menu
    Copy the full SHA
    33fd24e View commit details
    Browse the repository at this point in the history
  3. Implement start_active_span_from_edu for OTEL

    AFAICT, this never worked before because everything was serialized into `content["org.matrix.opentracing_context"]`
    but `start_active_span_from_edu` read from `content["opentracing"]`.
    See #5852 (comment)
    
    Do we even still want this?
    MadLittleMods committed Aug 1, 2022
    Configuration menu
    Copy the full SHA
    a9fb504 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    8e902b8 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    00be06c View commit details
    Browse the repository at this point in the history

Commits on Aug 2, 2022

  1. Configuration menu
    Copy the full SHA
    6255a1a View commit details
    Browse the repository at this point in the history
  2. PoC force tracing

    Doesn't force tracing for the child spans yet
    MadLittleMods committed Aug 2, 2022
    Configuration menu
    Copy the full SHA
    b3cdbad View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d15fa45 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    6bb7cb7 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    dbd9005 View commit details
    Browse the repository at this point in the history
  6. Fix lints

    MadLittleMods committed Aug 2, 2022
    Configuration menu
    Copy the full SHA
    0f93ec8 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    36d6648 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    fb0e820 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    b09651a View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    da396a2 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    ad71bc3 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    59facea View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    9d6fcf3 View commit details
    Browse the repository at this point in the history
  14. Update docs

    MadLittleMods committed Aug 2, 2022
    Configuration menu
    Copy the full SHA
    fcc4220 View commit details
    Browse the repository at this point in the history
  15. Add changelog

    MadLittleMods committed Aug 2, 2022
    Configuration menu
    Copy the full SHA
    d72cacf View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    ba4a46a View commit details
    Browse the repository at this point in the history
  17. Merge branch 'develop' into madlittlemods/11850-migrate-to-opentelemetry

    Conflicts:
    	docs/usage/configuration/config_documentation.md
    	synapse/logging/opentracing.py
    
    Got changes from:
    
     - https://github.com/matrix-org/synapse/pull/13362/files
    MadLittleMods committed Aug 2, 2022
    Configuration menu
    Copy the full SHA
    72c718d View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    c26fa2d View commit details
    Browse the repository at this point in the history
  19. Fix lints

    MadLittleMods committed Aug 2, 2022
    Configuration menu
    Copy the full SHA
    5999132 View commit details
    Browse the repository at this point in the history
  20. Fix remnant

    MadLittleMods committed Aug 2, 2022
    Configuration menu
    Copy the full SHA
    2491665 View commit details
    Browse the repository at this point in the history

Commits on Aug 3, 2022

  1. Configuration menu
    Copy the full SHA
    16d17f7 View commit details
    Browse the repository at this point in the history
  2. Use latested Twisted from source to fix contextvar issues causing OTE…

    …L `Failed to detach context` errors
    
    See #13400 (comment)
    MadLittleMods committed Aug 3, 2022
    Configuration menu
    Copy the full SHA
    b6f5665 View commit details
    Browse the repository at this point in the history
  3. Merge branch 'develop' into madlittlemods/11850-migrate-to-opentelemetry

    Conflicts:
    	docs/usage/configuration/config_documentation.md
    	synapse/api/auth.py
    MadLittleMods committed Aug 3, 2022
    Configuration menu
    Copy the full SHA
    699dad0 View commit details
    Browse the repository at this point in the history
  4. Update treq to match minimum Twisted Python versions

    Hopefully fix https://github.com/matrix-org/synapse/runs/7645395562?check_suite_focus=true#step:7:6727
    
    ```
    builtins.ImportError: cannot import name '_PY3' from 'twisted.python.compat' (unknown location)
    ```
    MadLittleMods committed Aug 3, 2022
    Configuration menu
    Copy the full SHA
    270db42 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    f5da762 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    ccd4752 View commit details
    Browse the repository at this point in the history
  7. Update docs/tracing.md

    MadLittleMods committed Aug 3, 2022
    Configuration menu
    Copy the full SHA
    d7166a0 View commit details
    Browse the repository at this point in the history

Commits on Aug 4, 2022

  1. Configuration menu
    Copy the full SHA
    7566375 View commit details
    Browse the repository at this point in the history

Commits on Aug 9, 2022

  1. Merge branch 'develop' into madlittlemods/11850-migrate-to-opentelemetry

    Conflicts:
    	synapse/logging/opentracing.py
    	tests/logging/test_opentracing.py
    MadLittleMods committed Aug 9, 2022
    Configuration menu
    Copy the full SHA
    7024d7b View commit details
    Browse the repository at this point in the history

Commits on Aug 18, 2022

  1. Merge branch 'develop' into madlittlemods/11850-migrate-to-opentelemetry

    Conflicts:
    	poetry.lock
    	synapse/federation/federation_client.py
    	synapse/federation/federation_server.py
    	synapse/handlers/federation.py
    	synapse/handlers/federation_event.py
    	synapse/logging/opentracing.py
    	synapse/rest/client/room.py
    	synapse/storage/controllers/persist_events.py
    	synapse/storage/controllers/state.py
    MadLittleMods committed Aug 18, 2022
    Configuration menu
    Copy the full SHA
    8def7e4 View commit details
    Browse the repository at this point in the history

Commits on Sep 9, 2022

  1. Merge branch 'develop' into madlittlemods/11850-migrate-to-opentelemetry

    Conflicts:
    	poetry.lock
    	synapse/api/auth.py
    	synapse/federation/federation_client.py
    	synapse/logging/opentracing.py
    	synapse/rest/client/keys.py
    	synapse/rest/client/sendtodevice.py
    	synapse/storage/schema/__init__.py
    MadLittleMods committed Sep 9, 2022
    Configuration menu
    Copy the full SHA
    50f0342 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f73bc59 View commit details
    Browse the repository at this point in the history
  3. Poetry install again

    MadLittleMods committed Sep 9, 2022
    Configuration menu
    Copy the full SHA
    a15592d View commit details
    Browse the repository at this point in the history
  4. poetry update

    MadLittleMods committed Sep 9, 2022
    Configuration menu
    Copy the full SHA
    32b9d16 View commit details
    Browse the repository at this point in the history

Commits on Sep 12, 2022

  1. Configuration menu
    Copy the full SHA
    6c40dfa View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ad3e324 View commit details
    Browse the repository at this point in the history

Commits on Sep 13, 2022

  1. OTEL install with DMR

    MadLittleMods committed Sep 13, 2022
    Configuration menu
    Copy the full SHA
    15e242e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d730a46 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    ed11237 View commit details
    Browse the repository at this point in the history
  4. Merge branch 'develop' into madlittlemods/11850-migrate-to-opentelemetry

    Conflicts:
    	synapse/storage/schema/__init__.py
    MadLittleMods committed Sep 13, 2022
    Configuration menu
    Copy the full SHA
    19c6f6e View commit details
    Browse the repository at this point in the history
  5. Hopefully fix problem when OTEL not installed with non recording span

    ```
    Traceback (most recent call last):
      File "/usr/local/lib/python3.9/site-packages/synapse/http/server.py", line 306, in _async_render_wrapper
        callback_return = await self._async_render(request)
      File "/usr/local/lib/python3.9/site-packages/synapse/http/server.py", line 512, in _async_render
        callback_return = await raw_callback_return
      File "/usr/local/lib/python3.9/site-packages/synapse/federation/transport/server/_base.py", line 357, in new_func
        remote_parent_span = create_non_recording_span()
      File "/usr/local/lib/python3.9/site-packages/synapse/logging/tracing.py", line 502, in create_non_recording_span
        return opentelemetry.trace.NonRecordingSpan(
    AttributeError: 'NoneType' object has no attribute 'trace'
    ```
    MadLittleMods committed Sep 13, 2022
    Configuration menu
    Copy the full SHA
    b77d49f View commit details
    Browse the repository at this point in the history

Commits on Sep 14, 2022

  1. Maybe fix positional argument mismatch for DummyLink

    Hopefully fix:
    ```
      File "/home/runner/work/synapse/synapse/synapse/storage/controllers/persist_events.py", line 246, in add_to_queue
        links=[Link(end_item.tracing_span_context)],
    builtins.TypeError: __init__() takes 1 positional argument but 2 were given
    ```
    MadLittleMods committed Sep 14, 2022
    Configuration menu
    Copy the full SHA
    a027c6e View commit details
    Browse the repository at this point in the history
  2. Merge branch 'develop' into madlittlemods/11850-migrate-to-opentelemetry

    Conflicts:
    	synapse/storage/schema/__init__.py
    MadLittleMods committed Sep 14, 2022
    Configuration menu
    Copy the full SHA
    84f91e3 View commit details
    Browse the repository at this point in the history

Commits on Sep 20, 2022

  1. Merge branch 'develop' into madlittlemods/11850-migrate-to-opentelemetry

    Conflicts:
    	.github/workflows/tests.yml
    	poetry.lock
    	synapse/storage/schema/__init__.py
    MadLittleMods committed Sep 20, 2022
    Configuration menu
    Copy the full SHA
    b86869f View commit details
    Browse the repository at this point in the history

Commits on Sep 26, 2022

  1. Configuration menu
    Copy the full SHA
    e4b9898 View commit details
    Browse the repository at this point in the history

Commits on Oct 1, 2022

  1. Merge branch 'develop' into madlittlemods/11850-migrate-to-opentelemetry

    Conflicts:
    	synapse/handlers/message.py
    	synapse/logging/opentracing.py
    MadLittleMods committed Oct 1, 2022
    Configuration menu
    Copy the full SHA
    4a495ac View commit details
    Browse the repository at this point in the history

Commits on Oct 20, 2022

  1. Merge branch 'develop' into madlittlemods/11850-migrate-to-opentelemetry

    Conflicts:
    	poetry.lock (conflicts not fixed)
    	synapse/handlers/message.py
    	synapse/handlers/relations.py
    	synapse/storage/databases/main/devices.py
    	synapse/storage/schema/__init__.py
    MadLittleMods committed Oct 20, 2022
    Configuration menu
    Copy the full SHA
    7d70acd View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    627951e View commit details
    Browse the repository at this point in the history

Commits on Nov 18, 2022

  1. Merge branch 'develop' into madlittlemods/11850-migrate-to-opentelemetry

    Conflicts:
    	docs/usage/configuration/config_documentation.md
    	poetry.lock
    	synapse/handlers/message.py
    	synapse/http/server.py
    	synapse/logging/opentracing.py
    	synapse/rest/client/keys.py
    	synapse/rest/client/room.py
    MadLittleMods committed Nov 18, 2022
    Configuration menu
    Copy the full SHA
    d993cb0 View commit details
    Browse the repository at this point in the history

Commits on Nov 21, 2022

  1. Configuration menu
    Copy the full SHA
    7acb365 View commit details
    Browse the repository at this point in the history