Skip to main content

OpenTelemetry GenAI Utils

Project description

Minimal Overview

Utility function to provide APIs and data types to ease instrumentation of Generative AI workloads using OpenTelemetry semantic conventions.

Example usage for LLM Invocation.

from opentelemetry.util.genai.handler import get_telemetry_handler
handler = get_telemetry_handler()
user_input = "Hello"
inv = LLMInvocation(request_model="gpt-4", provider="openai",
  input_messages=[InputMessage(role="user", parts=[Text(user_input)])])
handler.start_llm(inv)
# your code which actuall invokes llm here
# response = client.chat.completions.create(...)
# ....
inv.output_messages = [OutputMessage(role="assistant", parts=[Text("Hi!")], finish_reason="stop")]
handler.stop_llm(inv)

See the example in examples/agentic_example.py for a full agent + LLM invocation flow.

Further Documentation

For architecture, design rationale, and broader usage patterns please consult: * Core concepts, high-level usage and setup * README.packages.architecture.md – extensibility architecture & emitter pipeline design.

Those documents cover configuration (environment variables, content capture modes, evaluation emission, extensibility via entry points) and release/stability notes.

Support & Stability

GenAI semantic conventions are incubating.

License

Apache 2.0 (see LICENSE).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

splunk_otel_util_genai-0.1.3.tar.gz (66.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

splunk_otel_util_genai-0.1.3-py3-none-any.whl (64.0 kB view details)

Uploaded Python 3

File details

Details for the file splunk_otel_util_genai-0.1.3.tar.gz.

File metadata

  • Download URL: splunk_otel_util_genai-0.1.3.tar.gz
  • Upload date:
  • Size: 66.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.28.1

File hashes

Hashes for splunk_otel_util_genai-0.1.3.tar.gz
Algorithm Hash digest
SHA256 8f3ab5253a7a515f76e83a9a80f3fec76f6120ee18e1554d2ef5caf6a2e2e8a2
MD5 f04753274000794979f2d710d6b29246
BLAKE2b-256 0962d234e5ad7839068f7ea731c94d0639fce8501af1baa99e55a281980d739b

See more details on using hashes here.

File details

Details for the file splunk_otel_util_genai-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for splunk_otel_util_genai-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5a94cb83912e31a3035e22d69cb6e21eecd88f35e2f2095fd8cf4d1bb20abc8a
MD5 ecbb4bc112f74d57817c03e3be2635aa
BLAKE2b-256 bf38c146bd7c630a6a8856a3f81db8afacba1cc5833ff312e9c4657cb3937c24

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page