Skip to content

Commit 9e2e8ea

Browse files
committed
Example app: better service and span names
1 parent b34c6b4 commit 9e2e8ea

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

example/simple.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import time
77
import opentracing.ext.tags as ext
88

9-
SERVICE = "python-simple"
9+
SERVICE = "python-overlord"
1010

1111
def main(argv):
1212
instana.tracer.init(o.Options(service=SERVICE,
@@ -17,16 +17,16 @@ def main(argv):
1717
simple()
1818

1919
def simple():
20-
parent_span = ot.tracer.start_span(operation_name="parent")
21-
parent_span.set_tag(ext.COMPONENT, SERVICE)
20+
parent_span = ot.tracer.start_span(operation_name="asteroid")
21+
parent_span.set_tag(ext.COMPONENT, "Python simple example app")
2222
parent_span.set_tag(ext.SPAN_KIND, ext.SPAN_KIND_RPC_SERVER)
2323
parent_span.set_tag(ext.PEER_HOSTNAME, "localhost")
2424
parent_span.set_tag(ext.HTTP_URL, "/python/simple/one")
2525
parent_span.set_tag(ext.HTTP_METHOD, "GET")
2626
parent_span.set_tag(ext.HTTP_STATUS_CODE, 200)
2727
parent_span.log_kv({"foo": "bar"})
2828

29-
child_span = ot.tracer.start_span(operation_name="child", child_of=parent_span)
29+
child_span = ot.tracer.start_span(operation_name="spacedust", child_of=parent_span)
3030
child_span.set_tag(ext.SPAN_KIND, ext.SPAN_KIND_RPC_CLIENT)
3131
child_span.set_tag(ext.PEER_HOSTNAME, "localhost")
3232
child_span.set_tag(ext.HTTP_URL, "/python/simple/two")

0 commit comments

Comments
 (0)