microsoft/skills

azure-monitor-opentelemetry-exporter-java

识别旧版 Java Exporter,并迁移到 Autoconfigure

  • SKILL.md 已保存
  • 中文用法已整理
  • 安装与运行未实测
先判断是否解决你的问题

azure-monitor-opentelemetry-exporter-java 是什么?

azure-monitor-opentelemetry-exporter-java 是一个明确标记为弃用的 Java Skill。它保留旧 exporter 的 span、metric 与 migration 概念,并将读者导向 azure-monitor-opentelemetry-autoconfigure;主要适合维护旧工程和拆解迁移工作,不适合作为新项目依赖说明。

中文说明由本站依据来源整理;英文原文保留在页面下方。

适合用在

  • 需要确认 Java 服务是否还依赖 azure-monitor-opentelemetry-exporter。
  • 要把旧的 exporter 初始化、SpanProcessor 或自定义 span 代码迁移到 Autoconfigure 方案。
按客户端选择安装入口

怎么接入你的 Agent?

  1. 定位完整 Skill 目录

    打开本项目来源,核对 SKILL.md 及其引用的脚本和资料。

  2. 交给你正在用的 Agent

    在下面选择客户端,展开并复制安装指令,让 Agent 读取来源后选择安装方式。

  3. 确认识别,再做具体任务

    让 Agent 回报安装目录和识别到的名称 azure-monitor-opentelemetry-exporter-java,然后按本页使用示例提供材料。

展开并复制给 Codex 的安装指令
发送给 Codex

安装并检查 azure-monitor-opentelemetry-exporter-java

请在 Codex 的当前工作环境中安装并检查 azure-monitor-opentelemetry-exporter-java 这个 Skill。

项目身份:microsoft/skills / azure-monitor-opentelemetry-exporter-java
来源:https://github.com/microsoft/skills/blob/f03ec5392f7a0f3aca12af47477e92f1edf7b44c/.github/plugins/azure-sdk-java/skills/azure-monitor-opentelemetry-exporter-java/SKILL.md
已定位的源文件:.github/plugins/azure-sdk-java/skills/azure-monitor-opentelemetry-exporter-java/SKILL.md

1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。
准备输入,再按步骤执行

装好以后,具体怎么用?

准备哪些材料

  • 收集当前 OpenTelemetry BOM、Azure Monitor exporter 版本、初始化代码、手动 Provider 配置和自定义处理器;核对目标运行环境与 Application Insights 目标资源。

会得到什么

  • 旧依赖与初始化调用清单、按官方迁移文档拆分的更新步骤,以及验证新遥测行为的测试点。

实际使用顺序

  1. 先将该源页视为弃用包迁移线索:源文推荐 azure-monitor-opentelemetry-autoconfigure,并附有 Azure SDK Migration Guide。
  2. 按 Migration Guide 替换依赖并更新初始化;再逐项迁移自定义 SpanProcessor、属性、采样和 span 创建逻辑,不直接照抄旧包版本或 LATEST 占位符。
  3. 在测试环境发送一条带已知 span name 和属性的调用,核实 Application Insights 中的目标资源、父子关系、异常和采样结果。
  4. 验证进程关闭时 provider 正常 flush / shutdown,并在依赖树中确认旧 artifact 已移除,避免新旧 exporter 同时导出。
使用示例

从一个具体任务开始

本站根据源文件编写的使用示例,未在本站实际运行。示例中的文件由你提供。

安装并识别 Skill 后发送

复制一个具体任务

教学任务:使用 azure-monitor-opentelemetry-exporter-java,盘点一个仍使用旧 com.azure exporter 的 Java 服务,并依据来源所列 Migration Guide 规划迁移到 azure-monitor-opentelemetry-autoconfigure。列出依赖替换、初始化、自定义 SpanProcessor 与验证点;不要采用 `LATEST` 作为固定版本,也不要声称已构建。
预期结果

预期得到基于当前项目版本的迁移待办。此教学任务未解析 Maven 依赖、未执行应用或验证遥测。

使用前先看这些限制

使用条件与边界

  • 源文件明确标记旧 artifact 已弃用。其示例使用 1.0.0-beta.x、LATEST 和 API 类型,不能当成当前稳定依赖或已验证迁移代码。
  • 迁移后组件和初始化 API 应以当前官方 Migration Guide 为准;该 Skill 只提供迁移方向,不证明源仓库中的每段示例仍适用于目标版本。
针对这个 Skill 的疑问

常见问题

这是新的 Java 接入推荐方式吗?

不是。Skill 原文明确说旧包已弃用并建议迁到 azure-monitor-opentelemetry-autoconfigure。新集成应按当前 Migration Guide 与实际依赖版本实施。

需要核对时再展开原文

来源原文与资料状态

源文件
已保存 SKILL.md,抓取于 2026-11-16T12:36:35.145Z
中文使用说明
已针对下方源文件版本整理用途、用法和常见问题
安装与任务测试
本站未执行安装或任务测试
来源复核
本页中文用法已对照保存版本的完整 SKILL.md 阅读整理
展开 SKILL.md 原文、章节与历史收录资料

