Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for attribute.ByteSlice to avoid invalid-UTF-8 issues in instrumentation #2314

Open
vmihailenco opened this issue Oct 21, 2021 · 4 comments
Assignees
Labels
blocked:specification Waiting on clarification of the OpenTelemetry specification before progress can be made bug Something isn't working help wanted Extra attention is needed pkg:attribute Related to the attribute package
Projects

Comments

@vmihailenco
Copy link
Contributor

AFAIK there are multiple issues here:

  1. exporter is disconnected on marshaling errors which may hurt performance and cause data loss
  2. protobuf rejects strings with invalid UTF-8
  3. OpenTelemetry does not validate strings
  4. OpenTelemetry does not support []byte and using attribute.String("foo", string(bytes)) looks harmless enough, but it very likely produces an invalid UTF-8 string

Assuming protobuf is not going to change current behavior, OpenTelemetry probably should have some answer to this. At least, dropping the problematic span instead of disconnecting.

PS go2sky seem to have this problem too.

@vmihailenco vmihailenco added the bug Something isn't working label Oct 21, 2021
@MrAlias MrAlias added this to Needs triage in Bugs via automation Dec 6, 2021
@MrAlias MrAlias moved this from Needs triage to Low priority in Bugs Dec 6, 2021
@MrAlias
Copy link
Contributor

MrAlias commented May 3, 2022

The otlp supports a byte value:

https://github.com/open-telemetry/opentelemetry-proto-go/blob/139c123be3af14819da93c7c5225d4a56afd1f2f/otlp/common/v1/common.pb.go#L37-L57

A possible solution could be to add a ByteSlice value to the attributes package. The compatibility of this would need be investigated further though.

@jmacd
Copy link
Contributor

jmacd commented Sep 9, 2022

This is a near-duplicate of #3021. Adjusting the title.

@jmacd jmacd changed the title traces exporter is disconnected from the server otlp.uptrace.dev:4317: rpc error: code = Internal desc = grpc: error while marshaling: string field contains invalid UTF-8 Support for attribute.ByteSlice to avoid invalid-UTF-8 issues in instrumentation Sep 9, 2022
@MrAlias MrAlias added the pkg:attribute Related to the attribute package label Oct 20, 2022
@brendenehlers
Copy link

Would anyone be opposed to me picking up this issue?

@pellared
Copy link
Member

@pellared pellared added the blocked:specification Waiting on clarification of the OpenTelemetry specification before progress can be made label Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked:specification Waiting on clarification of the OpenTelemetry specification before progress can be made bug Something isn't working help wanted Extra attention is needed pkg:attribute Related to the attribute package
Projects
Status: Low priority
Bugs
  
Low priority
Development

Successfully merging a pull request may close this issue.

5 participants