Skip to content

feat: add basic opentelemetry tracing support#75

Closed
codefromthecrypt wants to merge 5 commits intoaaif-goose:mainfrom
codefromthecrypt:otel
Closed

feat: add basic opentelemetry tracing support#75
codefromthecrypt wants to merge 5 commits intoaaif-goose:mainfrom
codefromthecrypt:otel

Conversation

@codefromthecrypt
Copy link
Copy Markdown
Collaborator

@codefromthecrypt codefromthecrypt commented Sep 18, 2024

This adds basic setup for tracing and some tests as a toe-hold. Later pull requests here can enhance the traces with more data. This would be even better if LLM spans were added as discussed here square/exchange#33

Meanwhile, this is what a trace looks like running against ollama using otel-tui as the tracing backend

Screenshot 2024-09-18 at 6 14 12 PM

If any maintainers have any glitch fixes they also have my permission to push directly to this branch.

Comment thread tests/cli/test_session_otel.py Outdated
Copy link
Copy Markdown

@anuraaga anuraaga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some drive-by comments requested by @codefromthecrypt, nothing should be considered authoritative or even beyond nits

Comment thread CONTRIBUTING.md Outdated
Comment thread .otel.env Outdated
Comment thread src/goose/cli/session.py Outdated
Comment thread src/goose/cli/session.py Outdated
Comment thread src/goose/cli/session.py Outdated
Comment thread src/goose/cli/session.py
self.exchange.add(message)
self.reply() # Process the user message.
except KeyboardInterrupt:
span.set_status(OtelStatus(OtelStatusCode.ERROR, "KeyboardInterrupt"))
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an interesting case. I don't know if an explicit interrupt would actually be an error for the user, it's expected to fail - a browser comparison would be closing a tab during a request, it would be common for the request to still complete on the server side and be green. Anyways, it's probably correct to set it as an error though not fully confident

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added a comment as I don't know yet, either, but maybe after some practice someone will.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey idea.. maybe we set it to ok, but leave the interrupt?

Signed-off-by: Adrian Cole <adrian.cole@elastic.co>
@codefromthecrypt
Copy link
Copy Markdown
Collaborator Author

excellent feedback @anuraaga, thanks for dropping by!

Comment thread src/goose/cli/session.py Outdated
Signed-off-by: Adrian Cole <adrian.cole@elastic.co>
Comment thread pyproject.toml Outdated
@michaelneale
Copy link
Copy Markdown
Collaborator

closing as moved to rust

@codefromthecrypt codefromthecrypt deleted the otel branch February 7, 2025 01:05
jamadeo pushed a commit that referenced this pull request Apr 13, 2026
Without an explicit [[bin]] section, Cargo uses the package name 'goose2'
as the binary name. macOS uses the process/binary name for the Dock and
App Switcher labels in dev mode, so the app appeared as 'goose2' instead
of 'Goose'.
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.

3 participants