@@ -125,7 +125,7 @@ def hello():
125125 # create a span for the choice of the name, this may be a costly call in your real world application
126126 with tracer.start_as_current_span(" choice" ) as span:
127127 choice = random.choice(choices)
128- span.set_attribute(" choice.value" , choice)
128+ span.set_attribute(" choice.value" , choice)
129129 return f" Hello {choice}!"
130130```
131131
@@ -142,7 +142,7 @@ are tracking how many times we are getting one of the possible choices for our s
142142import random
143143
144144from flask import Flask
145- from opentelemetry import trace
145+ from opentelemetry import metrics, trace
146146
147147tracer = trace.get_tracer(__name__)
148148meter = metrics.get_meter(__name__)
@@ -160,7 +160,7 @@ def hello():
160160 # create a span for the choice of the name, this may be a costly call in your real world application
161161 with tracer.start_as_current_span("choice") as span:
162162 choice = random.choice(choices)
163- span.set_attribute("choice.value", choice)
163+ span.set_attribute("choice.value", choice)
164164 hello_counter.add(1, {"choice.value": choice})
165165 return f"Hello {choice}!"
166166```
0 commit comments