Skip to content

Conversation

Copilot
Copy link

@Copilot Copilot AI commented Oct 3, 2025

Description

This PR optimizes the internal-logs feature in opentelemetry-otlp by changing its dependency from opentelemetry-http/internal-logs to opentelemetry/internal-logs.

Problem

Currently, enabling the internal-logs feature in opentelemetry-otlp requires opentelemetry-http even when only using gRPC transport (grpc-tonic). This creates an unnecessary dependency since:

  1. All internal logging macros (otel_debug!, otel_warn!, otel_error!, otel_info!) are defined in the opentelemetry crate
  2. The opentelemetry-http/internal-logs feature simply forwards to opentelemetry/internal-logs
  3. Users who only need gRPC transport are forced to pull in HTTP transport dependencies

Solution

Changed the internal-logs feature definition in opentelemetry-otlp/Cargo.toml:

-internal-logs = ["tracing", "opentelemetry_sdk/internal-logs", "opentelemetry-http/internal-logs"]
+internal-logs = ["tracing", "opentelemetry_sdk/internal-logs", "opentelemetry/internal-logs"]

Benefits

  • Reduced dependencies: When using grpc-tonic with internal-logs enabled (and disabling default features), opentelemetry-http is no longer compiled
  • More logical dependency: Depends directly on where internal logging macros are defined
  • No breaking changes: HTTP transport users are unaffected as http-proto and http-json features still properly depend on opentelemetry-http

Testing

Verified the following scenarios:

  • grpc-tonic + logs + internal-logs: opentelemetry-http not compiled
  • grpc-tonic + logs (no internal-logs): Builds successfully
  • http-proto + logs + internal-logs: opentelemetry-http properly included
  • ✅ Default features: All dependencies work correctly
  • ✅ All 29 unit tests pass
  • ✅ Examples compile successfully

Fixes #[issue_number]

Original prompt

This section details on the original issue you should resolve

<issue_title>[Feature]: Optimizing and modifying the dependency of the internal-logs feature in opentelemetry-otlp</issue_title>
<issue_description>### Related Problems?

Currently, opentelemetry-http/internal-logs in opentelemetry-otlp's internal-logs feature can be changed to opentelemetry/internal-logs?

Because: The internal-logs feature in opentelemetry-http depends on opentelemetry/internal-logs. This will eliminate the need to enable grpc-tonic in opentelemetry-otlp and disable default and internal-logs, eliminating the need to rely on opentelemetry-http. Thank you.

Describe the solution you'd like:

internal-logs = ["tracing", "opentelemetry_sdk/internal-logs", "opentelemetry/internal-logs"]

Considered Alternatives

No response

Additional Context

No response

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #1

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

… to opentelemetry/internal-logs

Co-authored-by: houseme <[email protected]>
@Copilot Copilot AI changed the title [WIP] [Feature]: Optimizing and modifying the dependency of the internal-logs feature in opentelemetry-otlp Optimize internal-logs feature dependency in opentelemetry-otlp Oct 3, 2025
@Copilot Copilot AI requested a review from houseme October 3, 2025 15:39
Copilot finished work on behalf of houseme October 3, 2025 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Optimizing and modifying the dependency of the internal-logs feature in opentelemetry-otlp

2 participants