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

Elasticsearch Log exporter "resources" are under "resources" key while it should be under the "root" #3119

Closed
ShadowMaxLeb opened this issue Nov 4, 2024 · 3 comments · Fixed by #3131
Labels
bug Something isn't working triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@ShadowMaxLeb
Copy link
Contributor

Not exactly a bug but this is to continue the work I have done here #3091

It is open to discussion but I think, like for attributes that resources should also be by default in the root object and that it would be up to the user to add different levels if necessary.

This would make sense as for instance in the resources we would put user.id which is common to all logs and that would not make sense to "manually" add it through the log attributes every time we call EmitLogRecord

@ShadowMaxLeb ShadowMaxLeb added the bug Something isn't working label Nov 4, 2024
@github-actions github-actions bot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Nov 4, 2024
@marcalff marcalff added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Nov 4, 2024
@ShadowMaxLeb
Copy link
Contributor Author

@marcalff any thoughts on this ? Should I make a PR so we can discuss it ?

@marcalff
Copy link
Member

marcalff commented Nov 7, 2024

@marcalff any thoughts on this ? Should I make a PR so we can discuss it ?

@ShadowMaxLeb,

Sorry for the delay.

Not familiar with the data format to use with the elastic search exporter, so hard to tell what exact format the exporter should produce.

Looking at the ECS doc https://www.elastic.co/guide/en/ecs/8.11/ecs-user.html
it says, in the field reuse section:

Note also that the user fields may be used directly at the root of the events.

So, this is the issue reported here (don't put fields under root/resources) if I understand correctly.

Makes sense to me.

@ShadowMaxLeb
Copy link
Contributor Author

Yes this is exactly it.

If there are resources (common to all logs) we have to let the user put them at the root.

Since nlohmann::json allows to do json["client.id"] that will end up being { "client": { "id" : "xxxx" } } this will let all users do as they like.

The only thing is that if anyone was using the exporter it will break how they were receiving logs.

ShadowMaxLeb added a commit to Shadow-Official/opentelemetry-cpp that referenced this issue Nov 8, 2024
ShadowMaxLeb added a commit to Shadow-Official/opentelemetry-cpp that referenced this issue Nov 8, 2024
ShadowMaxLeb added a commit to Shadow-Official/opentelemetry-cpp that referenced this issue Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
2 participants