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

Provide clarity on how non-string attributes are supposed to be provided through OTEL_RESOURCE_ATTRIBUTES #2857

Closed
rapphil opened this issue Oct 7, 2022 · 5 comments · Fixed by open-telemetry/opentelemetry-configuration#115
Assignees
Labels
[label deprecated] triaged-needmoreinfo [label deprecated] The issue is triaged - the OTel community needs more information to decide spec:miscellaneous For issues that don't match any other spec label

Comments

@rapphil
Copy link

rapphil commented Oct 7, 2022

What are you trying to achieve?

I'm trying to set a resource attribute that has type []string. However it is not possible to do so through the OTEL_RESOURCE_ATTRIBUTES as it only supports strings for values.

This is specially important for applications that rely on auto instrumentation in which is not possible to set the resource programmatically. (e.g. using the otel java agent)

What did you expect to see?

A clear alternative or a clear note that non-string resource attributes must be set through another mechanism other than OTEL_RESOURCE_ATTRIBUTES.

@rapphil rapphil added the spec:miscellaneous For issues that don't match any other spec label label Oct 7, 2022
@rbailey7210 rbailey7210 added the [label deprecated] triaged-needmoreinfo [label deprecated] The issue is triaged - the OTel community needs more information to decide label Oct 14, 2022
@rbailey7210
Copy link

Let's discuss in the next Spec Sig call

@carlosalberto
Copy link
Contributor

I have mixed feelings about this as there's the risk of ending up with an over engineered item for this env var. For what is worth I've been mostly users using this to set strings only. Let's talk next Tuesday about this.

@reyang
Copy link
Member

reyang commented Oct 19, 2022

A related issue in the OpenTelemetry .NET project open-telemetry/opentelemetry-dotnet#3670 (comment).

@svrnm
Copy link
Member

svrnm commented Oct 19, 2022

Since the semantic conventions also contain the types of attributes, wouldn't it be doable to do the mapping there? So if I have something like OTEL_RESOURCE_ATTRIBUTES="process.parent_pid=1234" the code reading from that environment variable takes care of the type mapping to int?

This solution of course does not provide a fix for string[], and it also does not help for attributes outside of the semantic convention, but it would not require a complex language within that environment variable that allows to set the type of a value.

@reyang
Copy link
Member

reyang commented Nov 1, 2022

FYI #2891 (comment)

codeboten pushed a commit to open-telemetry/opentelemetry-collector-contrib that referenced this issue Jan 12, 2023
…#17503)

Allow string resource attributes to be used in some resource attributes of type slice in the awsxray exporter so that it is possible to set them using the OTEL_RESOURCE_ATTRIBUTES environment variable.

This is a major source of pain among users since it is not possible to set slice resource attributes using OTEL_RESOURCE_ATTRIBUTES open-telemetry/opentelemetry-specification#2857

Signed-off-by: Raphael Silva <rapphil@gmail.com>
Co-authored-by: William Armiros <54150514+willarmiros@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[label deprecated] triaged-needmoreinfo [label deprecated] The issue is triaged - the OTel community needs more information to decide spec:miscellaneous For issues that don't match any other spec label
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants