-
Notifications
You must be signed in to change notification settings - Fork 0
Fix/dev set up test #2
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -259,6 +259,7 @@ Evaluation worker -> evaluate -> handler.evaluation_results(list) -> CompositeEm | |
| - Backpressure strategies for high-volume content events. | ||
|
|
||
| ## 14. Development setup | ||
|
|
||
| Get the packages installed: | ||
|
|
||
| Setup a virtual env (Note: will erase your .venv in the current folder) | ||
|
|
@@ -272,20 +273,87 @@ pip install -e util/opentelemetry-util-genai --no-deps | |
| pip install -e util/opentelemetry-util-genai-evals --no-deps | ||
| pip install -e util/opentelemetry-util-genai-evals-deepeval --no-deps | ||
| pip install -e util/opentelemetry-util-genai-emitters-splunk --no-deps | ||
| pip install -e util/opentelemetry-util-genai-traceloop-translator --no-deps | ||
| pip install -e instrumentation-genai/opentelemetry-instrumentation-langchain --no-deps | ||
| pip install -r dev-genai-requirements.txt | ||
| pip install -r instrumentation-genai/opentelemetry-instrumentation-langchain/examples/manual/requirements.txt | ||
|
|
||
| export OTEL_SEMCONV_STABILITY_OPT_IN=gen_ai_latest_experimental | ||
| export OTEL_INSTRUMENTATION_GENAI_EMITTERS=span_metric_event,splunk | ||
| export OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=true | ||
| export OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT_MODE=SPAN_AND_EVENT | ||
| export OTEL_INSTRUMENTATION_GENAI_EVALS_EVALUATORS="Deepeval(LLMInvocation(bias,toxicity))" | ||
| # configure which GenAI types to evaluate and which evaluations | ||
| export OTEL_INSTRUMENTATION_GENAI_EVALS_EVALUATORS="Deepeval(LLMInvocation(bias,toxicity))" | ||
| # Deepeval optimization | ||
| export DEEPEVAL_FILE_SYSTEM=READ_ONLY | ||
| export DEEPEVAL_TELEMETRY_OPT_OUT=YES | ||
| # set environment and service names for ease of filtering | ||
| export OTEL_SERVICE_NAME=genai-eval-test | ||
| export OTEL_RESOURCE_ATTRIBUTES='deployment.environment=genai-dev' | ||
| ``` | ||
|
|
||
| For telemetry to properly work with Splunk Platform instrumentation, set the env var to enable Splunk format for aggregated evaluation results. | ||
|
|
||
| ```bash | ||
| export OTEL_INSTRUMENTATION_GENAI_EVALS_RESULTS_AGGREGATION=true | ||
| export OTEL_INSTRUMENTATION_GENAI_EMITTERS_EVALUATION="replace-category:SplunkEvaluationResults" | ||
| ``` | ||
|
|
||
| ### Deepeval evaluator integration configuration | ||
|
|
||
| Instrumentation-side evaluations can be configured using `OTEL_INSTRUMENTATION_GENAI_EVALS_EVALUATORS` environment variable | ||
|
|
||
| ```bash | ||
| # uses defaults - evaluates LLMInvocation and AgentInvocation with 5 metrics: | ||
| # (bias,toxicity,answer_relevancy,hallucination,sentiment) | ||
| OTEL_INSTRUMENTATION_GENAI_EVALS_EVALUATORS="deepeval" | ||
|
|
||
| # Specific metrics for LLMInvocation | ||
| OTEL_INSTRUMENTATION_GENAI_EVALS_EVALUATORS="deepeval(LLMInvocation(bias,toxicity))" | ||
|
|
||
| # Multiple types with metrics | ||
| OTEL_INSTRUMENTATION_GENAI_EVALS_EVALUATORS="deepeval(LLMInvocation(bias,toxicity),AgentInvocation(hallucination))" | ||
|
|
||
| # With metric options | ||
| OTEL_INSTRUMENTATION_GENAI_EVALS_EVALUATORS="deepeval(LLMInvocation(hallucination(threshold=0.8)))" | ||
| ``` | ||
|
|
||
| ```bash | ||
| export OTEL_INSTRUMENTATION_GENAI_DEBUG=true | ||
| ``` | ||
|
|
||
| ### to install an instrumentation library | ||
|
|
||
| ```bash | ||
| pip install -e instrumentation-genai/opentelemetry-instrumentation-langchain --no-deps | ||
| ``` | ||
|
|
||
| Examples for each instrumentation library or package can be found in `<that package folder>/examples`, i.e. | ||
|
|
||
| ```bash | ||
| util/opentelemetry-util-genai/examples/ | ||
| ``` | ||
|
|
||
| ### Installing a Translator library | ||
|
|
||
| To use exiting 3rd party instrumentations and convert it to Splunk Distro semantic conventions/run instrumentation-side evaluations you can install a translator library. | ||
|
|
||
| For example for existing traseloop instrumentations | ||
| ```bash | ||
| pip install -e util/opentelemetry-util-genai-traceloop-translator --no-deps | ||
| ``` | ||
|
Comment on lines
+335
to
+342
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. Fix wording + spelling in translator section. Line 337 “exiting 3rd party” → “existing third‑party” and Line 339 “traseloop” → “traceloop”. 💡 Suggested doc fix-To use exiting 3rd party instrumentations and convert it to Splunk Distro semantic conventions/run instrumentation-side evaluations you can install a translator library.
+To use existing third-party instrumentations and convert them to Splunk Distro semantic conventions/run instrumentation-side evaluations you can install a translator library.
-For example for existing traseloop instrumentations
+For example for existing traceloop instrumentations🧰 Tools🪛 LanguageTool[grammar] ~337-~337: Use a hyphen to join words. (QB_NEW_EN_HYPHEN) [grammar] ~339-~339: Ensure spelling is correct (QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1) 🤖 Prompt for AI Agents |
||
|
|
||
| ## Installing aidefence instrumentation | ||
|
|
||
| ```bash | ||
| pip install -e instrumentation-genai/opentelemetry-instrumentation-aidefense | ||
|
|
||
| export AI_DEFENSE_API_KEY="your-ai-defense-key" | ||
|
|
||
| python instrumentation-genai/opentelemetry-instrumentation-aidefense/examples/multi_agent_travel_planner/main.py | ||
| ``` | ||
|
|
||
| Sudo-code to create LLMInvocation for your in-code llm code | ||
| ## In-code instrumentation example | ||
|
|
||
| Sudo-code to create LLMInvocation for your in-code for an application: | ||
|
|
||
| ```python | ||
| from opentelemetry.util.genai.handler import get_telemetry_handler | ||
|
|
@@ -302,14 +370,10 @@ inv.output_messages = [OutputMessage(role="assistant", parts=[Text("Hi!")], fini | |
| handler.stop_llm(inv) | ||
| ``` | ||
|
|
||
| Additionally, for `aidefense` | ||
| Additionally, you can run a simple example reporting an LLM Invocation | ||
|
|
||
| ```bash | ||
| pip install -e instrumentation-genai/opentelemetry-instrumentation-aidefense | ||
|
|
||
| export AI_DEFENSE_API_KEY="your-ai-defense-key" | ||
|
|
||
| python instrumentation-genai/opentelemetry-instrumentation-aidefense/examples/multi_agent_travel_planner/main.py | ||
| python util/opentelemetry-util-genai/examples/invocation_example.py llm --exporter otlp | ||
| ``` | ||
|
|
||
| ## 15. Linting and Formatting | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| """Version metadata for opentelemetry-util-genai-evals.""" | ||
|
|
||
| __version__ = "0.1.7" | ||
| __version__ = "0.1.8" |
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.
Align Deepeval token casing to avoid config ambiguity.
Line 284 uses
Deepeval(...)while Lines 307–316 usedeepeval(...). If the evaluator grammar is case‑sensitive, this is a foot‑gun for users. Please standardize the token casing across examples (and ideally match the parser’s expected value).🤖 Prompt for AI Agents