-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
SetAttributes/AddAttributes truncate strings down to 0-length #5691
Comments
You are not supposed to create |
ah, might be pebcak then. In short, I didn't see anything to create them in https://pkg.go.dev/go.opentelemetry.io/otel/sdk/[email protected] The long version is that I'm writing an exporter for |
You should supposed to create a "log bridge" that uses https://pkg.go.dev/go.opentelemetry.io/otel/log to push logs to Related issue: open-telemetry/opentelemetry-go-contrib#5947 |
thank you, I'll have a look at this and will close the issue. |
Sorry, there is another case where creating a standalone sdklog.Record could be useful: By default, the logs are emitted with the Emit method which does not return any status, i.e., the caller does not have any feedback on whether the log has been delivered or not. There is alternative method https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp#Exporter.Export which actually takes sdklog.Record as input, so it would be useful if it were possible to construct sdklog.Record with custom attributeValueLengthLimit and pass it to the Export function. Could you please comment if this makes sense? |
Description
otel/sdk/log.SetAttributes
andotel/sdk/log.AddAttributes
(what's the difference between the two, by the way?) are essentially useless when give a string becauseRecord.attributeValueLengthLimit
default to 0 and isn't public. So all strings used as attributes are truncated down to the empty string.Environment
Steps To Reproduce
You'll see a sad
foo:
with nobar
in sightExpected behavior
Having a sensible default for the string limit and/or a way to set it would be nice
The text was updated successfully, but these errors were encountered: