"""This example demonstrates instrumenting HTTPX with Logfire."""
import streamlit as st
import logfire
import httpx # see https://www.python-httpx.org/
# to join the logfire project,
# follow https://logfire.pydantic.dev/join/samuelcolvin/-/project-invitation/pydantic-run-demo/b7cce6af-8916-4f79-8542-47d9c550722d
logfire.configure(token='W3mkJvNKtxhpDk3Hx8WQWG3bg7qMH8lrVmnstdb1NRdF')
logfire.instrument_httpx(capture_all=True)
r = httpx.get('https://httpbin.org/get')
st.write('response code:', r.status_code)
st.markdown("#response text:")
st.json(r.text)