API¶
-
class
scopeagent.agent.agent.
Agent
(api_key=None, api_endpoint=None, repository=None, commit=None, service=None, branch=None, source_root=None, debug=False, dry_run=False, command=None)¶ -
__init__
(api_key=None, api_endpoint=None, repository=None, commit=None, service=None, branch=None, source_root=None, debug=False, dry_run=False, command=None)¶ Creates a new Scope agent instance (without installing it). All parameters are optional and will be autodetected from the environment where possible.
Parameters: - api_key – the API key to use when sending data to the Scope backend
- api_endpoint – the API endpoint of the Scope instance where the data is going to be sent
- repository – the git repository URL of the service being instrumented
- commit – the commit hash being instrumented
- service – the name of the service being instrumented (defaults to default)
- branch – the branch being instrumented
- source_root – the absolute path to the root of the git repository in the local filesystem
- debug – if true, enables verbose debug logging
- dry_run – if true, avoids actually sending data to the backend
- command – command string used to launch the service being instrumented
-
install
(testing_mode=False, set_global_tracer=True, autoinstrument=True)¶ Installs the tracer and instruments all libraries.
Parameters: - testing_mode – whether the command launched is for running tests
- set_global_tracer – if true, sets the Scope tracer as the OpenTracing global tracer
- autoinstrument – if true, patches all supported libraries to enable instrumentation
Returns: None
-