I get the below exception with trying to push trace data to the platform. Detected future timestamp in column 'end_time'. Caution when sending spans with future timestamps. Arize only stores 2 years worth of data. For example, if you sent spans to Arize from 1.5 years ago, and now send spans with timestamps of a year in the future, the oldest 0.5 years will be dropped to maintain the 2 years worth of data requirement.
to Arize platfom
I can confirm the above message is a warning not an error
if __name__ == '__main__':
session = px.launch_app()
LangChainInstrumentor().instrument()
main()
df = px.Client().get_spans_dataframe()
df.reset_index(drop=True, inplace=True)
if df is not None:
print(df.head())
else:
print("************** NULL ")
SPACE_KEY = "<>"
API_KEY = "<>"
if SPACE_KEY == "SPACE_KEY" or API_KEY == "API_KEY":
raise ValueError("❌ NEED TO CHANGE SPACE AND/OR API_KEY")
else:
print("✅ Import and Setup Arize Client Done! Now we can start using Arize!")
arize_client = Client(space_key=SPACE_KEY, api_key=API_KEY)
model_id = "generative-spans-tutorial-test" #the model name in Arize
model_version = "1.0" #(optional) the model version
response = arize_client.log_spans(
dataframe=df,
model_id=model_id,
model_version=model_version, #optional
)Hi Raja A., there are a few problems with that code snippet:
I don't know what main() does. Hence I can't evaluate correctness on it
session = px.launch_app() and other lines with px are phoenix logic, but you mentioned you want to send traces to Arize
The model_id you seem to be trying is from one of our tutorials but this is not the logic in them
You are using both LangChainInstrumentator and arize_client.log_spans when they are meant for 2 different things:
You use the instrumentator if you want to log spans 1-by-1, streaming them via OTLP
You use log_spans if you have the spans in a dataframe and want to upload all of them as 1 batch of data
Thanks for this debugging . If there is any code that I can refer to send traces to Arize. please let me know.
This teaches how to send traces to Arize via OTLP https://colab.research.google.com/github/Arize-ai/tutorials_python/blob/main/Arize_Tutorials/Tracing/Arize_Tutorial_OTLP_Tracing_Llama_Index.ipynb
