File tree Expand file tree Collapse file tree 1 file changed +14
-9
lines changed Expand file tree Collapse file tree 1 file changed +14
-9
lines changed Original file line number Diff line number Diff line change 8
8
9
9
tracer = trace .get_tracer ("app_or_package_name" , "1.0.0" )
10
10
11
+
11
12
def main ():
12
13
uptrace .configure_opentelemetry (
13
14
dsn = "http://project2_secret_token@localhost:14317/2" ,
@@ -27,19 +28,23 @@ def main():
27
28
28
29
29
30
def handle_request (client ):
30
- with tracer .start_as_current_span ("handle-request" , kind = trace .SpanKind .CLIENT ) as span :
31
+ with tracer .start_as_current_span (
32
+ "handle-request" , kind = trace .SpanKind .CLIENT
33
+ ) as span :
31
34
client .get ("my-key" )
32
35
client .set ("hello" , "world" )
33
- client .mset ({
34
- "employee_name" : "Adam Adams" ,
35
- "employee_age" : 30 ,
36
- "position" : "Software Engineer" ,
37
- })
36
+ client .mset (
37
+ {
38
+ "employee_name" : "Adam Adams" ,
39
+ "employee_age" : 30 ,
40
+ "position" : "Software Engineer" ,
41
+ }
42
+ )
38
43
39
44
pipe = client .pipeline ()
40
- pipe .set (' foo' , 5 )
41
- pipe .set (' bar' , 18.5 )
42
- pipe .set (' blee' , "hello world!" )
45
+ pipe .set (" foo" , 5 )
46
+ pipe .set (" bar" , 18.5 )
47
+ pipe .set (" blee" , "hello world!" )
43
48
pipe .execute ()
44
49
45
50
return span
You can’t perform that action at this time.
0 commit comments