Skip to content

Fill gaps in otel exporter implementation - #532

Merged
arjun-rajappa merged 12 commits into
masterfrom
fill-gaps-otel-exporter
Sep 29, 2026
Merged

arjun-rajappa merged 12 commits into
masterfrom
fill-gaps-otel-exporter

Conversation

@arjun-rajappa

Copy link
Copy Markdown
Contributor

Why

The OTLP exporter had several gaps relative to the OpenTelemetry semantic conventions specification: attributes used string literals instead of semconv constants, some instrumentations were missing (Kafka, ActiveJob), database system names were not normalised, and error events incorrectly propagated the span name as the exception/error type. This PR fills those gaps to produce spec-compliant OTLP payloads.

What

  • Config (lib/instana/config.rb): added three new OTLP config options — protocol (http/protobuf default), semconv_stability (stable default), and insecure (false default) — read from env vars (OTEL_EXPORTER_OTLP_PROTOCOL, OTEL_SEMCONV_STABILITY_OPT_IN, OTEL_EXPORTER_OTLP_INSECURE), YAML, and agent discovery.
  • SSL (host_agent_reporting_observer.rb): pass ssl_verify_mode: OpenSSL::SSL::VERIFY_NONE to the OTLP exporter when insecure: true.
  • HTTP converter (http_converter.rb): replaced string-literal network.protocol.* attributes with OpenTelemetry::SemConv::NETWORK constants.
  • RPC converter (rpc_converter.rb): replaced rpc.system with rpc.system.name; mapped server.port and network.peer.{address,port} correctly; added a full gRPC status code mapping (0 = OK for success spans, named code otherwise, UNKNOWN as fallback).
  • Database converter (database_converter.rb): added adapter name normalisation (e.g. mysql2 → mysql, sqlite3 → sqlite); added db.collection.name for ActiveRecord, Sequel, and MongoDB; replaced db.redis.database_index with db.namespace; replaced db.memcached.namespace with db.namespace; added db.operation.name for Redis.
  • Messaging converter (messaging_converter.rb): added Kafka support (messaging.system, destination name, operation); replaced messaging.operation with messaging.operation.name; extracted server.port from RabbitMQ address; added messaging.message.body.size and messaging.operation.name to RabbitMQ.
  • Background job converter (background_job_converter.rb): added ActiveJob support; replaced deprecated messaging.operation with messaging.operation.name.
  • AWS converter (aws_converter.rb): replaced proprietary aws.service/aws.s3.operation with RPC semconv (rpc.system.name, rpc.method); added cloud.provider and cloud.region; replaced string faas.invoked_name with OpenTelemetry::SemConv::Incubating::FAAS constant.
  • Base converter (base_converter.rb): stopped populating span name as exception.type / error.type in error events.
  • Tests: added/updated tests across config_test.rb and all affected converter test files to cover new attributes and edge cases.

…tions to OTLP configuration

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

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

Signed-off-by: Arjun Rajappa <arjun.rajappa@ibm.com>
…tion attribute to semantic conventions

Signed-off-by: Arjun Rajappa <arjun.rajappa@ibm.com>
…utes with semantic conventions

Signed-off-by: Arjun Rajappa <arjun.rajappa@ibm.com>
…odes with semantic conventions

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

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

Signed-off-by: Arjun Rajappa <arjun.rajappa@ibm.com>
@arjun-rajappa
arjun-rajappa requested a review from a team September 28, 2026 13:55
@arjun-rajappa arjun-rajappa self-assigned this Sep 28, 2026
Signed-off-by: Arjun Rajappa <arjun.rajappa@ibm.com>
…as missing

Signed-off-by: Arjun Rajappa <arjun.rajappa@ibm.com>
Replace hardcoded 'rpc.system.name' string with the
RPC_SYSTEM_ATTR shim constant so tests pass on both old
(rpc.system) and new (rpc.system.name) semconv gem versions.

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 4c71b3a into master Sep 29, 2026
230 of 231 checks passed
@arjun-rajappa
arjun-rajappa deleted the fill-gaps-otel-exporter branch September 29, 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.

2 participants