Skip to content

feat(telemetry): complete ollama-stream-telemetry.sh implementation #41

@aygp-dr

Description

@aygp-dr

Current script needs the following improvements:

  1. Docker/Proxy Integration:

    • Fix URL handling for host.docker.internal vs localhost
    • Handle proxy authentication if needed
    • Better error messages for proxy connection failures
    • Add proxy status to telemetry output
  2. Streaming Output:

    • Ensure proper ndjson handling
    • Handle chunked transfer encoding correctly
    • Add progress indicators for long responses
  3. Telemetry Enhancements:

    • Add network latency metrics
    • Calculate tokens/second rate
    • Track connection retries
    • Add timing for proxy vs direct connections
  4. Error Handling:

    • Better curl error parsing
    • Retries with exponential backoff
    • Timeout handling
    • Signal handling (CTRL+C)
  5. Documentation:

    • Add detailed usage examples
    • Document mitmproxy integration
    • Add configuration guide
    • Document metrics format
  6. Testing:

    • Add test cases
    • Mock responses
    • Proxy failure scenarios
    • Various model scenarios
  7. CI Integration:

    • Add GitHub action
    • Automated tests
    • Shellcheck integration
    • Version tagging

Context:
The script was created as part of the OpenTelemetry integration effort. It currently supports basic streaming and telemetry but needs hardening for production use.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions