Skip to content

Use Longtext rather than varchar - #591

Open
bmschwa wants to merge 1 commit into
Rello:masterfrom
bmschwa:master
Open

Use Longtext rather than varchar#591
bmschwa wants to merge 1 commit into
Rello:masterfrom
bmschwa:master

Conversation

@bmschwa

@bmschwa bmschwa commented Sep 3, 2026

Copy link
Copy Markdown

Queries get really big... was trying to get some data from langfuse & their api describes modifying the query parameters depending on what you want. So in curl, I ended up with something like this to get an overview of AI usage:

curl -vv -s -G "https://us.cloud.langfuse.com/api/public/v2/metrics" -u "xxx:yyy" --data-urlencode 'query={"view":"observations","dimensions":[{"field":"providedModelName"}],"metrics":[{"measure":"count","aggregation":"sum"},{"measure":"totalCost","aggregation":"sum"},{"measure":"totalTokens","aggregation":"sum"},{"measure":"inputTokens","aggregation":"sum"},{"measure":"outputTokens","aggregation":"sum"},{"aggregation":"avg", "measure":"latency"},{"aggregation":"p50", "measure":"latency"}],"fromTimestamp":"2026-08-04T00:00:00Z","toTimestamp":"2026-09-03T23:59:59Z","orderBy":[{"field":"sum_totalCost","direction":"desc"}],"config":{"row_limit":50}}'

which works in curl but this monstrosity that needs to be kept in the database is:

https://us.cloud.langfuse.com/api/public/v2/metrics?query=%7b%22view%22%3a%22observations%22%2c%22dimensions%22%3a%5b%7b%22field%22%3a%22providedModelName%22%7d%5d%2c%22metrics%22%3a%5b%7b%22measure%22%3a%22count%22%2c%22aggregation%22%3a%22sum%22%7d%2c%7b%22measure%22%3a%22totalCost%22%2c%22aggregation%22%3a%22sum%22%7d%2c%7b%22measure%22%3a%22totalTokens%22%2c%22aggregation%22%3a%22sum%22%7d%2c%7b%22measure%22%3a%22inputTokens%22%2c%22aggregation%22%3a%22sum%22%7d%2c%7b%22measure%22%3a%22outputTokens%22%2c%22aggregation%22%3a%22sum%22%7d%2c%7b%22aggregation%22%3a%22avg%22%2c+%22measure%22%3a%22latency%22%7d%2c%7b%22aggregation%22%3a%22p50%22%2c+%22measure%22%3a%22latency%22%7d%5d%2c%22fromTimestamp%22%3a%222026-08-04T00%3a00%3a00Z%22%2c%22toTimestamp%22%3a%222026-09-03T23%3a59%3a59Z%22%2c%22orderBy%22%3a%5b%7b%22field%22%3a%22sum_totalCost%22%2c%22direction%22%3a%22desc%22%7d%5d%2c%22config%22%3a%7b%22row_limit%22%3a50%7d%7d

Queries get really big
@Rello

Rello commented Sep 3, 2026

Copy link
Copy Markdown
Owner

nice suggestion. thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants