This repository was archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add basic opentracing support #5544
Merged
Merged
Changes from all commits
Commits
Show all changes
74 commits
Select commit
Hold shift + click to select a range
5afd89a
Configure and initialise tracer
JorikSchellekens b43e3af
Scope manager using LogContexts
JorikSchellekens 297c5fe
jaeger is a dependency now
JorikSchellekens 45d412e
Carrier inject and extraction for Twisted Headers
JorikSchellekens fc069fe
Trace federation requests on the way in and out.
JorikSchellekens 227447d
Create logcontext for new scope.
JorikSchellekens f35bde3
Remove scope from logcontext if logcontext is top level
JorikSchellekens 7d9c3d3
Disable tracer if not configured
JorikSchellekens 37607eb
typo
JorikSchellekens ee2f21f
Remove dependence on jaeger internals
JorikSchellekens ed5d00f
bools
JorikSchellekens a69e6aa
Set service name
JorikSchellekens 6a6f97a
:Explicitely state that the tracer is disabled
JorikSchellekens ce21e41
Merge branch 'develop' into joriks/opentracing
JorikSchellekens 98c8038
Black is the new black
JorikSchellekens 889afc1
Newsfile
JorikSchellekens db10eeb
Code style
JorikSchellekens 4e1eaf2
Use the new config setup.
JorikSchellekens 8ca185d
Generate config.
JorikSchellekens 0009fdd
Copyright
JorikSchellekens e90bfa7
Rename config to opentracing
JorikSchellekens 640381e
Remove user whitelisting
JorikSchellekens 0f57aac
Empty whitelist by default
JorikSchellekens dd2f06d
User ConfigError instead of RuntimeError
JorikSchellekens bae3b5b
Use isinstance
JorikSchellekens 9c39f0e
Use tag constants for opentracing.
JorikSchellekens bae63e9
Remove debug comment and no need to explicitely record error
JorikSchellekens 4925558
Typo?...
JorikSchellekens 8104779
Two errors a "s(c)entry"
JorikSchellekens 609d97b
Docstrings!
JorikSchellekens 04781e9
typos
JorikSchellekens 088176e
Remove debugging brainslip
JorikSchellekens dde4618
Homeserver Whitlisting
JorikSchellekens 34235a4
Better opentracing config comment
JorikSchellekens 1d591af
linting
JorikSchellekens 37a650c
Inclue worker name in service_name
JorikSchellekens 4bf9e11
Make opentracing an optional dependency
JorikSchellekens 941b655
Neater config retreival
JorikSchellekens 9654277
Typoed
JorikSchellekens 9ce4a3d
Clean up dummy tags
JorikSchellekens b008aa4
Instantiate tracing as object instead of global class
JorikSchellekens e27516b
Inlcude opentracing as a homeserver member.
JorikSchellekens 9d2734b
Thread opentracing to the request level
JorikSchellekens df255d7
Reference opetnracing through hs
JorikSchellekens 64f8510
Instantiate dummy opentracin g for tests.
JorikSchellekens 69561e0
About to revert, just keeping the unfinished changes just in case
JorikSchellekens 4656403
Revert back to global state, commit number:
JorikSchellekens a60572f
Use class level methods in tracerutils
JorikSchellekens bc6b236
Start and stop requests spans in a place where we
JorikSchellekens 68e4595
Seen it, isort it
JorikSchellekens 70a501a
Merge remote-tracking branch 'origin/develop' into joriks/opentracing
JorikSchellekens 9bfe90f
Make sure to close the active span.
JorikSchellekens 800e707
I'm getting black and blue from this.
JorikSchellekens fd37a69
Merge remote-tracking branch 'origin/develop' into joriks/opentracing
JorikSchellekens b09aa24
Logger formatting
JorikSchellekens 374e81c
Outdated comment
JorikSchellekens e111dcd
Import opentracing at the top
JorikSchellekens 14376e7
Return a contextmanager
JorikSchellekens 24b3834
Start tracing client requests from the servlet
JorikSchellekens 386285b
Return noop context manager if not tracing
JorikSchellekens 3dde444
Explicitely say that these are federation requests
JorikSchellekens b5cd7df
Include servlet name in client requests
JorikSchellekens f93b60d
Use context manager
JorikSchellekens 6d45cd0
Merge remote-tracking branch 'origin/develop' into joriks/opentracing
JorikSchellekens 6ab84bb
Move opentracing to logging/
JorikSchellekens 9a3c98a
Seen it, isort it again!
JorikSchellekens 0c19608
Ignore twisted return exceptions on context exit
JorikSchellekens 7414549
Merge branch 'develop' into joriks/opentracing
JorikSchellekens 18a902f
Escape the scope
JorikSchellekens 49038b1
Scopes should be entered to make them useful.
JorikSchellekens 00e08bd
Nicer decorator names
JorikSchellekens 06baa49
Just one init, init?
JorikSchellekens b07a4c6
Don't need to close something that isn't open
JorikSchellekens 6f3109e
Docs make you smarter
JorikSchellekens File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Added opentracing and configuration options. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2019 The Matrix.org Foundation C.I.C.d | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
from ._base import Config, ConfigError | ||
|
||
|
||
class TracerConfig(Config): | ||
def read_config(self, config, **kwargs): | ||
self.tracer_config = config.get("opentracing") | ||
|
||
self.tracer_config = config.get("opentracing", {"tracer_enabled": False}) | ||
|
||
if self.tracer_config.get("tracer_enabled", False): | ||
# The tracer is enabled so sanitize the config | ||
# If no whitelists are given | ||
self.tracer_config.setdefault("homeserver_whitelist", []) | ||
|
||
if not isinstance(self.tracer_config.get("homeserver_whitelist"), list): | ||
raise ConfigError("Tracer homesererver_whitelist config is malformed") | ||
|
||
def generate_config_section(cls, **kwargs): | ||
return """\ | ||
## Opentracing ## | ||
# These settings enable opentracing which implements distributed tracing | ||
# This allows you to observe the causal chain of events across servers | ||
# including requests, key lookups etc. across any server running | ||
# synapse or any other other services which supports opentracing. | ||
# (specifically those implemented with jaeger) | ||
|
||
#opentracing: | ||
# # Enable / disable tracer | ||
# tracer_enabled: false | ||
# # The list of homeservers we wish to expose our current traces to. | ||
# # The list is a list of regexes which are matched against the | ||
# # servername of the homeserver | ||
# homeserver_whitelist: | ||
# - ".*" | ||
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.