Details
-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
3.1.3
-
None
-
1
Description
Passing a custom tracer to ClusterOptions produces a connection string like couchbase://localhost?tracer=%3C_main_.TestTracer+object+at+0x10ab006a0%3E. Note that it works correctly when passing it to the Cluster constructor directly.
The tracer needs to be removed from cluster options before creating the connection string
from typing import Optional, Union
|
from couchbase.cluster import Cluster, ClusterOptions, PasswordAuthenticator, CouchbaseTracer, CouchbaseSpan
|
|
class TestSpan(CouchbaseSpan):
|
def __init__(self) -> None:
|
pass
|
|
def finish(self) -> None:
|
pass
|
|
def set_attribute(self, key: str, value: Union[str, bool, int]) -> None:
|
pass
|
|
class TestTracer(CouchbaseTracer):
|
def __init__(self) -> None:
|
pass
|
|
def start_span(self, name: str, parent: Optional[TestSpan]) -> TestSpan:
|
span = TestSpan()
|
return span
|
|
test_tracer = TestTracer()
|
cluster = Cluster("couchbase://localhost", ClusterOptions(PasswordAuthenticator("Administrator", "password"), tracer=test_tracer))
|
couchbase.exceptions.NotSupportedException: <RC=0xD6[LCB_ERR_UNSUPPORTED_OPERATION (214)], Couldn't create instance. Either bad credentials/hosts/bucket names were passed, or there was an internal error in creating the object, C Source=(src/bucket.c,1116)>