def sending_elasticapm_client(request, validating_httpserver): validating_httpserver.serve_content( code=202, content='', headers={'Location': 'http://example.com/foo'}) client_config = getattr(request, 'param', {}) client_config.setdefault('server_url', validating_httpserver.url) client_config.setdefault('service_name', 'myapp') client_config.setdefault('secret_token', 'test_key') client_config.setdefault('transport_class', 'elasticapm.transport.http.Transport') client = Client(**client_config) client.httpserver = validating_httpserver yield client client.close()
def sending_elasticapm_client(request, validating_httpserver): validating_httpserver.serve_content(code=202, content="", headers={"Location": "http://example.com/foo"}) client_config = getattr(request, "param", {}) client_config.setdefault("server_url", validating_httpserver.url) client_config.setdefault("service_name", "myapp") client_config.setdefault("secret_token", "test_key") client_config.setdefault("transport_class", "elasticapm.transport.http.Transport") client_config.setdefault("span_frames_min_duration", -1) client_config.setdefault("include_paths", ("*/tests/*",)) client_config.setdefault("metrics_interval", "0ms") client = Client(**client_config) client.httpserver = validating_httpserver yield client client.close()
def sending_elasticapm_client(request, validating_httpserver): validating_httpserver.serve_content( code=202, content="", headers={"Location": "http://example.com/foo"}) client_config = getattr(request, "param", {}) client_config.setdefault("server_url", validating_httpserver.url) client_config.setdefault("service_name", "myapp") client_config.setdefault("secret_token", "test_key") client_config.setdefault("transport_class", "elasticapm.transport.http.Transport") client_config.setdefault("span_frames_min_duration", -1) client_config.setdefault("span_compression_exact_match_max_duration", "0ms") client_config.setdefault("span_compression_same_kind_max_duration", "0ms") client_config.setdefault("include_paths", ("*/tests/*", )) client_config.setdefault("metrics_interval", "0ms") client_config.setdefault("central_config", "false") client_config.setdefault("server_version", (8, 0, 0)) client = Client(**client_config) client.httpserver = validating_httpserver yield client client.close() # clear any execution context that might linger around execution_context.set_transaction(None) execution_context.set_span(None)