Skip to content

Instantly share code, notes, and snippets.

View jerbly's full-sized avatar
🦀

Jeremy Blythe jerbly

🦀
View GitHub Profile
@jerbly
jerbly / otel-ex-http.py
Created September 9, 2024 13:05
fastapi otel example for testevents blog post
import asyncio
import random
import fastapi
from opentelemetry.instrumentation.fastapi import FastAPIInstrumentor
from opentelemetry import trace
from opentelemetry.sdk.trace import TracerProvider
# Initialize OTEL
provider = TracerProvider()
trace.set_tracer_provider(provider)
est = ScriptRunConfig(source_directory='source',
script='training.py',
environment=myenv,
arguments = ['--input_data', ds.as_named_input('quiddler_ds').as_download(),
'--epochs', 3,
'--batch_size', 6,
'--image_size', 512],
compute_target='local')
# Run the experiment
run = exp.submit(config=est)