Skip to main content

阿里云LlamaIndex自动检测库

这是Python自动检测库,专为LlamaIndex框架设计。通过此库产生的追踪信息完全兼容OpenTelemetry,可以发送到OpenTelemetry收集器进行查看,例如xtrace。

安装

通过下列命令安装aliyun-instrumentation-llama-index:

pip3 install  aliyun-instrumentation-llama-index

兼容性

llama-index与aliyun-instrumentation-llama-index两者间的版本兼容性以下所述:

llama-index版本 aliyun-instrumentation-llama-index版本
>=0.10.0, < 0.10.43 >=1.0.0

快速开始

安装必须的包

首先,安装本示范所需的包:

pip install aliyun-instrumentation-llama-index llama-index opentelemetry-sdk opentelemetry-exporter-otlp

设置追踪

以下Python代码用于设置AliyunLlamaIndexInstrumentor来追踪llama-index,并将追踪信息输出至控制台。

from aliyun.instrumentation.llama_index import AliyunLlamaIndexInstrumentor

from opentelemetry import trace
from opentelemetry.sdk.resources import Resource, SERVICE_NAME, SERVICE_VERSION
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import SimpleSpanProcessor, ConsoleSpanExporter

resource = Resource(
    attributes={
        SERVICE_NAME: 'aliyun_llama_index_test',
        SERVICE_VERSION: '0.0.1',
        # "telemetry.sdk.language": "Python",
    }
)
provider = TracerProvider(resource=resource)
provider.add_span_processor(SimpleSpanProcessor(ConsoleSpanExporter()))  # 在控制台输出Trace
trace.set_tracer_provider(provider)
# aliyun llama-index instrumentor
AliyunLlamaIndexInstrumentor().instrument()

Metadata

Release files for aliyun-instrumentation-llama-index 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for aliyun-instrumentation-llama-index 1.0.1
File Interpreter ABI Platform Actions
aliyun_instrumentation_llama_index-1.0.1-py3-none-any.whl Python 3 none any Details for aliyun_instrumentation_llama_index-1.0.1-py3-none-any.whl

Release files / aliyun_instrumentation_llama_index-1.0.1-py3-none-any.whl

Download URL aliyun_instrumentation_llama_index-1.0.1-py3-none-any.whl
Size 14.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
570c32ac13e00f402ff2a8d2fb6d7db460a712d172e0e75f8b8f73a177e8c572
BLAKE2b-256 checksum
How to use checksums
5196444d78afb3915dba282b791be7087de5793e4206dfc9d91bce40e61c81bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.12.3

Security for aliyun-instrumentation-llama-index 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page