def test_global_tags(self): """Global tags should be passed from the opentracer to the tracer.""" config = { "global_tags": {"tag1": "value1", "tag2": 2,}, } tracer = Tracer(service_name="mysvc", config=config) with tracer.start_span("myop") as span: # global tags should be attached to generated all datadog spans assert span._dd_span.get_tag("tag1") == "value1" assert span._dd_span.get_metric("tag2") == 2 with tracer.start_span("myop2") as span2: assert span2._dd_span.get_tag("tag1") == "value1" assert span2._dd_span.get_metric("tag2") == 2
def test_required_dd_fields(self): """Ensure required fields needed for successful tracing are possessed by the underlying datadog tracer. """ # a service name is required tracer = Tracer("service") with tracer.start_span("my_span") as span: assert span._dd_span.service
def test_global_tags(self): """Global tags should be passed from the opentracer to the tracer.""" config = { 'global_tags': { 'tag1': 'value1', 'tag2': 2, }, } tracer = Tracer(service_name='mysvc', config=config) with tracer.start_span('myop') as span: # global tags should be attached to generated all datadog spans assert span._dd_span.get_tag('tag1') == 'value1' assert span._dd_span.get_tag('tag2') == '2' with tracer.start_span('myop2') as span2: assert span2._dd_span.get_tag('tag1') == 'value1' assert span2._dd_span.get_tag('tag2') == '2'