Skip to content

Conversation

@LikeTheSalad
Copy link
Contributor

@LikeTheSalad LikeTheSalad commented May 23, 2025

Fixes https://github.com/elastic/opentelemetry-dev/issues/831

Adds log crash event support by adding the following attributes to the logs with the event.name attribute or eventName field value set to device.crash:

  • agent.name (as a resource attribute)
  • processor.event
  • timestamp.us
  • error.grouping_key
  • error.type

The above attributes, along with the exception.* ones that come from the OTel conventions and should already be present on these kinds of logs, are what Kibana queries to properly display mobile crash events.

NOTE: Some of the logic needed for this to work was already present for traces, such as setting the agent.name resource attribute for example. To avoid duplicating code, I moved the common tools to a "common" dir.

@LikeTheSalad
Copy link
Contributor Author

@felixbarny, @kruskall - Thank you for your first review. I've updated the PR to address your suggestions, it should be all good now. Please take another look.

@felixbarny
Copy link
Member

I didn't do a full review but the thing I commented on is resolved, thanks!

Copy link
Contributor

@gregkalapos gregkalapos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The merge&resolving conflict looks ok to me. Sorry that my PR caused this.

ErrorType = "error.type"
)

func GetTimestampUs(ts pcommon.Timestamp) int64 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this adds a dependency on collector/pdata to the elasticattr package. If downstream consumer are using this package (without any other package using collector) they will bring in the extra dependency.

Can we move this out ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. I just made the changes.

@LikeTheSalad LikeTheSalad merged commit 9050c00 into elastic:main Jul 1, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants