Skip to content

Add OTLP export docs, examples, and endpoint path fix - #534

Merged
arjun-rajappa merged 4 commits into
masterfrom
otlp-export-docs-and-endpoint-fix
Sep 30, 2026
Merged

arjun-rajappa merged 4 commits into
masterfrom
otlp-export-docs-and-endpoint-fix

Conversation

@arjun-rajappa

Copy link
Copy Markdown
Contributor

Why

The OTLP export feature lacked end-user documentation and runnable examples, making it hard to discover and configure. Additionally, a bug caused the exporter to crash when OTEL_EXPORTER_OTLP_ENDPOINT was set to a base URL without a path (http://host:4318), because opentelemetry-exporter-otlp expects the path to be included.

What

  • README.md — added a comprehensive ## OTLP Export section covering quick start, all supported environment variables, YAML configuration, config precedence, TLS/mTLS setup, and a troubleshooting guide.
  • examples/README.md — new file describing prerequisites (agent OTLP port check) and how to run each example script.
  • examples/otlp_http.rb — runnable quickstart for OTLP HTTP/protobuf export covering 5 span types (basic, HTTP exit, database, nested, error).
  • examples/otlp_with_headers.rb — runnable example for authentication headers and TLS/mTLS configuration.
  • examples/otel.rb — added cross-reference header pointing to the new OTLP examples; removed stray # Made with Bob comment.
  • resolve_otlp_endpoint — fixed to append /v1/traces to user-supplied base URLs that have no path, matching the OTLP spec behaviour for OTEL_EXPORTER_OTLP_ENDPOINT.
  • host_agent_reporting_observer_test.rb — two new tests: base URL gets path appended; fully-qualified URL is passed through unchanged.

@arjun-rajappa arjun-rajappa self-assigned this Sep 30, 2026
…h fix

- Expand README.md with a full OTLP export section covering quick start,
  env vars, YAML config, TLS/mTLS, and troubleshooting
- Add examples/README.md with prerequisites and run instructions
- Add otlp_http.rb and otlp_with_headers.rb runnable example scripts
- Annotate otel.rb header to cross-reference new OTLP examples
- Fix resolve_otlp_endpoint to append /v1/traces to user-supplied base
  URLs (OTEL_EXPORTER_OTLP_ENDPOINT) that have no path
- Add two unit tests covering base URL path-appending and fully-qualified
  URL pass-through

Signed-off-by: Arjun Rajappa <arjun.rajappa@ibm.com>
@arjun-rajappa
arjun-rajappa force-pushed the otlp-export-docs-and-endpoint-fix branch from 5bee86b to 7b331e2 Compare September 30, 2026 05:18
@arjun-rajappa
arjun-rajappa marked this pull request as ready for review September 30, 2026 05:19
@arjun-rajappa
arjun-rajappa requested a review from a team September 30, 2026 05:19
Update SonarQube exclusion patterns to recursively match files under
.github, bin, examples, and extras directories, and exclude examples
from duplicate code detection (CPD)

Signed-off-by: Arjun Rajappa <arjun.rajappa@ibm.com>

@tamarastanojevicvucic tamarastanojevicvucic left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks nice 👍

Signed-off-by: Arjun Rajappa <arjun.rajappa@ibm.com>
@arjun-rajappa
arjun-rajappa force-pushed the otlp-export-docs-and-endpoint-fix branch from 6ee5991 to 45c9be5 Compare September 30, 2026 06:53

@pvital pvital left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two few minor change requests.

Comment thread examples/otlp_http.rb Outdated
Comment thread examples/otlp_with_headers.rb Outdated
Signed-off-by: Arjun Rajappa <arjun.rajappa@ibm.com>
@sonarqubecloud

Copy link
Copy Markdown

@pvital pvital left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good to me.

@arjun-rajappa
arjun-rajappa merged commit 1c85ae8 into master Sep 30, 2026
230 of 231 checks passed
@arjun-rajappa
arjun-rajappa deleted the otlp-export-docs-and-endpoint-fix branch September 30, 2026 09:32
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.

3 participants