Skip to content

Commit

Permalink
chore: format code
Browse files Browse the repository at this point in the history
  • Loading branch information
vmihailenco committed Nov 11, 2022
1 parent cb1d689 commit 9fea034
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions docker/opentelemetry/main.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
#!/usr/bin/env python3

import time
import redis

import uptrace
from opentelemetry import trace
from opentelemetry.instrumentation.redis import RedisInstrumentor

import redis

tracer = trace.get_tracer("app_or_package_name", "1.0.0")


def main():
uptrace.configure_opentelemetry(
dsn="http://project2_secret_token@localhost:14317/2",
Expand All @@ -27,19 +30,23 @@ def main():


def handle_request(client):
with tracer.start_as_current_span("handle-request", kind=trace.SpanKind.CLIENT) as span:
with tracer.start_as_current_span(
"handle-request", kind=trace.SpanKind.CLIENT
) as span:
client.get("my-key")
client.set("hello", "world")
client.mset({
"employee_name": "Adam Adams",
"employee_age": 30,
"position": "Software Engineer",
})
client.mset(
{
"employee_name": "Adam Adams",
"employee_age": 30,
"position": "Software Engineer",
}
)

pipe = client.pipeline()
pipe.set('foo', 5)
pipe.set('bar', 18.5)
pipe.set('blee', "hello world!")
pipe.set("foo", 5)
pipe.set("bar", 18.5)
pipe.set("blee", "hello world!")
pipe.execute()

return span
Expand Down

0 comments on commit 9fea034

Please sign in to comment.