.github/plugins/azure-sdk-java/skills/azure-monitor-opentelemetry-exporter-java/SKILL.md · 抓取时间 2026-11-16T12:36:35.145Z

以下保留源文件的 description、章节及摘录,供核对中文说明;完整文件通过上方链接打开。

抓取成功不代表已完成安装或任务测试。

来源 description(原文)

Azure Monitor OpenTelemetry Exporter for Java. Export OpenTelemetry traces, metrics, and logs to Azure Monitor/Application Insights. Triggers: "AzureMonitorExporter java", "opentelemetry azure java", "application insights java otel", "azure monitor tracing java". Note: This package is DEPRECATED. Migrate to azure-monitor-opentelemetry-autoconfigure.

查看源文件章节 / Source sections
  • 原文:Azure Monitor OpenTelemetry Exporter for Java
  • 原文:Installation (Deprecated)
  • 原文:Recommended: Use Autoconfigure Instead
  • 原文:Environment Variables
  • 原文:Basic Setup with Autoconfigure (Recommended)
  • 原文:Using Environment Variable
  • 原文:With Explicit Connection String
  • 原文:Creating Spans
  • 原文:Adding Span Attributes
  • 原文:Custom Span Processor
  • 原文:Nested Spans
  • 原文:Recording Exceptions
  • 原文:Metrics (via OpenTelemetry)
  • 原文:Key Concepts
  • 原文:Migration to Autoconfigure
  • 原文:Migration Steps
  • 原文:Best Practices
  • 原文:Reference Links
原文:Azure Monitor OpenTelemetry Exporter for Java

> **⚠️ DEPRECATION NOTICE**: This package is deprecated. Migrate to `azure-monitor-opentelemetry-autoconfigure`. > > See [Migration Guide](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/monitor/azure-monitor-opentelemetry-exporter/MIGRATION.md) for detailed instructions. Export OpenTelemetry telemetry data to Azure Monitor / Application Insights.

原文:Installation (Deprecated)

```xml <dependency> <groupId>com.azure</groupId> <artifactId>azure-monitor-opentelemetry-exporter</artifactId> <version>1.0.0-beta.x</version> </dependency> ```

原文:Recommended: Use Autoconfigure Instead

```xml <dependency> <groupId>com.azure</groupId> <artifactId>azure-monitor-opentelemetry-autoconfigure</artifactId> <version>LATEST</version> </dependency> ```

原文:Environment Variables

```bash APPLICATIONINSIGHTS_CONNECTION_STRING=InstrumentationKey=xxx;IngestionEndpoint=https://xxx.in.applicationinsights.azure.com/ ```

原文:Using Environment Variable

```java import io.opentelemetry.sdk.autoconfigure.AutoConfiguredOpenTelemetrySdk; import io.opentelemetry.sdk.autoconfigure.AutoConfiguredOpenTelemetrySdkBuilder; import io.opentelemetry.api.OpenTelemetry; import com.azure.monitor.opentelemetry.exporter.AzureMonitorExporter; // Connection string from APPLICATIONINSIGHTS_CONNECTION_STRING env var AutoConfiguredOpenTelemetrySdkBuilder sdkBuilder = AutoConfiguredOpenTelemetrySdk.builder(); AzureMonitorExporter.customize(sdkBuilder); OpenTelemetry openTelemetry = sdkBuilder.build().getOpenTelemetrySdk(); ```

原文:With Explicit Connection String

```java AutoConfiguredOpenTelemetrySdkBuilder sdkBuilder = AutoConfiguredOpenTelemetrySdk.builder(); AzureMonitorExporter.customize(sdkBuilder, "{connection-string}"); OpenTelemetry openTelemetry = sdkBuilder.build().getOpenTelemetrySdk(); ```

文件 SHA256:2ecdd3db79950efc38de599e90887a41f34e9a670949b9be8e6708578dbad6df

仓库许可证记录:MIT;skill-declaration-captured-not-interpreted,查看来源。

SKILL.md原文description · 2026-11-16T12:36:35.145Z

Azure Monitor OpenTelemetry Exporter for Java. Export OpenTelemetry traces, metrics, and logs to Azure Monitor/Application Insights. Triggers: "AzureMonitorExporter java", "opentelemetry azure java", "application insights java otel", "azure monitor tracing java". Note: This package is DEPRECATED. Migrate to azure-monitor-opentelemetry-autoconfigure.

查看历史简介来源

历史收录数据

来源仓库microsoft/skills
Skill源路径.github/plugins/azure-sdk-java/skills/azure-monitor-opentelemetry-exporter-java/SKILL.md

安装前请让使用的Agent先读取这个SKILL.md及其所在目录,确认依赖和所需权限。此页不生成未经来源验证的安装命令。

返回 Skills 目录,按任务继续筛选 · MCP与Skills教程与资源