-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
span database #1608
Open
sfc-gh-pmardziel
wants to merge
89
commits into
main
Choose a base branch
from
piotrm/otel_db
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
span database #1608
Changes from 60 commits
Commits
Show all changes
89 commits
Select commit
Hold shift + click to select a range
6e400c8
cleaning up old PR
sfc-gh-pmardziel a09c3a2
adding cost tracking to dummy endpoint
sfc-gh-pmardziel 00e1705
finishing dummy and starting bedrock
sfc-gh-pmardziel 0add8e0
finish up
sfc-gh-pmardziel 4b748b0
replacement for track_all_costs_tally
sfc-gh-pmardziel 9180fd0
docs
sfc-gh-pmardziel 9ef5106
Merge remote-tracking branch 'origin/main' into piotrm/otel-cost-trac…
sfc-gh-pmardziel b8627c2
fixing up dummy api
sfc-gh-pmardziel 1abb615
added huggingface cost tracking for otel
sfc-gh-pmardziel 69b0e2a
working on awaitables
sfc-gh-pmardziel 54ddad3
docs
sfc-gh-pmardziel 5a36084
debugging async issue
sfc-gh-pmardziel 4f4f624
work
sfc-gh-pmardziel ca3b5eb
async parallel fixes
sfc-gh-pmardziel 4e88f2c
nit
sfc-gh-pmardziel 62f8556
Merge remote-tracking branch 'origin/main' into piotrm/otel-cost-trac…
sfc-gh-pmardziel 5686e3d
fix optional imports handling with fromlist
sfc-gh-pmardziel e491efe
remove print
sfc-gh-pmardziel a340a67
remove another print
sfc-gh-pmardziel 2835286
doc format
sfc-gh-pmardziel 1d6c2e0
put snowflake env var check back in test_endpoints
sfc-gh-pmardziel a8ec165
remove context.run
sfc-gh-pmardziel 66dd6b7
make feature private
sfc-gh-pmardziel 67d9cb6
making more things private
sfc-gh-pmardziel e703b6c
Merge remote-tracking branch 'origin/main' into piotrm/otel-cost-trac…
sfc-gh-pmardziel 5fcc28c
Merge remote-tracking branch 'origin/main' into piotrm/otel-cost-trac…
sfc-gh-pmardziel e45fa5b
starting work on collector
sfc-gh-pmardziel d6ba709
working on collector
sfc-gh-pmardziel cb95a2f
Merge remote-tracking branch 'origin/main' into piotrm/otel_collector
sfc-gh-pmardziel 166d9ec
typeargs
sfc-gh-pmardziel 24f31e4
add type args
sfc-gh-pmardziel 356bb2b
nits
sfc-gh-pmardziel 0c3f1a0
span schema work
sfc-gh-pmardziel 9a137c9
Merge remote-tracking branch 'origin/piotrm/otel-cost-tracking' into …
sfc-gh-pmardziel d875e68
db work
sfc-gh-pmardziel 83d3215
Merge remote-tracking branch 'origin/piotrm/otel_collector' into piot…
sfc-gh-pmardziel ab0b16a
moved semconv to a different package, added span to/of orm
sfc-gh-pmardziel aa14ff8
nits
sfc-gh-pmardziel a487243
work
sfc-gh-pmardziel 3ab16ae
nits
sfc-gh-pmardziel 061091b
typed spans work
sfc-gh-pmardziel 8537d57
nits
sfc-gh-pmardziel f34f8eb
Merge remote-tracking branch 'origin/main' into piotrm/otel_db
sfc-gh-pmardziel bc23ef5
Remaining files.
sfc-gh-pmardziel 9a3f6c3
db work
sfc-gh-pmardziel a6d4573
get trace_record
sfc-gh-pmardziel 8d78d04
fixup
sfc-gh-pmardziel a19216e
finishing up
sfc-gh-pmardziel 7af1f2e
Merge remote-tracking branch 'origin/main' into piotrm/otel_db
sfc-gh-pmardziel 5368e6b
nits
sfc-gh-pmardziel 49de80a
Merge remote-tracking branch 'origin/main' into piotrm/otel_db
sfc-gh-pmardziel 1233d66
doc nits
sfc-gh-pmardziel 53338b4
remove accidental commit
sfc-gh-pmardziel f38efc3
docs nits
sfc-gh-pmardziel fe2f239
addressing PR comments
sfc-gh-pmardziel 8ba5e37
print -> warning
sfc-gh-pmardziel 363ee57
doc nits
sfc-gh-pmardziel 9f46ed0
nits
sfc-gh-pmardziel 54422ab
fixes
sfc-gh-pmardziel fd59fc9
docs additions
sfc-gh-pmardziel c8a296a
move to subfolder
sfc-gh-pmardziel 1100ea6
Merge remote-tracking branch 'origin/main' into piotrm/otel_db
sfc-gh-pmardziel e2ce342
Fix TypeAlias import .
sfc-gh-pmardziel 43e58c2
trying to get gitignore to work on the lock files
sfc-gh-pmardziel 2dec4ee
I don't know what is going on
sfc-gh-pmardziel db57921
fix typealias issues
sfc-gh-pmardziel 41b4bf8
remove another typealias
sfc-gh-pmardziel d911747
py3.8 fixes
sfc-gh-pmardziel 672e8a4
another one
sfc-gh-pmardziel a7284db
write api
sfc-gh-pmardziel 83d85eb
use compat type
sfc-gh-pmardziel 5139874
alias weakset
sfc-gh-pmardziel f4bd770
docs
sfc-gh-pmardziel e8773b0
working on python 3.8 issues
sfc-gh-pmardziel 92fb1ce
fix py38 issue
sfc-gh-pmardziel 64fa350
remove debug cell
sfc-gh-pmardziel 406059e
nits
sfc-gh-pmardziel 5d809a1
Merge remote-tracking branch 'origin/main' into piotrm/otel_db
sfc-gh-dkurokawa 30f27ae
Submit working `poetry.lock` file.
sfc-gh-dkurokawa bf796f8
Fix snowflake tests.
sfc-gh-dkurokawa 93aea9f
Merge remote-tracking branch 'origin/main' into piotrm/otel_db
sfc-gh-dkurokawa 0fe136e
Merge remote-tracking branch 'origin/main' into piotrm/otel_db
sfc-gh-dkurokawa 5f449c9
Fix snowflake tests.
sfc-gh-dkurokawa 2dd68ec
Update version.
sfc-gh-dkurokawa 7f0abbc
Fix up some small issues.
sfc-gh-dkurokawa f2c72bb
Remove unnecessary `poetry.lock` files.
sfc-gh-dkurokawa 4e5475c
Merge remote-tracking branch 'origin/main' into piotrm/otel_db
sfc-gh-dkurokawa 812dfc2
Merge remote-tracking branch 'origin/main' into piotrm/otel_db
sfc-gh-dkurokawa 5256462
Merge remote-tracking branch 'origin/main' into piotrm/otel_db
sfc-gh-dkurokawa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"! pip install opentelemetry-exporter-otlp\n", | ||
"! pip install \"fastapi[standard]\"" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# TruLens OTLP Collector Usage" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import json\n", | ||
"\n", | ||
"from opentelemetry import trace\n", | ||
"from opentelemetry.exporter.otlp.proto.http.trace_exporter import (\n", | ||
" OTLPSpanExporter,\n", | ||
")\n", | ||
"from opentelemetry.propagate import inject\n", | ||
"from opentelemetry.sdk.trace import TracerProvider\n", | ||
"from opentelemetry.sdk.trace.export import BatchSpanProcessor\n", | ||
"import requests\n", | ||
"from trulens.experimental.otel_tracing.core.otel import Collector\n", | ||
"\n", | ||
"tracer = trace.get_tracer(__name__)\n", | ||
"\n", | ||
"tracer_provider = TracerProvider()\n", | ||
"trace.set_tracer_provider(tracer_provider)\n", | ||
"span_processor = BatchSpanProcessor(\n", | ||
" OTLPSpanExporter(endpoint=\"http://localhost:5000\")\n", | ||
")\n", | ||
"tracer_provider.add_span_processor(span_processor)\n", | ||
"\n", | ||
"with tracer.start_as_current_span(\"request\") as span:\n", | ||
" headers = {}\n", | ||
" inject(headers)\n", | ||
"\n", | ||
"print(headers)\n", | ||
"\n", | ||
"c = Collector()\n", | ||
"c.start()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"res = requests.post(\"http://localhost:5000/\", json=json.dumps({\"key\": \"value\"}))\n", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This cell fails for me with the following error:
|
||
"res.content" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from opentelemetry.exporter import otlp" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"dir(otlp.proto.grpc)" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "trulens-9bG3yHQd-py3.11", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain what's going on in this cell? Like how do we know the exporter is pointing at this collector?