Library Search
结果页

Python OpenTelemetry 链路追踪实战

在 元器件 / 技术栈 / 知识库 中找到 16 个匹配结果。

返回文档库
技术栈

技术栈

8 个
查看全部
Jaeger ## 目标 在 Python Flask 微服务中使用 OpenTelemetry SDK 自动采集 Trace,上报到 Jaeger,可视化请求链路和耗时分布。 ## 完整代码 ### 架构 ``` Client → ServiceA(:5000) → ServiceB(:5001) ↓ OTLP ↓ OTLP Jaeger… 3% gRPC ```go // 服务端一元拦截器 func loggingInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) { start := time.Now() resp, err… 2% spaCy ## 环境准备 - **Python**:>= 3.8(推荐 3.10) - **系统**:Linux / macOS / Windows(部分模型仅 Linux/macOS) ## 安装命令 ### 最小安装 ```bash pip install spacy ``` ### 安装语言模型 ```bash # 英文(小/中/大/Transformer) python -m spacy… 2% Scikit-learn ` | --- ## 第 2 章:Pipeline 优雅构建数据流 ```python from sklearn.pipeline import Pipeline from sklearn.preprocessing import StandardScaler from sklearn.decomposition import PCA from sklearn.linear_model im… 2% Flask Ubuntu 20.04+、Debian 11+、CentOS 8+) - **Python 版本:** Python 3.9 及以上(推荐 3.11+) - **依赖项:** pip(Python 包管理器,通常随 Python 一起安装)、virtualenv 或 venv(虚拟环境工具,Python 3.3+ 内置) ### 创建虚拟环境(强烈推荐) ```bash # 创建虚拟环境 p… 2% PyTorch ning) ### 1.1 使用 torchvision 预训练模型 ```python import torch import torch.nn as nn from torchvision import models, transforms from torch.utils.data import DataLoader from torchvision.datasets import Im… 1% NumPy # NumPy 入门教程 —— 从 Python 列表到向量化思维 ## 本章目标 - 理解 NumPy 在 Python 生态系统中的定位 - 掌握 ndarray 的内存模型与性能原理 - 学会用向量化思维替代显式循环 - 掌握常见数据操作技巧 ## 1. NumPy 的定位 ``` Python 科学计算栈层级: 应用层: scikit-learn | TensorFlow/… 1% FastAPI macOS 11+ / Linux(Ubuntu 20.04 推荐) - **Python 版本:** Python 3.9 及以上(推荐 3.11+,充分利用类型提示新特性) - **依赖项:** pip、virtualenv/venv ### 创建并激活虚拟环境 ```bash python -m venv venv # Windows: venv\Scripts\activate #… 1%
知识库

知识库

8 个
Python OpenTelemetry 链路追踪实战 ## 目标 在 Python Flask 微服务中使用 OpenTelemetry SDK 自动采集 Trace,上报到 Jaeger,可视化请求链路和耗时分布。 ## 完整代码 ### 架构 ``` Client → ServiceA(:5000) → ServiceB(:5001) ↓ OTLP ↓ OTLP Jaeger… 3% 03-实战数据处理与Web-API # Python 实战教程:数据处理与 Web API ## 前言 本教程将带你使用 Python 完成两个真实项目:**数据清洗与分析** 和 **REST API 后端**。 --- ## 项目一:数据分析流水线 ### 场景 你拿到一份电商销售 CSV 数据,需要: 1. 清洗脏数据 2. 多维度聚合统计 3. 生成可视化报表 ### 数据准备 ```csv order_id… 2% Python 常用数据结构实战 # Redis Python 常用数据结构实战 ## 目标 演示 Redis 五大核心数据结构:String、Hash、List、Set、Sorted Set,以及分布式锁。 ## 环境准备 ```bash pip install redis # 确保 Redis 运行 docker run -d --name redis -p 6379:6379 redis:7-alpine ``` ##… 2% gRPC 微服务通信入门 ```go // 服务端一元拦截器 func loggingInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) { start := time.Now() resp, err… 2% 树莓派 Pico 代码例程 — MicroPython + C SDK + PIO # 树莓派 Pico 代码例程 Pico 支持 MicroPython(适合快速原型)和 C/C++ SDK(适合性能敏感场景)。 --- ## 示例 1:MicroPython — LED 闪烁 + 板载 LED ```python """Pico MicroPython — 板载 LED (GP25) 闪烁""" from machine import Pin import time… 2% Scikit-learn 机器学习入门实战 ` | --- ## 第 2 章:Pipeline 优雅构建数据流 ```python from sklearn.pipeline import Pipeline from sklearn.preprocessing import StandardScaler from sklearn.decomposition import PCA from sklearn.linear_model im… 2% 树莓派 4B GPIO 编程例程 — Python + C + WiringPi ## 示例 4:Python — UART 串口通信 ```python #!/usr/bin/env python3 """树莓派4B UART 收发 — /dev/serial0 (GPIO14=TXD, GPIO15=RXD)""" import serial import time # 启用串口: sudo raspi-config → Interface → Serial → No(… 2% 02-进阶实战-迁移学习与部署 ning) ### 1.1 使用 torchvision 预训练模型 ```python import torch import torch.nn as nn from torchvision import models, transforms from torch.utils.data import DataLoader from torchvision.datasets import Im… 1%