Skip to content

OTLP proto encoding methods are missing instrumentation scope schema url and attributes #4358

Open
@dbarker

Description

Describe your environment

Python version: Python 3.9.21
SDK version: 1.30.0.dev
API version: 1.30.0.dev

What happened?

Spans, metrics, and logs with instrumentation scope attributes and a schema url set are missing this data when exporting to otlp proto messages. Encoding the instrumentation scope schema url and attributes are missing from opentelemetry-exporter-otlp-proto-common

Steps to Reproduce

  1. Add a schema url and attributes when getting a meter, tracer, or logger.
  2. Create and record a span, metric, or log record
  3. Export to an otel-collector with the otlp grpc receiver and debug exporter configured

Expected Result

The instrumentation scope schema url and attributes should show up in the otel-collector debug output

Actual Result

The instrumentation scope schema url and attributes are missing

Additional context

The _encode_instrumentation_scope method is not encoding the attributes

Logs encoder is not setting the ScopeLogs.schema_url

Metrics encoder is not using the _encode_instrumentation_scope method and is not setting the ScopeMetrics.schema_url

Trace encoder doesn't set the ScopeSpans.schema_url

Would you like to implement a fix?

Yes

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions