Skip to content

feat(otlp): align resource and scope with OTel spec, record S3 region - #545

Merged
arjun-rajappa merged 2 commits into
masterfrom
otlp-resource-scope-fixes
Nov 24, 2026
Merged

arjun-rajappa merged 2 commits into
masterfrom
otlp-resource-scope-fixes

Conversation

@arjun-rajappa

Copy link
Copy Markdown
Contributor

Why

The OTLP exporter's resource and instrumentation scope output differs from the OTel semconv v1.41.0 spec. The scope name is wrong, host.id is missing on macOS, container IDs are missed on cgroup v2, Azure Functions are not detected, and S3 spans never carry cloud.region because the instrumentation does not record it.

What

  • base_converter.rb: scope name changed from instana-ruby to instana.ruby.tracer
  • resource.rb:
    • host.id is read from ioreg (IOPlatformUUID) on macOS. Linux behaviour is unchanged
    • Container ID detection also matches docker-<id>.scope, cri-containerd-, crio- and libpod- cgroup v1 paths. On cgroup v2 it falls back to /proc/self/mountinfo.
    • Azure Functions detection from FUNCTIONS_WORKER_RUNTIME and WEBSITE_SITE_NAME, setting cloud.provider=azure and cloud.platform=azure_functions. It uses environment variables only, with no metadata-service call .
  • aws_sdk_s3.rb: S3 spans now record region from context.config.region. The existing converter already maps it to the cloud.region span attribute.
  • Tests added or updated in resource_test.rb, base_converter_test.rb and aws_test.rb. Existing Linux host_id tests are pinned to Linux so they do not depend on the host OS.

@arjun-rajappa arjun-rajappa self-assigned this Nov 23, 2026
@arjun-rajappa
arjun-rajappa requested a review from a team November 23, 2026 06:31
@sonarqubecloud

Copy link
Copy Markdown

@CagriYonca CagriYonca left a comment

Copy link
Copy Markdown
Contributor

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 c8b1a35 into master Nov 24, 2026
232 checks passed
@arjun-rajappa
arjun-rajappa deleted the otlp-resource-scope-fixes branch November 24, 2026 10:42
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.

2 participants