Created
October 17, 2025 07:21
-
-
Save maxlaverse/0a6a60d3416adcc99fd0732fec5600c6 to your computer and use it in GitHub Desktop.
Tagging non-root span in BrainTrust
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Braintrust Feedback API | |
| # Set these environment variables: | |
| # export PROJECT_ID="your-project-id" | |
| # export SPAN_ID="your-span-id" | |
| # export BRAINTRUST_API_KEY="your-api-key" | |
| echo "Submitting feedback..." | |
| curl -X POST \ | |
| "https://api.braintrust.dev/v1/project_logs/${PROJECT_ID}/feedback" \ | |
| -H "Authorization: Bearer ${BRAINTRUST_API_KEY}" \ | |
| -H "Content-Type: application/json" \ | |
| -d '{ | |
| "feedback": [ | |
| { | |
| "id": "'${SPAN_ID}'", | |
| "scores": { | |
| "How accurate is this score": 0.95 | |
| }, | |
| "comment": "GOOD: The data quality scoring accurately identified high-quality records with complete information." | |
| } | |
| ] | |
| }' \ | |
| -k \ | |
| -v |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| < HTTP/2 400 | |
| < content-type: application/json; charset=utf-8 | |
| < content-length: 297 | |
| < x-amz-cf-pop: MXP63-P1 | |
| < date: Fri, 17 Oct 2025 07:17:38 GMT | |
| < access-control-allow-credentials: true | |
| < x-amzn-requestid: d48bed3f-c3f5-4c05-8c5d-4633921fdaf4 | |
| < x-amzn-remapped-content-length: 297 | |
| < x-bt-internal-trace-id: 68f1ed92000000005b762ed1f16c0324 | |
| < x-amz-apigw-id: SlIO8FdZIAMEYaw= | |
| < vary: Origin, Accept-Encoding | |
| < etag: W/"129-7uLoyciUXdz4JTkxUqI524FZCBc" | |
| < access-control-expose-headers: x-bt-cursor,x-bt-found-existing,x-bt-query-plan | |
| < x-amzn-trace-id: Root=1-68f1ed92-2ed48f603b402b55164ac7b0;Parent=36e41763691939ad;Sampled=0;Lineage=1:24be3d11:0 | |
| < via: 1.1 baa920f719f42b644a28367057e23f2a.cloudfront.net (CloudFront), 1.1 34d457763037634fb4577f449ab0e6c4.cloudfront.net (CloudFront) | |
| < x-cache: Error from cloudfront | |
| < x-amz-cf-pop: MXP53-P1 | |
| < x-amz-cf-id: SIKWlRPf6XObP-UH0fpbxoRDVZ_8uc6wcmbk25wrnJ-AIrLnMtheQw== | |
| < | |
| * Connection #0 to host api.braintrust.dev left intact | |
| {"Code":"BadRequestError","Message":"Cannot specify 'tags' for non-root spans [[email protected]] [user_org=xxx] [timestamp=1760685458.708]","InternalTraceId":"68f1ed92000000005b762ed1f16c0324","Path":"/v1/project_logs/xxx/feedback","Service":"api"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| < HTTP/2 200 | |
| < content-type: application/json; charset=utf-8 | |
| < content-length: 20 | |
| < x-amz-cf-pop: MXP63-P1 | |
| < date: Fri, 17 Oct 2025 07:16:58 GMT | |
| < access-control-allow-credentials: true | |
| < x-amzn-requestid: 7d953227-6315-46bf-953f-4955b7882bc6 | |
| < x-amzn-remapped-content-length: 20 | |
| < x-bt-internal-trace-id: 68f1ed67000000007fc266030aeff146 | |
| < x-amz-apigw-id: SlIIPEI2oAMEWFg= | |
| < vary: Origin, Accept-Encoding | |
| < etag: W/"14-Y53wuE/mmbSikKcT/WualL1N65U" | |
| < access-control-expose-headers: x-bt-cursor,x-bt-found-existing,x-bt-query-plan | |
| < x-amzn-trace-id: Root=1-68f1ed67-2ebaedfd7f6b5b2d043b935b;Parent=1fb0e39652dce6dc;Sampled=0;Lineage=1:24be3d11:0 | |
| < via: 1.1 baa920f719f42b644a28367057e23f2a.cloudfront.net (CloudFront), 1.1 208b6b3c2987a90f9564a1c5b99e2bba.cloudfront.net (CloudFront) | |
| < x-cache: Miss from cloudfront | |
| < x-amz-cf-pop: MXP53-P1 | |
| < x-amz-cf-id: mFE5rtnM5h_au6utuWCTHXM67-_qb8EOs2KHQHlq41xwm-frgT7Xig== | |
| < | |
| {"status":"success"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment