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-5-nano", 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.4.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.4-py3-none-any.whl (64.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: splunk_otel_util_genai-0.1.4.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.4.tar.gz
Algorithm Hash digest
SHA256 4d4a7ac3973fe78c62d512c265abfdef23955ab24b643246689dc30657c6ad0b
MD5 b107b753db2d6c3d1fe118d78948c635
BLAKE2b-256 71cb060b1bb3f70dfb780a00d0284b507232a45856f8c133729e5e7e8958aaa2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for splunk_otel_util_genai-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 556a17c39521beb808d621ab87e35b0a4926870ef4bd698b4c81ee8998de96eb
MD5 5248dffd60d05669eb62a88debd800da
BLAKE2b-256 79b2a7b5c2c9b1617d7f11a512fc268d0f067ea2313f928cecf9ec9a2ea6ca92

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