Skip to content

Commit 9fea034

Browse files
committed
chore: format code
1 parent cb1d689 commit 9fea034

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

docker/opentelemetry/main.py

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
#!/usr/bin/env python3
22

33
import time
4-
import redis
4+
55
import uptrace
66
from opentelemetry import trace
77
from opentelemetry.instrumentation.redis import RedisInstrumentor
88

9+
import redis
10+
911
tracer = trace.get_tracer("app_or_package_name", "1.0.0")
1012

13+
1114
def main():
1215
uptrace.configure_opentelemetry(
1316
dsn="http://project2_secret_token@localhost:14317/2",
@@ -27,19 +30,23 @@ def main():
2730

2831

2932
def handle_request(client):
30-
with tracer.start_as_current_span("handle-request", kind=trace.SpanKind.CLIENT) as span:
33+
with tracer.start_as_current_span(
34+
"handle-request", kind=trace.SpanKind.CLIENT
35+
) as span:
3136
client.get("my-key")
3237
client.set("hello", "world")
33-
client.mset({
34-
"employee_name": "Adam Adams",
35-
"employee_age": 30,
36-
"position": "Software Engineer",
37-
})
38+
client.mset(
39+
{
40+
"employee_name": "Adam Adams",
41+
"employee_age": 30,
42+
"position": "Software Engineer",
43+
}
44+
)
3845

3946
pipe = client.pipeline()
40-
pipe.set('foo', 5)
41-
pipe.set('bar', 18.5)
42-
pipe.set('blee', "hello world!")
47+
pipe.set("foo", 5)
48+
pipe.set("bar", 18.5)
49+
pipe.set("blee", "hello world!")
4350
pipe.execute()
4451

4552
return span

0 commit comments

Comments
 (0)