From 744c0e867ef65d3c4f6f500b5f7ff9b0ddbea70e Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Fri, 16 May 2025 14:40:35 +0200 Subject: [PATCH 01/67] Traversing logs --- enrichments/log/mobile_crash.go | 19 +++++++++++++++++++ enrichments/log/mobile_crash_test.go | 1 + 2 files changed, 20 insertions(+) create mode 100644 enrichments/log/mobile_crash.go create mode 100644 enrichments/log/mobile_crash_test.go diff --git a/enrichments/log/mobile_crash.go b/enrichments/log/mobile_crash.go new file mode 100644 index 0000000..e1e73de --- /dev/null +++ b/enrichments/log/mobile_crash.go @@ -0,0 +1,19 @@ +package log + +import "go.opentelemetry.io/collector/pdata/plog" + +type Enricher struct { +} + +func (e *Enricher) Enrich(logs plog.Logs) { + resourceLogs := logs.ResourceLogs() + for i := 0; i < resourceLogs.Len(); i++ { + scopeLogs := resourceLogs.At(i).ScopeLogs() + for j := 0; j < scopeLogs.Len(); j++ { + logRecords := scopeLogs.At(j).LogRecords() + for k := 0; k < logRecords.Len(); k++ { + // todo + } + } + } +} diff --git a/enrichments/log/mobile_crash_test.go b/enrichments/log/mobile_crash_test.go new file mode 100644 index 0000000..7330d54 --- /dev/null +++ b/enrichments/log/mobile_crash_test.go @@ -0,0 +1 @@ +package log From 6214e37199925f19721d6e1cba792ae550df1220 Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Fri, 16 May 2025 14:49:33 +0200 Subject: [PATCH 02/67] Renaming files --- enrichments/log/{mobile_crash.go => mobile/crash.go} | 0 enrichments/log/{mobile_crash_test.go => mobile/crash_test.go} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename enrichments/log/{mobile_crash.go => mobile/crash.go} (100%) rename enrichments/log/{mobile_crash_test.go => mobile/crash_test.go} (100%) diff --git a/enrichments/log/mobile_crash.go b/enrichments/log/mobile/crash.go similarity index 100% rename from enrichments/log/mobile_crash.go rename to enrichments/log/mobile/crash.go diff --git a/enrichments/log/mobile_crash_test.go b/enrichments/log/mobile/crash_test.go similarity index 100% rename from enrichments/log/mobile_crash_test.go rename to enrichments/log/mobile/crash_test.go From 057d1d783b050428be43dc64670b5500bc8edf09 Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Fri, 16 May 2025 15:03:48 +0200 Subject: [PATCH 03/67] Changing package name --- enrichments/log/mobile/crash.go | 2 +- enrichments/log/mobile/crash_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/enrichments/log/mobile/crash.go b/enrichments/log/mobile/crash.go index e1e73de..176f859 100644 --- a/enrichments/log/mobile/crash.go +++ b/enrichments/log/mobile/crash.go @@ -1,4 +1,4 @@ -package log +package mobile import "go.opentelemetry.io/collector/pdata/plog" diff --git a/enrichments/log/mobile/crash_test.go b/enrichments/log/mobile/crash_test.go index 7330d54..a32f75c 100644 --- a/enrichments/log/mobile/crash_test.go +++ b/enrichments/log/mobile/crash_test.go @@ -1 +1 @@ -package log +package mobile From c575f8e9efc1f075d9e343010ad9083179f7b990 Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Fri, 16 May 2025 15:10:04 +0200 Subject: [PATCH 04/67] Reorganizing files --- enrichments/{log/mobile/crash.go => logs/logs.go} | 9 ++++++--- enrichments/logs/mobile/crash.go | 6 ++++++ enrichments/{log => logs}/mobile/crash_test.go | 0 3 files changed, 12 insertions(+), 3 deletions(-) rename enrichments/{log/mobile/crash.go => logs/logs.go} (66%) create mode 100644 enrichments/logs/mobile/crash.go rename enrichments/{log => logs}/mobile/crash_test.go (100%) diff --git a/enrichments/log/mobile/crash.go b/enrichments/logs/logs.go similarity index 66% rename from enrichments/log/mobile/crash.go rename to enrichments/logs/logs.go index 176f859..f779ded 100644 --- a/enrichments/log/mobile/crash.go +++ b/enrichments/logs/logs.go @@ -1,6 +1,9 @@ -package mobile +package log -import "go.opentelemetry.io/collector/pdata/plog" +import ( + "github.com/elastic/opentelemetry-lib/enrichments/logs/mobile" + "go.opentelemetry.io/collector/pdata/plog" +) type Enricher struct { } @@ -12,7 +15,7 @@ func (e *Enricher) Enrich(logs plog.Logs) { for j := 0; j < scopeLogs.Len(); j++ { logRecords := scopeLogs.At(j).LogRecords() for k := 0; k < logRecords.Len(); k++ { - // todo + mobile.EnrichLogRecord(logRecords.At(k)) } } } diff --git a/enrichments/logs/mobile/crash.go b/enrichments/logs/mobile/crash.go new file mode 100644 index 0000000..a375170 --- /dev/null +++ b/enrichments/logs/mobile/crash.go @@ -0,0 +1,6 @@ +package mobile + +import "go.opentelemetry.io/collector/pdata/plog" + +func EnrichLogRecord(logs plog.LogRecord) { +} diff --git a/enrichments/log/mobile/crash_test.go b/enrichments/logs/mobile/crash_test.go similarity index 100% rename from enrichments/log/mobile/crash_test.go rename to enrichments/logs/mobile/crash_test.go From b6a6649f3b4728b370ecf29180219c4d22af70d2 Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Fri, 16 May 2025 15:17:55 +0200 Subject: [PATCH 05/67] Reorganizing files --- enrichments/logs/logs.go | 2 +- enrichments/logs/mobile/{crash.go => event.go} | 2 +- enrichments/logs/mobile/{crash_test.go => event_test.go} | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename enrichments/logs/mobile/{crash.go => event.go} (61%) rename enrichments/logs/mobile/{crash_test.go => event_test.go} (100%) diff --git a/enrichments/logs/logs.go b/enrichments/logs/logs.go index f779ded..96bb76f 100644 --- a/enrichments/logs/logs.go +++ b/enrichments/logs/logs.go @@ -15,7 +15,7 @@ func (e *Enricher) Enrich(logs plog.Logs) { for j := 0; j < scopeLogs.Len(); j++ { logRecords := scopeLogs.At(j).LogRecords() for k := 0; k < logRecords.Len(); k++ { - mobile.EnrichLogRecord(logRecords.At(k)) + mobile.EnrichLogEvent(logRecords.At(k)) } } } diff --git a/enrichments/logs/mobile/crash.go b/enrichments/logs/mobile/event.go similarity index 61% rename from enrichments/logs/mobile/crash.go rename to enrichments/logs/mobile/event.go index a375170..3894e4a 100644 --- a/enrichments/logs/mobile/crash.go +++ b/enrichments/logs/mobile/event.go @@ -2,5 +2,5 @@ package mobile import "go.opentelemetry.io/collector/pdata/plog" -func EnrichLogRecord(logs plog.LogRecord) { +func EnrichLogEvent(logs plog.LogRecord) { } diff --git a/enrichments/logs/mobile/crash_test.go b/enrichments/logs/mobile/event_test.go similarity index 100% rename from enrichments/logs/mobile/crash_test.go rename to enrichments/logs/mobile/event_test.go From a0e35470b658e1bb4868dc87e54706b07694dfa4 Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Fri, 16 May 2025 15:46:22 +0200 Subject: [PATCH 06/67] Adding test case for crash events --- enrichments/logs/mobile/event.go | 2 +- enrichments/logs/mobile/event_test.go | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/enrichments/logs/mobile/event.go b/enrichments/logs/mobile/event.go index 3894e4a..dfce08a 100644 --- a/enrichments/logs/mobile/event.go +++ b/enrichments/logs/mobile/event.go @@ -2,5 +2,5 @@ package mobile import "go.opentelemetry.io/collector/pdata/plog" -func EnrichLogEvent(logs plog.LogRecord) { +func EnrichLogEvent(logRecord plog.LogRecord) { } diff --git a/enrichments/logs/mobile/event_test.go b/enrichments/logs/mobile/event_test.go index a32f75c..6d01e20 100644 --- a/enrichments/logs/mobile/event_test.go +++ b/enrichments/logs/mobile/event_test.go @@ -1 +1,26 @@ package mobile + +import ( + "testing" + + "github.com/google/go-cmp/cmp" + "github.com/stretchr/testify/assert" + "go.opentelemetry.io/collector/pdata/plog" +) + +func TestEnrichCrashEvents(t *testing.T) { + logRecord := plog.NewLogRecord() + logRecord.Attributes().PutStr("event.name", "device.crash") + logRecord.Attributes().PutStr("exception.message", "Exception message") + logRecord.Attributes().PutStr("exception.type", "java.lang.RuntimeException") + logRecord.Attributes().PutStr("exception.stacktrace", `Exception in thread "main" java.lang.RuntimeException: Test exception\\n at com.example.GenerateTrace.methodB(GenerateTrace.java:13)\\n at com.example.GenerateTrace.methodA(GenerateTrace.java:9)\\n at com.example.GenerateTrace.main(GenerateTrace.java:5)`) + + EnrichLogEvent(logRecord) + + expectedLogRecord := plog.NewLogRecord() + logRecord.CopyTo(expectedLogRecord) + + expectedLogRecord.Attributes().PutStr("processor.event", "error") + + assert.Empty(t, cmp.Diff(logRecord.Attributes().AsRaw(), expectedLogRecord.Attributes().AsRaw())) +} From 66c8f693864f1a3ed0c02662287816d04055e7e0 Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Fri, 16 May 2025 16:15:57 +0200 Subject: [PATCH 07/67] Making mobile enricher internal --- enrichments/logs/{ => internal}/mobile/event.go | 1 + enrichments/logs/{ => internal}/mobile/event_test.go | 0 enrichments/logs/logs.go | 2 +- 3 files changed, 2 insertions(+), 1 deletion(-) rename enrichments/logs/{ => internal}/mobile/event.go (66%) rename enrichments/logs/{ => internal}/mobile/event_test.go (100%) diff --git a/enrichments/logs/mobile/event.go b/enrichments/logs/internal/mobile/event.go similarity index 66% rename from enrichments/logs/mobile/event.go rename to enrichments/logs/internal/mobile/event.go index dfce08a..1c53015 100644 --- a/enrichments/logs/mobile/event.go +++ b/enrichments/logs/internal/mobile/event.go @@ -3,4 +3,5 @@ package mobile import "go.opentelemetry.io/collector/pdata/plog" func EnrichLogEvent(logRecord plog.LogRecord) { + logRecord.Attributes().PutStr("processor.event", "error") } diff --git a/enrichments/logs/mobile/event_test.go b/enrichments/logs/internal/mobile/event_test.go similarity index 100% rename from enrichments/logs/mobile/event_test.go rename to enrichments/logs/internal/mobile/event_test.go diff --git a/enrichments/logs/logs.go b/enrichments/logs/logs.go index 96bb76f..434fddc 100644 --- a/enrichments/logs/logs.go +++ b/enrichments/logs/logs.go @@ -1,7 +1,7 @@ package log import ( - "github.com/elastic/opentelemetry-lib/enrichments/logs/mobile" + "github.com/elastic/opentelemetry-lib/enrichments/logs/internal/mobile" "go.opentelemetry.io/collector/pdata/plog" ) From 0d4ca93c7839fdbdefadf6a13b86ac878b842a93 Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Fri, 16 May 2025 16:48:59 +0200 Subject: [PATCH 08/67] Moving resource enricher --- .../{trace/internal/elastic => common/resource}/resource.go | 2 +- .../internal/elastic => common/resource}/resource_test.go | 2 +- enrichments/trace/trace.go | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) rename enrichments/{trace/internal/elastic => common/resource}/resource.go (99%) rename enrichments/{trace/internal/elastic => common/resource}/resource_test.go (99%) diff --git a/enrichments/trace/internal/elastic/resource.go b/enrichments/common/resource/resource.go similarity index 99% rename from enrichments/trace/internal/elastic/resource.go rename to enrichments/common/resource/resource.go index 964cd14..d75a2ac 100644 --- a/enrichments/trace/internal/elastic/resource.go +++ b/enrichments/common/resource/resource.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. -package elastic +package resource import ( "fmt" diff --git a/enrichments/trace/internal/elastic/resource_test.go b/enrichments/common/resource/resource_test.go similarity index 99% rename from enrichments/trace/internal/elastic/resource_test.go rename to enrichments/common/resource/resource_test.go index 2adcaf1..e21aea8 100644 --- a/enrichments/trace/internal/elastic/resource_test.go +++ b/enrichments/common/resource/resource_test.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. -package elastic +package resource import ( "testing" diff --git a/enrichments/trace/trace.go b/enrichments/trace/trace.go index af0e858..bc73cad 100644 --- a/enrichments/trace/trace.go +++ b/enrichments/trace/trace.go @@ -18,6 +18,7 @@ package trace import ( + "github.com/elastic/opentelemetry-lib/enrichments/common/resource" "github.com/elastic/opentelemetry-lib/enrichments/trace/config" "github.com/elastic/opentelemetry-lib/enrichments/trace/internal/elastic" "github.com/ua-parser/uap-go/uaparser" @@ -50,7 +51,7 @@ func (e *Enricher) Enrich(pt ptrace.Traces) { resSpans := pt.ResourceSpans() for i := 0; i < resSpans.Len(); i++ { resSpan := resSpans.At(i) - elastic.EnrichResource(resSpan.Resource(), e.Config) + resource.EnrichResource(resSpan.Resource(), e.Config) scopeSpans := resSpan.ScopeSpans() for j := 0; j < scopeSpans.Len(); j++ { scopeSpan := scopeSpans.At(j) From 5e4bff58059f54a212711c99f530b355697724a7 Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Fri, 16 May 2025 16:59:03 +0200 Subject: [PATCH 09/67] Passing resource config to resource enrichment --- enrichments/common/resource/resource.go | 4 ++-- enrichments/common/resource/resource_test.go | 4 +--- enrichments/trace/trace.go | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/enrichments/common/resource/resource.go b/enrichments/common/resource/resource.go index d75a2ac..aaf5cd2 100644 --- a/enrichments/common/resource/resource.go +++ b/enrichments/common/resource/resource.go @@ -28,9 +28,9 @@ import ( ) // EnrichResource derives and adds Elastic specific resource attributes. -func EnrichResource(resource pcommon.Resource, cfg config.Config) { +func EnrichResource(resource pcommon.Resource, cfg config.ResourceConfig) { var c resourceEnrichmentContext - c.Enrich(resource, cfg.Resource) + c.Enrich(resource, cfg) } type resourceEnrichmentContext struct { diff --git a/enrichments/common/resource/resource_test.go b/enrichments/common/resource/resource_test.go index e21aea8..ee853aa 100644 --- a/enrichments/common/resource/resource_test.go +++ b/enrichments/common/resource/resource_test.go @@ -254,9 +254,7 @@ func TestResourceEnrich(t *testing.T) { expectedAttrs[k] = v } - EnrichResource(tc.input, config.Config{ - Resource: tc.config, - }) + EnrichResource(tc.input, tc.config) assert.Empty(t, cmp.Diff(expectedAttrs, tc.input.Attributes().AsRaw())) }) diff --git a/enrichments/trace/trace.go b/enrichments/trace/trace.go index bc73cad..2be6f15 100644 --- a/enrichments/trace/trace.go +++ b/enrichments/trace/trace.go @@ -51,7 +51,7 @@ func (e *Enricher) Enrich(pt ptrace.Traces) { resSpans := pt.ResourceSpans() for i := 0; i < resSpans.Len(); i++ { resSpan := resSpans.At(i) - resource.EnrichResource(resSpan.Resource(), e.Config) + resource.EnrichResource(resSpan.Resource(), e.Config.Resource) scopeSpans := resSpan.ScopeSpans() for j := 0; j < scopeSpans.Len(); j++ { scopeSpan := scopeSpans.At(j) From dcbbd09de1ebf3fe9a7980b9824f5accb4de9e14 Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Fri, 16 May 2025 17:01:11 +0200 Subject: [PATCH 10/67] Enriching log resources --- enrichments/logs/logs.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/enrichments/logs/logs.go b/enrichments/logs/logs.go index 434fddc..3066abb 100644 --- a/enrichments/logs/logs.go +++ b/enrichments/logs/logs.go @@ -1,7 +1,9 @@ package log import ( + "github.com/elastic/opentelemetry-lib/enrichments/common/resource" "github.com/elastic/opentelemetry-lib/enrichments/logs/internal/mobile" + "github.com/elastic/opentelemetry-lib/enrichments/trace/config" "go.opentelemetry.io/collector/pdata/plog" ) @@ -10,8 +12,16 @@ type Enricher struct { func (e *Enricher) Enrich(logs plog.Logs) { resourceLogs := logs.ResourceLogs() + resourceConfig := config.ResourceConfig{ + AgentName: config.AttributeConfig{ + Enabled: false, + }, + } + for i := 0; i < resourceLogs.Len(); i++ { - scopeLogs := resourceLogs.At(i).ScopeLogs() + resourceLog := resourceLogs.At(i) + resource.EnrichResource(resourceLog.Resource(), resourceConfig) + scopeLogs := resourceLog.ScopeLogs() for j := 0; j < scopeLogs.Len(); j++ { logRecords := scopeLogs.At(j).LogRecords() for k := 0; k < logRecords.Len(); k++ { From 9afe9b366404da681f16e215ae5f57c2afb106a9 Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Fri, 16 May 2025 17:23:33 +0200 Subject: [PATCH 11/67] Extracting attribute config to an independent package to get reused --- enrichments/common/attribute/config.go | 6 + enrichments/common/resource/config.go | 20 +++ enrichments/common/resource/config_test.go | 42 +++++ enrichments/common/resource/resource.go | 5 +- enrichments/common/resource/resource_test.go | 31 ++-- enrichments/trace/config/config.go | 163 +++++++++---------- enrichments/trace/config/config_test.go | 3 +- 7 files changed, 162 insertions(+), 108 deletions(-) create mode 100644 enrichments/common/attribute/config.go create mode 100644 enrichments/common/resource/config.go create mode 100644 enrichments/common/resource/config_test.go diff --git a/enrichments/common/attribute/config.go b/enrichments/common/attribute/config.go new file mode 100644 index 0000000..d5d2c78 --- /dev/null +++ b/enrichments/common/attribute/config.go @@ -0,0 +1,6 @@ +package attribute + +// AttributeConfig is the configuration options for each attribute. +type AttributeConfig struct { + Enabled bool `mapstructure:"enabled"` +} diff --git a/enrichments/common/resource/config.go b/enrichments/common/resource/config.go new file mode 100644 index 0000000..7e5c29e --- /dev/null +++ b/enrichments/common/resource/config.go @@ -0,0 +1,20 @@ +package resource + +import "github.com/elastic/opentelemetry-lib/enrichments/common/attribute" + +// ResourceConfig configures the enrichment of resource attributes. +type ResourceConfig struct { + AgentName attribute.AttributeConfig `mapstructure:"agent_name"` + AgentVersion attribute.AttributeConfig `mapstructure:"agent_version"` + OverrideHostName attribute.AttributeConfig `mapstructure:"override_host_name"` + DeploymentEnvironment attribute.AttributeConfig `mapstructure:"deployment_environment"` +} + +func EnabledConfig() ResourceConfig { + return ResourceConfig{ + AgentName: attribute.AttributeConfig{Enabled: true}, + AgentVersion: attribute.AttributeConfig{Enabled: true}, + OverrideHostName: attribute.AttributeConfig{Enabled: true}, + DeploymentEnvironment: attribute.AttributeConfig{Enabled: true}, + } +} diff --git a/enrichments/common/resource/config_test.go b/enrichments/common/resource/config_test.go new file mode 100644 index 0000000..29a3c94 --- /dev/null +++ b/enrichments/common/resource/config_test.go @@ -0,0 +1,42 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package resource + +import ( + "reflect" + "testing" + + "github.com/elastic/opentelemetry-lib/enrichments/common/attribute" + "github.com/stretchr/testify/require" +) + +func TestEnabled(t *testing.T) { + config := EnabledConfig() + assertAllEnabled(t, reflect.ValueOf(config)) +} + +func assertAllEnabled(t *testing.T, cfg reflect.Value) { + t.Helper() + + for i := 0; i < cfg.NumField(); i++ { + rAttrCfg := cfg.Field(i).Interface() + attrCfg, ok := rAttrCfg.(attribute.AttributeConfig) + require.True(t, ok, "must be a type of AttributeConfig") + require.True(t, attrCfg.Enabled, "must be enabled") + } +} diff --git a/enrichments/common/resource/resource.go b/enrichments/common/resource/resource.go index aaf5cd2..3b6413a 100644 --- a/enrichments/common/resource/resource.go +++ b/enrichments/common/resource/resource.go @@ -21,14 +21,13 @@ import ( "fmt" "github.com/elastic/opentelemetry-lib/elasticattr" - "github.com/elastic/opentelemetry-lib/enrichments/trace/config" "go.opentelemetry.io/collector/pdata/pcommon" semconv25 "go.opentelemetry.io/collector/semconv/v1.25.0" semconv "go.opentelemetry.io/collector/semconv/v1.27.0" ) // EnrichResource derives and adds Elastic specific resource attributes. -func EnrichResource(resource pcommon.Resource, cfg config.ResourceConfig) { +func EnrichResource(resource pcommon.Resource, cfg ResourceConfig) { var c resourceEnrichmentContext c.Enrich(resource, cfg) } @@ -47,7 +46,7 @@ type resourceEnrichmentContext struct { deploymentEnvironmentName string } -func (s *resourceEnrichmentContext) Enrich(resource pcommon.Resource, cfg config.ResourceConfig) { +func (s *resourceEnrichmentContext) Enrich(resource pcommon.Resource, cfg ResourceConfig) { resource.Attributes().Range(func(k string, v pcommon.Value) bool { switch k { case semconv.AttributeHostName: diff --git a/enrichments/common/resource/resource_test.go b/enrichments/common/resource/resource_test.go index ee853aa..9789bc2 100644 --- a/enrichments/common/resource/resource_test.go +++ b/enrichments/common/resource/resource_test.go @@ -21,7 +21,6 @@ import ( "testing" "github.com/elastic/opentelemetry-lib/elasticattr" - "github.com/elastic/opentelemetry-lib/enrichments/trace/config" "github.com/google/go-cmp/cmp" "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/pdata/pcommon" @@ -33,7 +32,7 @@ func TestResourceEnrich(t *testing.T) { for _, tc := range []struct { name string input pcommon.Resource - config config.ResourceConfig + config ResourceConfig enrichedAttrs map[string]any }{ { @@ -44,7 +43,7 @@ func TestResourceEnrich(t *testing.T) { { name: "empty", input: pcommon.NewResource(), - config: config.Enabled().Resource, + config: EnabledConfig(), enrichedAttrs: map[string]any{ elasticattr.AgentName: "otlp", elasticattr.AgentVersion: "unknown", @@ -57,7 +56,7 @@ func TestResourceEnrich(t *testing.T) { res.Attributes().PutStr(semconv.AttributeTelemetrySDKName, "customflavor") return res }(), - config: config.Enabled().Resource, + config: EnabledConfig(), enrichedAttrs: map[string]any{ elasticattr.AgentName: "customflavor", elasticattr.AgentVersion: "unknown", @@ -71,7 +70,7 @@ func TestResourceEnrich(t *testing.T) { res.Attributes().PutStr(semconv.AttributeTelemetryDistroName, "elastic") return res }(), - config: config.Enabled().Resource, + config: EnabledConfig(), enrichedAttrs: map[string]any{ elasticattr.AgentName: "customflavor/unknown/elastic", elasticattr.AgentVersion: "unknown", @@ -86,7 +85,7 @@ func TestResourceEnrich(t *testing.T) { res.Attributes().PutStr(semconv.AttributeTelemetryDistroName, "elastic") return res }(), - config: config.Enabled().Resource, + config: EnabledConfig(), enrichedAttrs: map[string]any{ elasticattr.AgentName: "customflavor/cpp/elastic", elasticattr.AgentVersion: "unknown", @@ -99,7 +98,7 @@ func TestResourceEnrich(t *testing.T) { res.Attributes().PutStr(semconv.AttributeTelemetrySDKLanguage, "cpp") return res }(), - config: config.Enabled().Resource, + config: EnabledConfig(), enrichedAttrs: map[string]any{ elasticattr.AgentName: "otlp/cpp", elasticattr.AgentVersion: "unknown", @@ -113,7 +112,7 @@ func TestResourceEnrich(t *testing.T) { res.Attributes().PutStr(semconv.AttributeTelemetrySDKLanguage, "cpp") return res }(), - config: config.Enabled().Resource, + config: EnabledConfig(), enrichedAttrs: map[string]any{ elasticattr.AgentName: "customflavor/cpp", elasticattr.AgentVersion: "unknown", @@ -127,7 +126,7 @@ func TestResourceEnrich(t *testing.T) { res.Attributes().PutStr(semconv.AttributeTelemetrySDKVersion, "9.999.9") return res }(), - config: config.Enabled().Resource, + config: EnabledConfig(), enrichedAttrs: map[string]any{ elasticattr.AgentName: "customflavor", elasticattr.AgentVersion: "9.999.9", @@ -142,7 +141,7 @@ func TestResourceEnrich(t *testing.T) { res.Attributes().PutStr(semconv.AttributeTelemetryDistroName, "elastic") return res }(), - config: config.Enabled().Resource, + config: EnabledConfig(), enrichedAttrs: map[string]any{ elasticattr.AgentName: "customflavor/unknown/elastic", elasticattr.AgentVersion: "unknown", @@ -158,7 +157,7 @@ func TestResourceEnrich(t *testing.T) { res.Attributes().PutStr(semconv.AttributeTelemetryDistroVersion, "1.2.3") return res }(), - config: config.Enabled().Resource, + config: EnabledConfig(), enrichedAttrs: map[string]any{ elasticattr.AgentName: "customflavor/unknown/elastic", elasticattr.AgentVersion: "1.2.3", @@ -172,7 +171,7 @@ func TestResourceEnrich(t *testing.T) { res.Attributes().PutStr(semconv.AttributeK8SNodeName, "k8s-node") return res }(), - config: config.Enabled().Resource, + config: EnabledConfig(), enrichedAttrs: map[string]any{ semconv.AttributeHostName: "k8s-node", semconv.AttributeK8SNodeName: "k8s-node", @@ -187,7 +186,7 @@ func TestResourceEnrich(t *testing.T) { res.Attributes().PutStr(semconv.AttributeK8SNodeName, "k8s-node") return res }(), - config: config.Enabled().Resource, + config: EnabledConfig(), enrichedAttrs: map[string]any{ semconv.AttributeHostName: "k8s-node", semconv.AttributeK8SNodeName: "k8s-node", @@ -203,7 +202,7 @@ func TestResourceEnrich(t *testing.T) { res.Attributes().PutStr(semconv25.AttributeDeploymentEnvironment, "prod") return res }(), - config: config.Enabled().Resource, + config: EnabledConfig(), enrichedAttrs: map[string]any{ semconv25.AttributeDeploymentEnvironment: "prod", elasticattr.AgentName: "otlp", @@ -218,7 +217,7 @@ func TestResourceEnrich(t *testing.T) { res.Attributes().PutStr(semconv.AttributeDeploymentEnvironmentName, "prod") return res }(), - config: config.Enabled().Resource, + config: EnabledConfig(), enrichedAttrs: map[string]any{ // To satisfy aliases defined in ES, we duplicate the value for both fields. semconv25.AttributeDeploymentEnvironment: "prod", @@ -236,7 +235,7 @@ func TestResourceEnrich(t *testing.T) { res.Attributes().PutStr(semconv25.AttributeDeploymentEnvironment, "test") return res }(), - config: config.Enabled().Resource, + config: EnabledConfig(), enrichedAttrs: map[string]any{ // If both are set, we don't touch those values and take them as they are. semconv25.AttributeDeploymentEnvironment: "test", diff --git a/enrichments/trace/config/config.go b/enrichments/trace/config/config.go index 50f4a3c..119e9b4 100644 --- a/enrichments/trace/config/config.go +++ b/enrichments/trace/config/config.go @@ -17,27 +17,24 @@ package config +import ( + "github.com/elastic/opentelemetry-lib/enrichments/common/attribute" + "github.com/elastic/opentelemetry-lib/enrichments/common/resource" +) + // Config configures the enrichment attributes produced. type Config struct { - Resource ResourceConfig `mapstructure:"resource"` + Resource resource.ResourceConfig `mapstructure:"resource"` Scope ScopeConfig `mapstructure:"scope"` Transaction ElasticTransactionConfig `mapstructure:"elastic_transaction"` Span ElasticSpanConfig `mapstructure:"elastic_span"` SpanEvent SpanEventConfig `mapstructure:"span_event"` } -// ResourceConfig configures the enrichment of resource attributes. -type ResourceConfig struct { - AgentName AttributeConfig `mapstructure:"agent_name"` - AgentVersion AttributeConfig `mapstructure:"agent_version"` - OverrideHostName AttributeConfig `mapstructure:"override_host_name"` - DeploymentEnvironment AttributeConfig `mapstructure:"deployment_environment"` -} - // ScopeConfig configures the enrichment of scope attributes. type ScopeConfig struct { - ServiceFrameworkName AttributeConfig `mapstructure:"service_framework_name"` - ServiceFrameworkVersion AttributeConfig `mapstructure:"service_framework_version"` + ServiceFrameworkName attribute.AttributeConfig `mapstructure:"service_framework_name"` + ServiceFrameworkVersion attribute.AttributeConfig `mapstructure:"service_framework_version"` } // ElasticTransactionConfig configures the enrichment attributes for the @@ -46,19 +43,19 @@ type ElasticTransactionConfig struct { // TimestampUs is a temporary attribute to enable higher // resolution timestamps in Elasticsearch. For more details see: // https://github.com/elastic/opentelemetry-dev/issues/374. - TimestampUs AttributeConfig `mapstructure:"timestamp_us"` - Sampled AttributeConfig `mapstructure:"sampled"` - ID AttributeConfig `mapstructure:"id"` - Root AttributeConfig `mapstructure:"root"` - Name AttributeConfig `mapstructure:"name"` - ProcessorEvent AttributeConfig `mapstructure:"processor_event"` - RepresentativeCount AttributeConfig `mapstructure:"representative_count"` - DurationUs AttributeConfig `mapstructure:"duration_us"` - Type AttributeConfig `mapstructure:"type"` - Result AttributeConfig `mapstructure:"result"` - EventOutcome AttributeConfig `mapstructure:"event_outcome"` - InferredSpans AttributeConfig `mapstructure:"inferred_spans"` - UserAgent AttributeConfig `mapstructure:"user_agent"` + TimestampUs attribute.AttributeConfig `mapstructure:"timestamp_us"` + Sampled attribute.AttributeConfig `mapstructure:"sampled"` + ID attribute.AttributeConfig `mapstructure:"id"` + Root attribute.AttributeConfig `mapstructure:"root"` + Name attribute.AttributeConfig `mapstructure:"name"` + ProcessorEvent attribute.AttributeConfig `mapstructure:"processor_event"` + RepresentativeCount attribute.AttributeConfig `mapstructure:"representative_count"` + DurationUs attribute.AttributeConfig `mapstructure:"duration_us"` + Type attribute.AttributeConfig `mapstructure:"type"` + Result attribute.AttributeConfig `mapstructure:"result"` + EventOutcome attribute.AttributeConfig `mapstructure:"event_outcome"` + InferredSpans attribute.AttributeConfig `mapstructure:"inferred_spans"` + UserAgent attribute.AttributeConfig `mapstructure:"user_agent"` } // ElasticSpanConfig configures the enrichment attributes for the spans @@ -67,17 +64,17 @@ type ElasticSpanConfig struct { // TimestampUs is a temporary attribute to enable higher // resolution timestamps in Elasticsearch. For more details see: // https://github.com/elastic/opentelemetry-dev/issues/374. - TimestampUs AttributeConfig `mapstructure:"timestamp_us"` - Name AttributeConfig `mapstructure:"name"` - ProcessorEvent AttributeConfig `mapstructure:"processor_event"` - RepresentativeCount AttributeConfig `mapstructure:"representative_count"` - TypeSubtype AttributeConfig `mapstructure:"type_subtype"` - DurationUs AttributeConfig `mapstructure:"duration_us"` - EventOutcome AttributeConfig `mapstructure:"event_outcome"` - ServiceTarget AttributeConfig `mapstructure:"service_target"` - DestinationService AttributeConfig `mapstructure:"destination_service"` - InferredSpans AttributeConfig `mapstructure:"inferred_spans"` - UserAgent AttributeConfig `mapstructure:"user_agent"` + TimestampUs attribute.AttributeConfig `mapstructure:"timestamp_us"` + Name attribute.AttributeConfig `mapstructure:"name"` + ProcessorEvent attribute.AttributeConfig `mapstructure:"processor_event"` + RepresentativeCount attribute.AttributeConfig `mapstructure:"representative_count"` + TypeSubtype attribute.AttributeConfig `mapstructure:"type_subtype"` + DurationUs attribute.AttributeConfig `mapstructure:"duration_us"` + EventOutcome attribute.AttributeConfig `mapstructure:"event_outcome"` + ServiceTarget attribute.AttributeConfig `mapstructure:"service_target"` + DestinationService attribute.AttributeConfig `mapstructure:"destination_service"` + InferredSpans attribute.AttributeConfig `mapstructure:"inferred_spans"` + UserAgent attribute.AttributeConfig `mapstructure:"user_agent"` } // SpanEventConfig configures enrichment attributes for the span events. @@ -85,73 +82,63 @@ type SpanEventConfig struct { // TimestampUs is a temporary attribute to enable higher // resolution timestamps in Elasticsearch. For more details see: // https://github.com/elastic/opentelemetry-dev/issues/374. - TimestampUs AttributeConfig `mapstructure:"timestamp_us"` - TransactionSampled AttributeConfig `mapstructure:"transaction_sampled"` - TransactionType AttributeConfig `mapstructure:"transaction_type"` - ProcessorEvent AttributeConfig `mapstructure:"processor_event"` + TimestampUs attribute.AttributeConfig `mapstructure:"timestamp_us"` + TransactionSampled attribute.AttributeConfig `mapstructure:"transaction_sampled"` + TransactionType attribute.AttributeConfig `mapstructure:"transaction_type"` + ProcessorEvent attribute.AttributeConfig `mapstructure:"processor_event"` // For exceptions/errors - ErrorID AttributeConfig `mapstructure:"error_id"` - ErrorExceptionHandled AttributeConfig `mapstructure:"error_exception_handled"` - ErrorGroupingKey AttributeConfig `mapstructure:"error_grouping_key"` - ErrorGroupingName AttributeConfig `mapstructure:"error_grouping_name"` -} - -// AttributeConfig is the configuration options for each attribute. -type AttributeConfig struct { - Enabled bool `mapstructure:"enabled"` + ErrorID attribute.AttributeConfig `mapstructure:"error_id"` + ErrorExceptionHandled attribute.AttributeConfig `mapstructure:"error_exception_handled"` + ErrorGroupingKey attribute.AttributeConfig `mapstructure:"error_grouping_key"` + ErrorGroupingName attribute.AttributeConfig `mapstructure:"error_grouping_name"` } // Enabled returns a config with all default enrichments enabled. func Enabled() Config { return Config{ - Resource: ResourceConfig{ - AgentName: AttributeConfig{Enabled: true}, - AgentVersion: AttributeConfig{Enabled: true}, - OverrideHostName: AttributeConfig{Enabled: true}, - DeploymentEnvironment: AttributeConfig{Enabled: true}, - }, + Resource: resource.EnabledConfig(), Scope: ScopeConfig{ - ServiceFrameworkName: AttributeConfig{Enabled: true}, - ServiceFrameworkVersion: AttributeConfig{Enabled: true}, + ServiceFrameworkName: attribute.AttributeConfig{Enabled: true}, + ServiceFrameworkVersion: attribute.AttributeConfig{Enabled: true}, }, Transaction: ElasticTransactionConfig{ - TimestampUs: AttributeConfig{Enabled: true}, - Sampled: AttributeConfig{Enabled: true}, - ID: AttributeConfig{Enabled: true}, - Root: AttributeConfig{Enabled: true}, - Name: AttributeConfig{Enabled: true}, - ProcessorEvent: AttributeConfig{Enabled: true}, - DurationUs: AttributeConfig{Enabled: true}, - Type: AttributeConfig{Enabled: true}, - Result: AttributeConfig{Enabled: true}, - EventOutcome: AttributeConfig{Enabled: true}, - RepresentativeCount: AttributeConfig{Enabled: true}, - InferredSpans: AttributeConfig{Enabled: true}, - UserAgent: AttributeConfig{Enabled: true}, + TimestampUs: attribute.AttributeConfig{Enabled: true}, + Sampled: attribute.AttributeConfig{Enabled: true}, + ID: attribute.AttributeConfig{Enabled: true}, + Root: attribute.AttributeConfig{Enabled: true}, + Name: attribute.AttributeConfig{Enabled: true}, + ProcessorEvent: attribute.AttributeConfig{Enabled: true}, + DurationUs: attribute.AttributeConfig{Enabled: true}, + Type: attribute.AttributeConfig{Enabled: true}, + Result: attribute.AttributeConfig{Enabled: true}, + EventOutcome: attribute.AttributeConfig{Enabled: true}, + RepresentativeCount: attribute.AttributeConfig{Enabled: true}, + InferredSpans: attribute.AttributeConfig{Enabled: true}, + UserAgent: attribute.AttributeConfig{Enabled: true}, }, Span: ElasticSpanConfig{ - TimestampUs: AttributeConfig{Enabled: true}, - Name: AttributeConfig{Enabled: true}, - ProcessorEvent: AttributeConfig{Enabled: true}, - TypeSubtype: AttributeConfig{Enabled: true}, - DurationUs: AttributeConfig{Enabled: true}, - EventOutcome: AttributeConfig{Enabled: true}, - ServiceTarget: AttributeConfig{Enabled: true}, - DestinationService: AttributeConfig{Enabled: true}, - RepresentativeCount: AttributeConfig{Enabled: true}, - InferredSpans: AttributeConfig{Enabled: true}, - UserAgent: AttributeConfig{Enabled: true}, + TimestampUs: attribute.AttributeConfig{Enabled: true}, + Name: attribute.AttributeConfig{Enabled: true}, + ProcessorEvent: attribute.AttributeConfig{Enabled: true}, + TypeSubtype: attribute.AttributeConfig{Enabled: true}, + DurationUs: attribute.AttributeConfig{Enabled: true}, + EventOutcome: attribute.AttributeConfig{Enabled: true}, + ServiceTarget: attribute.AttributeConfig{Enabled: true}, + DestinationService: attribute.AttributeConfig{Enabled: true}, + RepresentativeCount: attribute.AttributeConfig{Enabled: true}, + InferredSpans: attribute.AttributeConfig{Enabled: true}, + UserAgent: attribute.AttributeConfig{Enabled: true}, }, SpanEvent: SpanEventConfig{ - TimestampUs: AttributeConfig{Enabled: true}, - TransactionSampled: AttributeConfig{Enabled: true}, - TransactionType: AttributeConfig{Enabled: true}, - ProcessorEvent: AttributeConfig{Enabled: true}, - ErrorID: AttributeConfig{Enabled: true}, - ErrorExceptionHandled: AttributeConfig{Enabled: true}, - ErrorGroupingKey: AttributeConfig{Enabled: true}, - ErrorGroupingName: AttributeConfig{Enabled: true}, + TimestampUs: attribute.AttributeConfig{Enabled: true}, + TransactionSampled: attribute.AttributeConfig{Enabled: true}, + TransactionType: attribute.AttributeConfig{Enabled: true}, + ProcessorEvent: attribute.AttributeConfig{Enabled: true}, + ErrorID: attribute.AttributeConfig{Enabled: true}, + ErrorExceptionHandled: attribute.AttributeConfig{Enabled: true}, + ErrorGroupingKey: attribute.AttributeConfig{Enabled: true}, + ErrorGroupingName: attribute.AttributeConfig{Enabled: true}, }, } } diff --git a/enrichments/trace/config/config_test.go b/enrichments/trace/config/config_test.go index b3eec4c..5da0f59 100644 --- a/enrichments/trace/config/config_test.go +++ b/enrichments/trace/config/config_test.go @@ -21,6 +21,7 @@ import ( "reflect" "testing" + "github.com/elastic/opentelemetry-lib/enrichments/common/attribute" "github.com/stretchr/testify/require" ) @@ -38,7 +39,7 @@ func assertAllEnabled(t *testing.T, cfg reflect.Value) { for i := 0; i < cfg.NumField(); i++ { rAttrCfg := cfg.Field(i).Interface() - attrCfg, ok := rAttrCfg.(AttributeConfig) + attrCfg, ok := rAttrCfg.(attribute.AttributeConfig) require.True(t, ok, "must be a type of AttributeConfig") require.True(t, attrCfg.Enabled, "must be enabled") } From f18a840ce52132fa1e8920d0c2af2d98f9405204 Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Fri, 16 May 2025 17:25:15 +0200 Subject: [PATCH 12/67] Using resource and attribute configs for logs --- enrichments/logs/logs.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/enrichments/logs/logs.go b/enrichments/logs/logs.go index 3066abb..858b90b 100644 --- a/enrichments/logs/logs.go +++ b/enrichments/logs/logs.go @@ -1,9 +1,9 @@ package log import ( + "github.com/elastic/opentelemetry-lib/enrichments/common/attribute" "github.com/elastic/opentelemetry-lib/enrichments/common/resource" "github.com/elastic/opentelemetry-lib/enrichments/logs/internal/mobile" - "github.com/elastic/opentelemetry-lib/enrichments/trace/config" "go.opentelemetry.io/collector/pdata/plog" ) @@ -12,8 +12,8 @@ type Enricher struct { func (e *Enricher) Enrich(logs plog.Logs) { resourceLogs := logs.ResourceLogs() - resourceConfig := config.ResourceConfig{ - AgentName: config.AttributeConfig{ + resourceConfig := resource.ResourceConfig{ + AgentName: attribute.AttributeConfig{ Enabled: false, }, } From aab7e0e88a9e0672e0c0ebd7fbe1777d777abfff Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Sat, 17 May 2025 07:20:37 +0200 Subject: [PATCH 13/67] Testing log resource enrichment --- enrichments/logs/logs.go | 8 +++-- enrichments/logs/logs_test.go | 29 +++++++++++++++ enrichments/logs/testdata/logs.yaml | 55 +++++++++++++++++++++++++++++ 3 files changed, 90 insertions(+), 2 deletions(-) create mode 100644 enrichments/logs/logs_test.go create mode 100644 enrichments/logs/testdata/logs.yaml diff --git a/enrichments/logs/logs.go b/enrichments/logs/logs.go index 858b90b..a90af7c 100644 --- a/enrichments/logs/logs.go +++ b/enrichments/logs/logs.go @@ -1,4 +1,4 @@ -package log +package logs import ( "github.com/elastic/opentelemetry-lib/enrichments/common/attribute" @@ -10,11 +10,15 @@ import ( type Enricher struct { } +func NewEnricher() *Enricher { + return &Enricher{} +} + func (e *Enricher) Enrich(logs plog.Logs) { resourceLogs := logs.ResourceLogs() resourceConfig := resource.ResourceConfig{ AgentName: attribute.AttributeConfig{ - Enabled: false, + Enabled: true, }, } diff --git a/enrichments/logs/logs_test.go b/enrichments/logs/logs_test.go new file mode 100644 index 0000000..ebb79d3 --- /dev/null +++ b/enrichments/logs/logs_test.go @@ -0,0 +1,29 @@ +package logs + +import ( + "path/filepath" + "testing" + + "github.com/google/go-cmp/cmp" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestEnrichResourceLog(t *testing.T) { + traceFile := filepath.Join("testdata", "logs.yaml") + logs, err := golden.ReadLogs(traceFile) + require.NoError(t, err) + + enricher := NewEnricher() + enricher.Enrich(logs) + + resource := logs.ResourceLogs().At(0).Resource() + expectedAttributes := map[string]any{ + "service.name": "my.service", + "agent.name": "android/java", + "telemetry.sdk.name": "android", + "telemetry.sdk.language": "java", + } + assert.Empty(t, cmp.Diff(resource.Attributes().AsRaw(), expectedAttributes)) +} diff --git a/enrichments/logs/testdata/logs.yaml b/enrichments/logs/testdata/logs.yaml new file mode 100644 index 0000000..c082f76 --- /dev/null +++ b/enrichments/logs/testdata/logs.yaml @@ -0,0 +1,55 @@ +resourceLogs: +- resource: + attributes: + - key: service.name + value: + stringValue: my.service + - key: telemetry.sdk.name + value: + stringValue: android + - key: telemetry.sdk.language + value: + stringValue: java + scopeLogs: + - scope: + name: my.library + version: 1.0.0 + attributes: + - key: my.scope.attribute + value: + stringValue: some scope attribute + logRecords: + - timeUnixNano: '1544712660300000000' + observedTimeUnixNano: '1544712660300000000' + severityNumber: 10 + severityText: Information + traceId: 5B8EFFF798038103D269B633813FC60C + spanId: EEE19B7EC3C1B174 + body: + stringValue: Example log record + attributes: + - key: string.attribute + value: + stringValue: some string + - key: boolean.attribute + value: + boolValue: true + - key: int.attribute + value: + intValue: '10' + - key: double.attribute + value: + doubleValue: 637.704 + - key: array.attribute + value: + arrayValue: + values: + - stringValue: many + - stringValue: values + - key: map.attribute + value: + kvlistValue: + values: + - key: some.map.key + value: + stringValue: some value From 5a7b01040a83caf87dd504432b2a93049fb55558 Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Mon, 19 May 2025 17:24:22 +0200 Subject: [PATCH 14/67] Adding timestamp.us verification --- enrichments/logs/internal/mobile/event_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/enrichments/logs/internal/mobile/event_test.go b/enrichments/logs/internal/mobile/event_test.go index 6d01e20..c808a44 100644 --- a/enrichments/logs/internal/mobile/event_test.go +++ b/enrichments/logs/internal/mobile/event_test.go @@ -2,14 +2,19 @@ package mobile import ( "testing" + "time" "github.com/google/go-cmp/cmp" "github.com/stretchr/testify/assert" + "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" ) func TestEnrichCrashEvents(t *testing.T) { + now := time.Unix(3600, 0) + timestamp := pcommon.NewTimestampFromTime(now) logRecord := plog.NewLogRecord() + logRecord.SetTimestamp(timestamp) logRecord.Attributes().PutStr("event.name", "device.crash") logRecord.Attributes().PutStr("exception.message", "Exception message") logRecord.Attributes().PutStr("exception.type", "java.lang.RuntimeException") @@ -21,6 +26,7 @@ func TestEnrichCrashEvents(t *testing.T) { logRecord.CopyTo(expectedLogRecord) expectedLogRecord.Attributes().PutStr("processor.event", "error") + expectedLogRecord.Attributes().PutInt("timestamp.us", timestamp.AsTime().UnixMicro()) assert.Empty(t, cmp.Diff(logRecord.Attributes().AsRaw(), expectedLogRecord.Attributes().AsRaw())) } From e22e428b797d8619722596b0e7b0871d41fb4167 Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Mon, 19 May 2025 17:30:23 +0200 Subject: [PATCH 15/67] Extracting getting timestamp.us tool --- elasticattr/attributes.go | 6 ++++++ enrichments/trace/internal/elastic/span.go | 10 +++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/elasticattr/attributes.go b/elasticattr/attributes.go index 4d302e5..1101c97 100644 --- a/elasticattr/attributes.go +++ b/elasticattr/attributes.go @@ -17,6 +17,8 @@ package elasticattr +import "go.opentelemetry.io/collector/pdata/pcommon" + const ( // resource s AgentName = "agent.name" @@ -56,3 +58,7 @@ const ( ErrorGroupingKey = "error.grouping_key" ErrorGroupingName = "error.grouping_name" ) + +func GetTimestampUs(ts pcommon.Timestamp) int64 { + return int64(ts) / 1000 +} diff --git a/enrichments/trace/internal/elastic/span.go b/enrichments/trace/internal/elastic/span.go index f4d1082..922ce6e 100644 --- a/enrichments/trace/internal/elastic/span.go +++ b/enrichments/trace/internal/elastic/span.go @@ -238,7 +238,7 @@ func (s *spanEnrichmentContext) enrichTransaction( cfg config.ElasticTransactionConfig, ) { if cfg.TimestampUs.Enabled { - span.Attributes().PutInt(elasticattr.TimestampUs, getTimestampUs(span.StartTimestamp())) + span.Attributes().PutInt(elasticattr.TimestampUs, elasticattr.GetTimestampUs(span.StartTimestamp())) } if cfg.Sampled.Enabled { span.Attributes().PutBool(elasticattr.TransactionSampled, s.getSampled()) @@ -288,7 +288,7 @@ func (s *spanEnrichmentContext) enrichSpan( var spanType, spanSubtype string if cfg.TimestampUs.Enabled { - span.Attributes().PutInt(elasticattr.TimestampUs, getTimestampUs(span.StartTimestamp())) + span.Attributes().PutInt(elasticattr.TimestampUs, elasticattr.GetTimestampUs(span.StartTimestamp())) } if cfg.Name.Enabled { span.Attributes().PutStr(elasticattr.SpanName, span.Name()) @@ -598,7 +598,7 @@ func (s *spanEventEnrichmentContext) enrich( // Enrich span event attributes. if cfg.TimestampUs.Enabled { - se.Attributes().PutInt(elasticattr.TimestampUs, getTimestampUs(se.Timestamp())) + se.Attributes().PutInt(elasticattr.TimestampUs, elasticattr.GetTimestampUs(se.Timestamp())) } if cfg.ProcessorEvent.Enabled && s.exception { se.Attributes().PutStr(elasticattr.ProcessorEvent, "error") @@ -743,10 +743,6 @@ func getHostPort( return "" } -func getTimestampUs(ts pcommon.Timestamp) int64 { - return int64(ts) / 1000 -} - var standardStatusCodeResults = [...]string{ "HTTP 1xx", "HTTP 2xx", From 0e6247a96a69bbd608f5c8dd5a40b4687b0bd3a1 Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Mon, 19 May 2025 17:37:35 +0200 Subject: [PATCH 16/67] Adding timestamp.us to crash events --- enrichments/logs/internal/mobile/event.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/enrichments/logs/internal/mobile/event.go b/enrichments/logs/internal/mobile/event.go index 1c53015..8f6a6d5 100644 --- a/enrichments/logs/internal/mobile/event.go +++ b/enrichments/logs/internal/mobile/event.go @@ -1,7 +1,11 @@ package mobile -import "go.opentelemetry.io/collector/pdata/plog" +import ( + "github.com/elastic/opentelemetry-lib/elasticattr" + "go.opentelemetry.io/collector/pdata/plog" +) func EnrichLogEvent(logRecord plog.LogRecord) { - logRecord.Attributes().PutStr("processor.event", "error") + logRecord.Attributes().PutStr(elasticattr.ProcessorEvent, "error") + logRecord.Attributes().PutInt(elasticattr.TimestampUs, elasticattr.GetTimestampUs(logRecord.Timestamp())) } From 2d4e4bb703694ec1a53d569c5e3fbca49d5d755e Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Mon, 19 May 2025 19:10:50 +0200 Subject: [PATCH 17/67] Moving attributeconfig to elasticattr --- .../attribute => elasticattr}/config.go | 2 +- enrichments/common/resource/config.go | 18 +-- enrichments/common/resource/config_test.go | 4 +- enrichments/logs/logs.go | 4 +- enrichments/trace/config/config.go | 138 +++++++++--------- enrichments/trace/config/config_test.go | 4 +- 6 files changed, 85 insertions(+), 85 deletions(-) rename {enrichments/common/attribute => elasticattr}/config.go (87%) diff --git a/enrichments/common/attribute/config.go b/elasticattr/config.go similarity index 87% rename from enrichments/common/attribute/config.go rename to elasticattr/config.go index d5d2c78..725def7 100644 --- a/enrichments/common/attribute/config.go +++ b/elasticattr/config.go @@ -1,4 +1,4 @@ -package attribute +package elasticattr // AttributeConfig is the configuration options for each attribute. type AttributeConfig struct { diff --git a/enrichments/common/resource/config.go b/enrichments/common/resource/config.go index 7e5c29e..568f8b1 100644 --- a/enrichments/common/resource/config.go +++ b/enrichments/common/resource/config.go @@ -1,20 +1,20 @@ package resource -import "github.com/elastic/opentelemetry-lib/enrichments/common/attribute" +import "github.com/elastic/opentelemetry-lib/elasticattr" // ResourceConfig configures the enrichment of resource attributes. type ResourceConfig struct { - AgentName attribute.AttributeConfig `mapstructure:"agent_name"` - AgentVersion attribute.AttributeConfig `mapstructure:"agent_version"` - OverrideHostName attribute.AttributeConfig `mapstructure:"override_host_name"` - DeploymentEnvironment attribute.AttributeConfig `mapstructure:"deployment_environment"` + AgentName elasticattr.AttributeConfig `mapstructure:"agent_name"` + AgentVersion elasticattr.AttributeConfig `mapstructure:"agent_version"` + OverrideHostName elasticattr.AttributeConfig `mapstructure:"override_host_name"` + DeploymentEnvironment elasticattr.AttributeConfig `mapstructure:"deployment_environment"` } func EnabledConfig() ResourceConfig { return ResourceConfig{ - AgentName: attribute.AttributeConfig{Enabled: true}, - AgentVersion: attribute.AttributeConfig{Enabled: true}, - OverrideHostName: attribute.AttributeConfig{Enabled: true}, - DeploymentEnvironment: attribute.AttributeConfig{Enabled: true}, + AgentName: elasticattr.AttributeConfig{Enabled: true}, + AgentVersion: elasticattr.AttributeConfig{Enabled: true}, + OverrideHostName: elasticattr.AttributeConfig{Enabled: true}, + DeploymentEnvironment: elasticattr.AttributeConfig{Enabled: true}, } } diff --git a/enrichments/common/resource/config_test.go b/enrichments/common/resource/config_test.go index 29a3c94..1ea6705 100644 --- a/enrichments/common/resource/config_test.go +++ b/enrichments/common/resource/config_test.go @@ -21,7 +21,7 @@ import ( "reflect" "testing" - "github.com/elastic/opentelemetry-lib/enrichments/common/attribute" + "github.com/elastic/opentelemetry-lib/elasticattr" "github.com/stretchr/testify/require" ) @@ -35,7 +35,7 @@ func assertAllEnabled(t *testing.T, cfg reflect.Value) { for i := 0; i < cfg.NumField(); i++ { rAttrCfg := cfg.Field(i).Interface() - attrCfg, ok := rAttrCfg.(attribute.AttributeConfig) + attrCfg, ok := rAttrCfg.(elasticattr.AttributeConfig) require.True(t, ok, "must be a type of AttributeConfig") require.True(t, attrCfg.Enabled, "must be enabled") } diff --git a/enrichments/logs/logs.go b/enrichments/logs/logs.go index a90af7c..696da99 100644 --- a/enrichments/logs/logs.go +++ b/enrichments/logs/logs.go @@ -1,7 +1,7 @@ package logs import ( - "github.com/elastic/opentelemetry-lib/enrichments/common/attribute" + "github.com/elastic/opentelemetry-lib/elasticattr" "github.com/elastic/opentelemetry-lib/enrichments/common/resource" "github.com/elastic/opentelemetry-lib/enrichments/logs/internal/mobile" "go.opentelemetry.io/collector/pdata/plog" @@ -17,7 +17,7 @@ func NewEnricher() *Enricher { func (e *Enricher) Enrich(logs plog.Logs) { resourceLogs := logs.ResourceLogs() resourceConfig := resource.ResourceConfig{ - AgentName: attribute.AttributeConfig{ + AgentName: elasticattr.AttributeConfig{ Enabled: true, }, } diff --git a/enrichments/trace/config/config.go b/enrichments/trace/config/config.go index 119e9b4..7deae4c 100644 --- a/enrichments/trace/config/config.go +++ b/enrichments/trace/config/config.go @@ -18,7 +18,7 @@ package config import ( - "github.com/elastic/opentelemetry-lib/enrichments/common/attribute" + "github.com/elastic/opentelemetry-lib/elasticattr" "github.com/elastic/opentelemetry-lib/enrichments/common/resource" ) @@ -33,8 +33,8 @@ type Config struct { // ScopeConfig configures the enrichment of scope attributes. type ScopeConfig struct { - ServiceFrameworkName attribute.AttributeConfig `mapstructure:"service_framework_name"` - ServiceFrameworkVersion attribute.AttributeConfig `mapstructure:"service_framework_version"` + ServiceFrameworkName elasticattr.AttributeConfig `mapstructure:"service_framework_name"` + ServiceFrameworkVersion elasticattr.AttributeConfig `mapstructure:"service_framework_version"` } // ElasticTransactionConfig configures the enrichment attributes for the @@ -43,19 +43,19 @@ type ElasticTransactionConfig struct { // TimestampUs is a temporary attribute to enable higher // resolution timestamps in Elasticsearch. For more details see: // https://github.com/elastic/opentelemetry-dev/issues/374. - TimestampUs attribute.AttributeConfig `mapstructure:"timestamp_us"` - Sampled attribute.AttributeConfig `mapstructure:"sampled"` - ID attribute.AttributeConfig `mapstructure:"id"` - Root attribute.AttributeConfig `mapstructure:"root"` - Name attribute.AttributeConfig `mapstructure:"name"` - ProcessorEvent attribute.AttributeConfig `mapstructure:"processor_event"` - RepresentativeCount attribute.AttributeConfig `mapstructure:"representative_count"` - DurationUs attribute.AttributeConfig `mapstructure:"duration_us"` - Type attribute.AttributeConfig `mapstructure:"type"` - Result attribute.AttributeConfig `mapstructure:"result"` - EventOutcome attribute.AttributeConfig `mapstructure:"event_outcome"` - InferredSpans attribute.AttributeConfig `mapstructure:"inferred_spans"` - UserAgent attribute.AttributeConfig `mapstructure:"user_agent"` + TimestampUs elasticattr.AttributeConfig `mapstructure:"timestamp_us"` + Sampled elasticattr.AttributeConfig `mapstructure:"sampled"` + ID elasticattr.AttributeConfig `mapstructure:"id"` + Root elasticattr.AttributeConfig `mapstructure:"root"` + Name elasticattr.AttributeConfig `mapstructure:"name"` + ProcessorEvent elasticattr.AttributeConfig `mapstructure:"processor_event"` + RepresentativeCount elasticattr.AttributeConfig `mapstructure:"representative_count"` + DurationUs elasticattr.AttributeConfig `mapstructure:"duration_us"` + Type elasticattr.AttributeConfig `mapstructure:"type"` + Result elasticattr.AttributeConfig `mapstructure:"result"` + EventOutcome elasticattr.AttributeConfig `mapstructure:"event_outcome"` + InferredSpans elasticattr.AttributeConfig `mapstructure:"inferred_spans"` + UserAgent elasticattr.AttributeConfig `mapstructure:"user_agent"` } // ElasticSpanConfig configures the enrichment attributes for the spans @@ -64,17 +64,17 @@ type ElasticSpanConfig struct { // TimestampUs is a temporary attribute to enable higher // resolution timestamps in Elasticsearch. For more details see: // https://github.com/elastic/opentelemetry-dev/issues/374. - TimestampUs attribute.AttributeConfig `mapstructure:"timestamp_us"` - Name attribute.AttributeConfig `mapstructure:"name"` - ProcessorEvent attribute.AttributeConfig `mapstructure:"processor_event"` - RepresentativeCount attribute.AttributeConfig `mapstructure:"representative_count"` - TypeSubtype attribute.AttributeConfig `mapstructure:"type_subtype"` - DurationUs attribute.AttributeConfig `mapstructure:"duration_us"` - EventOutcome attribute.AttributeConfig `mapstructure:"event_outcome"` - ServiceTarget attribute.AttributeConfig `mapstructure:"service_target"` - DestinationService attribute.AttributeConfig `mapstructure:"destination_service"` - InferredSpans attribute.AttributeConfig `mapstructure:"inferred_spans"` - UserAgent attribute.AttributeConfig `mapstructure:"user_agent"` + TimestampUs elasticattr.AttributeConfig `mapstructure:"timestamp_us"` + Name elasticattr.AttributeConfig `mapstructure:"name"` + ProcessorEvent elasticattr.AttributeConfig `mapstructure:"processor_event"` + RepresentativeCount elasticattr.AttributeConfig `mapstructure:"representative_count"` + TypeSubtype elasticattr.AttributeConfig `mapstructure:"type_subtype"` + DurationUs elasticattr.AttributeConfig `mapstructure:"duration_us"` + EventOutcome elasticattr.AttributeConfig `mapstructure:"event_outcome"` + ServiceTarget elasticattr.AttributeConfig `mapstructure:"service_target"` + DestinationService elasticattr.AttributeConfig `mapstructure:"destination_service"` + InferredSpans elasticattr.AttributeConfig `mapstructure:"inferred_spans"` + UserAgent elasticattr.AttributeConfig `mapstructure:"user_agent"` } // SpanEventConfig configures enrichment attributes for the span events. @@ -82,16 +82,16 @@ type SpanEventConfig struct { // TimestampUs is a temporary attribute to enable higher // resolution timestamps in Elasticsearch. For more details see: // https://github.com/elastic/opentelemetry-dev/issues/374. - TimestampUs attribute.AttributeConfig `mapstructure:"timestamp_us"` - TransactionSampled attribute.AttributeConfig `mapstructure:"transaction_sampled"` - TransactionType attribute.AttributeConfig `mapstructure:"transaction_type"` - ProcessorEvent attribute.AttributeConfig `mapstructure:"processor_event"` + TimestampUs elasticattr.AttributeConfig `mapstructure:"timestamp_us"` + TransactionSampled elasticattr.AttributeConfig `mapstructure:"transaction_sampled"` + TransactionType elasticattr.AttributeConfig `mapstructure:"transaction_type"` + ProcessorEvent elasticattr.AttributeConfig `mapstructure:"processor_event"` // For exceptions/errors - ErrorID attribute.AttributeConfig `mapstructure:"error_id"` - ErrorExceptionHandled attribute.AttributeConfig `mapstructure:"error_exception_handled"` - ErrorGroupingKey attribute.AttributeConfig `mapstructure:"error_grouping_key"` - ErrorGroupingName attribute.AttributeConfig `mapstructure:"error_grouping_name"` + ErrorID elasticattr.AttributeConfig `mapstructure:"error_id"` + ErrorExceptionHandled elasticattr.AttributeConfig `mapstructure:"error_exception_handled"` + ErrorGroupingKey elasticattr.AttributeConfig `mapstructure:"error_grouping_key"` + ErrorGroupingName elasticattr.AttributeConfig `mapstructure:"error_grouping_name"` } // Enabled returns a config with all default enrichments enabled. @@ -99,46 +99,46 @@ func Enabled() Config { return Config{ Resource: resource.EnabledConfig(), Scope: ScopeConfig{ - ServiceFrameworkName: attribute.AttributeConfig{Enabled: true}, - ServiceFrameworkVersion: attribute.AttributeConfig{Enabled: true}, + ServiceFrameworkName: elasticattr.AttributeConfig{Enabled: true}, + ServiceFrameworkVersion: elasticattr.AttributeConfig{Enabled: true}, }, Transaction: ElasticTransactionConfig{ - TimestampUs: attribute.AttributeConfig{Enabled: true}, - Sampled: attribute.AttributeConfig{Enabled: true}, - ID: attribute.AttributeConfig{Enabled: true}, - Root: attribute.AttributeConfig{Enabled: true}, - Name: attribute.AttributeConfig{Enabled: true}, - ProcessorEvent: attribute.AttributeConfig{Enabled: true}, - DurationUs: attribute.AttributeConfig{Enabled: true}, - Type: attribute.AttributeConfig{Enabled: true}, - Result: attribute.AttributeConfig{Enabled: true}, - EventOutcome: attribute.AttributeConfig{Enabled: true}, - RepresentativeCount: attribute.AttributeConfig{Enabled: true}, - InferredSpans: attribute.AttributeConfig{Enabled: true}, - UserAgent: attribute.AttributeConfig{Enabled: true}, + TimestampUs: elasticattr.AttributeConfig{Enabled: true}, + Sampled: elasticattr.AttributeConfig{Enabled: true}, + ID: elasticattr.AttributeConfig{Enabled: true}, + Root: elasticattr.AttributeConfig{Enabled: true}, + Name: elasticattr.AttributeConfig{Enabled: true}, + ProcessorEvent: elasticattr.AttributeConfig{Enabled: true}, + DurationUs: elasticattr.AttributeConfig{Enabled: true}, + Type: elasticattr.AttributeConfig{Enabled: true}, + Result: elasticattr.AttributeConfig{Enabled: true}, + EventOutcome: elasticattr.AttributeConfig{Enabled: true}, + RepresentativeCount: elasticattr.AttributeConfig{Enabled: true}, + InferredSpans: elasticattr.AttributeConfig{Enabled: true}, + UserAgent: elasticattr.AttributeConfig{Enabled: true}, }, Span: ElasticSpanConfig{ - TimestampUs: attribute.AttributeConfig{Enabled: true}, - Name: attribute.AttributeConfig{Enabled: true}, - ProcessorEvent: attribute.AttributeConfig{Enabled: true}, - TypeSubtype: attribute.AttributeConfig{Enabled: true}, - DurationUs: attribute.AttributeConfig{Enabled: true}, - EventOutcome: attribute.AttributeConfig{Enabled: true}, - ServiceTarget: attribute.AttributeConfig{Enabled: true}, - DestinationService: attribute.AttributeConfig{Enabled: true}, - RepresentativeCount: attribute.AttributeConfig{Enabled: true}, - InferredSpans: attribute.AttributeConfig{Enabled: true}, - UserAgent: attribute.AttributeConfig{Enabled: true}, + TimestampUs: elasticattr.AttributeConfig{Enabled: true}, + Name: elasticattr.AttributeConfig{Enabled: true}, + ProcessorEvent: elasticattr.AttributeConfig{Enabled: true}, + TypeSubtype: elasticattr.AttributeConfig{Enabled: true}, + DurationUs: elasticattr.AttributeConfig{Enabled: true}, + EventOutcome: elasticattr.AttributeConfig{Enabled: true}, + ServiceTarget: elasticattr.AttributeConfig{Enabled: true}, + DestinationService: elasticattr.AttributeConfig{Enabled: true}, + RepresentativeCount: elasticattr.AttributeConfig{Enabled: true}, + InferredSpans: elasticattr.AttributeConfig{Enabled: true}, + UserAgent: elasticattr.AttributeConfig{Enabled: true}, }, SpanEvent: SpanEventConfig{ - TimestampUs: attribute.AttributeConfig{Enabled: true}, - TransactionSampled: attribute.AttributeConfig{Enabled: true}, - TransactionType: attribute.AttributeConfig{Enabled: true}, - ProcessorEvent: attribute.AttributeConfig{Enabled: true}, - ErrorID: attribute.AttributeConfig{Enabled: true}, - ErrorExceptionHandled: attribute.AttributeConfig{Enabled: true}, - ErrorGroupingKey: attribute.AttributeConfig{Enabled: true}, - ErrorGroupingName: attribute.AttributeConfig{Enabled: true}, + TimestampUs: elasticattr.AttributeConfig{Enabled: true}, + TransactionSampled: elasticattr.AttributeConfig{Enabled: true}, + TransactionType: elasticattr.AttributeConfig{Enabled: true}, + ProcessorEvent: elasticattr.AttributeConfig{Enabled: true}, + ErrorID: elasticattr.AttributeConfig{Enabled: true}, + ErrorExceptionHandled: elasticattr.AttributeConfig{Enabled: true}, + ErrorGroupingKey: elasticattr.AttributeConfig{Enabled: true}, + ErrorGroupingName: elasticattr.AttributeConfig{Enabled: true}, }, } } diff --git a/enrichments/trace/config/config_test.go b/enrichments/trace/config/config_test.go index 5da0f59..3fbef23 100644 --- a/enrichments/trace/config/config_test.go +++ b/enrichments/trace/config/config_test.go @@ -21,7 +21,7 @@ import ( "reflect" "testing" - "github.com/elastic/opentelemetry-lib/enrichments/common/attribute" + "github.com/elastic/opentelemetry-lib/elasticattr" "github.com/stretchr/testify/require" ) @@ -39,7 +39,7 @@ func assertAllEnabled(t *testing.T, cfg reflect.Value) { for i := 0; i < cfg.NumField(); i++ { rAttrCfg := cfg.Field(i).Interface() - attrCfg, ok := rAttrCfg.(attribute.AttributeConfig) + attrCfg, ok := rAttrCfg.(elasticattr.AttributeConfig) require.True(t, ok, "must be a type of AttributeConfig") require.True(t, attrCfg.Enabled, "must be enabled") } From 94efe4d27b6ed11a4527694371b327d6cf5d347c Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Mon, 19 May 2025 19:46:28 +0200 Subject: [PATCH 18/67] Adding error.id --- enrichments/logs/internal/mobile/event.go | 20 +++++++++++++++++++ .../logs/internal/mobile/event_test.go | 1 + 2 files changed, 21 insertions(+) diff --git a/enrichments/logs/internal/mobile/event.go b/enrichments/logs/internal/mobile/event.go index 8f6a6d5..a0bce39 100644 --- a/enrichments/logs/internal/mobile/event.go +++ b/enrichments/logs/internal/mobile/event.go @@ -1,6 +1,10 @@ package mobile import ( + "crypto/rand" + "encoding/hex" + "io" + "github.com/elastic/opentelemetry-lib/elasticattr" "go.opentelemetry.io/collector/pdata/plog" ) @@ -8,4 +12,20 @@ import ( func EnrichLogEvent(logRecord plog.LogRecord) { logRecord.Attributes().PutStr(elasticattr.ProcessorEvent, "error") logRecord.Attributes().PutInt(elasticattr.TimestampUs, elasticattr.GetTimestampUs(logRecord.Timestamp())) + if id, err := newUniqueID(); err == nil { + logRecord.Attributes().PutStr("error.id", id) + } +} + +func newUniqueID() (string, error) { + var u [16]byte + if _, err := io.ReadFull(rand.Reader, u[:]); err != nil { + return "", err + } + + // convert to string + buf := make([]byte, 32) + hex.Encode(buf, u[:]) + + return string(buf), nil } diff --git a/enrichments/logs/internal/mobile/event_test.go b/enrichments/logs/internal/mobile/event_test.go index c808a44..c1ba627 100644 --- a/enrichments/logs/internal/mobile/event_test.go +++ b/enrichments/logs/internal/mobile/event_test.go @@ -26,6 +26,7 @@ func TestEnrichCrashEvents(t *testing.T) { logRecord.CopyTo(expectedLogRecord) expectedLogRecord.Attributes().PutStr("processor.event", "error") + expectedLogRecord.Attributes().PutStr("error.id", "todo") expectedLogRecord.Attributes().PutInt("timestamp.us", timestamp.AsTime().UnixMicro()) assert.Empty(t, cmp.Diff(logRecord.Attributes().AsRaw(), expectedLogRecord.Attributes().AsRaw())) From ba187a57841ef4a39c834a81b96de9c0155aca03 Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Mon, 19 May 2025 19:53:48 +0200 Subject: [PATCH 19/67] Improving event tests --- enrichments/logs/internal/mobile/event_test.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/enrichments/logs/internal/mobile/event_test.go b/enrichments/logs/internal/mobile/event_test.go index c1ba627..0f326af 100644 --- a/enrichments/logs/internal/mobile/event_test.go +++ b/enrichments/logs/internal/mobile/event_test.go @@ -22,12 +22,10 @@ func TestEnrichCrashEvents(t *testing.T) { EnrichLogEvent(logRecord) - expectedLogRecord := plog.NewLogRecord() - logRecord.CopyTo(expectedLogRecord) + expectedAttributes := map[string]any{ + "processor.event": "error", + "timestamp.us": timestamp.AsTime().UnixMicro(), + } - expectedLogRecord.Attributes().PutStr("processor.event", "error") - expectedLogRecord.Attributes().PutStr("error.id", "todo") - expectedLogRecord.Attributes().PutInt("timestamp.us", timestamp.AsTime().UnixMicro()) - - assert.Empty(t, cmp.Diff(logRecord.Attributes().AsRaw(), expectedLogRecord.Attributes().AsRaw())) + assert.Empty(t, cmp.Diff(logRecord.Attributes().AsRaw(), expectedAttributes)) } From 90755125c4996dd8a9de8c003efd9e8899d35a64 Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Tue, 20 May 2025 05:41:23 +0200 Subject: [PATCH 20/67] Updatig tests --- enrichments/logs/internal/mobile/event_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/enrichments/logs/internal/mobile/event_test.go b/enrichments/logs/internal/mobile/event_test.go index 0f326af..569274a 100644 --- a/enrichments/logs/internal/mobile/event_test.go +++ b/enrichments/logs/internal/mobile/event_test.go @@ -19,13 +19,13 @@ func TestEnrichCrashEvents(t *testing.T) { logRecord.Attributes().PutStr("exception.message", "Exception message") logRecord.Attributes().PutStr("exception.type", "java.lang.RuntimeException") logRecord.Attributes().PutStr("exception.stacktrace", `Exception in thread "main" java.lang.RuntimeException: Test exception\\n at com.example.GenerateTrace.methodB(GenerateTrace.java:13)\\n at com.example.GenerateTrace.methodA(GenerateTrace.java:9)\\n at com.example.GenerateTrace.main(GenerateTrace.java:5)`) + expectedLogRecord := plog.NewLogRecord() + logRecord.CopyTo(expectedLogRecord) EnrichLogEvent(logRecord) - expectedAttributes := map[string]any{ - "processor.event": "error", - "timestamp.us": timestamp.AsTime().UnixMicro(), - } + expectedLogRecord.Attributes().PutStr("processor.event", "error") + expectedLogRecord.Attributes().PutInt("timestamp.us", timestamp.AsTime().UnixMicro()) - assert.Empty(t, cmp.Diff(logRecord.Attributes().AsRaw(), expectedAttributes)) + assert.Empty(t, cmp.Diff(logRecord.Attributes().AsRaw(), expectedLogRecord.Attributes().AsRaw())) } From ac4a85248fa6f078a9ea2b21b2790a6ee3725de9 Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Tue, 20 May 2025 06:38:50 +0200 Subject: [PATCH 21/67] Validating error.id --- enrichments/logs/internal/mobile/event_test.go | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/enrichments/logs/internal/mobile/event_test.go b/enrichments/logs/internal/mobile/event_test.go index 569274a..1dd5647 100644 --- a/enrichments/logs/internal/mobile/event_test.go +++ b/enrichments/logs/internal/mobile/event_test.go @@ -27,5 +27,20 @@ func TestEnrichCrashEvents(t *testing.T) { expectedLogRecord.Attributes().PutStr("processor.event", "error") expectedLogRecord.Attributes().PutInt("timestamp.us", timestamp.AsTime().UnixMicro()) - assert.Empty(t, cmp.Diff(logRecord.Attributes().AsRaw(), expectedLogRecord.Attributes().AsRaw())) + assert.Empty(t, cmp.Diff(logRecord.Attributes().AsRaw(), expectedLogRecord.Attributes().AsRaw(), ignoreMapKey("error.id"))) + errorId, ok := logRecord.Attributes().Get("error.id") + if !ok { + assert.Fail(t, "error.id not found") + } + assert.Equal(t, 32, len(errorId.AsString())) +} + +func ignoreMapKey(k string) cmp.Option { + return cmp.FilterPath(func(p cmp.Path) bool { + mapIndex, ok := p.Last().(cmp.MapIndex) + if !ok { + return false + } + return mapIndex.Key().String() == k + }, cmp.Ignore()) } From c835f55e610ca88476c2812e1fd34d94189b6547 Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Wed, 21 May 2025 07:03:05 +0200 Subject: [PATCH 22/67] Adding java stacktrace testdata --- .../logs/internal/mobile/testdata/stacktrace1_a.txt | 3 +++ .../logs/internal/mobile/testdata/stacktrace1_b.txt | 3 +++ .../logs/internal/mobile/testdata/stacktrace2_a.txt | 7 +++++++ .../logs/internal/mobile/testdata/stacktrace2_b.txt | 7 +++++++ 4 files changed, 20 insertions(+) create mode 100644 enrichments/logs/internal/mobile/testdata/stacktrace1_a.txt create mode 100644 enrichments/logs/internal/mobile/testdata/stacktrace1_b.txt create mode 100644 enrichments/logs/internal/mobile/testdata/stacktrace2_a.txt create mode 100644 enrichments/logs/internal/mobile/testdata/stacktrace2_b.txt diff --git a/enrichments/logs/internal/mobile/testdata/stacktrace1_a.txt b/enrichments/logs/internal/mobile/testdata/stacktrace1_a.txt new file mode 100644 index 0000000..5349157 --- /dev/null +++ b/enrichments/logs/internal/mobile/testdata/stacktrace1_a.txt @@ -0,0 +1,3 @@ +java.lang.IllegalArgumentException: The arg 'abc' is not valid + at org.example.SomeClass.someMethod(SomeClass.kt:8) + at org.example.Main.main(Main.kt:9) diff --git a/enrichments/logs/internal/mobile/testdata/stacktrace1_b.txt b/enrichments/logs/internal/mobile/testdata/stacktrace1_b.txt new file mode 100644 index 0000000..9fd6126 --- /dev/null +++ b/enrichments/logs/internal/mobile/testdata/stacktrace1_b.txt @@ -0,0 +1,3 @@ +java.lang.IllegalArgumentException: The arg 'def' is not valid + at org.example.SomeClass.someMethod(SomeClass.kt:8) + at org.example.Main.main(Main.kt:9) diff --git a/enrichments/logs/internal/mobile/testdata/stacktrace2_a.txt b/enrichments/logs/internal/mobile/testdata/stacktrace2_a.txt new file mode 100644 index 0000000..5155169 --- /dev/null +++ b/enrichments/logs/internal/mobile/testdata/stacktrace2_a.txt @@ -0,0 +1,7 @@ +java.lang.RuntimeException: java.lang.IllegalArgumentException: The arg 'abc' is not valid + at org.example.SomeClass.callingOtherMethod(SomeClass.kt:16) + at org.example.Main.main(Main.kt:9) +Caused by: java.lang.IllegalArgumentException: The arg 'abc' is not valid + at org.example.SomeOtherClass.someOtherMethod(SomeOtherClass.kt:8) + at org.example.SomeClass.callingOtherMethod(SomeClass.kt:14) + ... 1 more diff --git a/enrichments/logs/internal/mobile/testdata/stacktrace2_b.txt b/enrichments/logs/internal/mobile/testdata/stacktrace2_b.txt new file mode 100644 index 0000000..ae410c4 --- /dev/null +++ b/enrichments/logs/internal/mobile/testdata/stacktrace2_b.txt @@ -0,0 +1,7 @@ +java.lang.RuntimeException: java.lang.IllegalArgumentException: The arg 'def' is not valid + at org.example.SomeClass.callingOtherMethod(SomeClass.kt:16) + at org.example.Main.main(Main.kt:9) +Caused by: java.lang.IllegalArgumentException: The arg 'def' is not valid + at org.example.SomeOtherClass.someOtherMethod(SomeOtherClass.kt:8) + at org.example.SomeClass.callingOtherMethod(SomeClass.kt:14) + ... 1 more From 428ce3ad0c6bc2284c858ddf9342369ff4db09b1 Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Wed, 21 May 2025 16:17:10 +0200 Subject: [PATCH 23/67] Adding groupingkey go files --- enrichments/logs/internal/mobile/groupingkey.go | 1 + enrichments/logs/internal/mobile/groupingkey_test.go | 1 + 2 files changed, 2 insertions(+) create mode 100644 enrichments/logs/internal/mobile/groupingkey.go create mode 100644 enrichments/logs/internal/mobile/groupingkey_test.go diff --git a/enrichments/logs/internal/mobile/groupingkey.go b/enrichments/logs/internal/mobile/groupingkey.go new file mode 100644 index 0000000..a32f75c --- /dev/null +++ b/enrichments/logs/internal/mobile/groupingkey.go @@ -0,0 +1 @@ +package mobile diff --git a/enrichments/logs/internal/mobile/groupingkey_test.go b/enrichments/logs/internal/mobile/groupingkey_test.go new file mode 100644 index 0000000..a32f75c --- /dev/null +++ b/enrichments/logs/internal/mobile/groupingkey_test.go @@ -0,0 +1 @@ +package mobile From 73bb483e2b2f9722c6f86c1c1cdc47569a4a96de Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Wed, 21 May 2025 16:32:01 +0200 Subject: [PATCH 24/67] Adding stacktrace without message to testdata --- .../logs/internal/mobile/groupingkey_test.go | 20 +++++++++++++++++++ .../internal/mobile/testdata/stacktrace3.txt | 7 +++++++ 2 files changed, 27 insertions(+) create mode 100644 enrichments/logs/internal/mobile/testdata/stacktrace3.txt diff --git a/enrichments/logs/internal/mobile/groupingkey_test.go b/enrichments/logs/internal/mobile/groupingkey_test.go index a32f75c..cd86ada 100644 --- a/enrichments/logs/internal/mobile/groupingkey_test.go +++ b/enrichments/logs/internal/mobile/groupingkey_test.go @@ -1 +1,21 @@ package mobile + +import ( + "fmt" + "os" + "path/filepath" + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestCreateGroupingKeyForStacktrace(t *testing.T) { + stacktrace_path := filepath.Join("testdata", "stacktrace1_a.txt") + bytes, err := os.ReadFile(stacktrace_path) + if err != nil { + assert.Fail(t, "Could not read test file") + } + stacktrace := string(bytes) + + fmt.Printf("The stacktrace: %s", stacktrace) +} diff --git a/enrichments/logs/internal/mobile/testdata/stacktrace3.txt b/enrichments/logs/internal/mobile/testdata/stacktrace3.txt new file mode 100644 index 0000000..5690820 --- /dev/null +++ b/enrichments/logs/internal/mobile/testdata/stacktrace3.txt @@ -0,0 +1,7 @@ +java.lang.RuntimeException: java.lang.IllegalArgumentException + at org.example.SomeClass.callingOtherMethod(SomeClass.kt:16) + at org.example.Main.main(Main.kt:9) +Caused by: java.lang.IllegalArgumentException + at org.example.SomeOtherClass.someOtherMethod(SomeOtherClass.kt:8) + at org.example.SomeClass.callingOtherMethod(SomeClass.kt:14) + ... 1 more From 05a3984696ce013fef01d40f082bb92a31028e18 Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Wed, 21 May 2025 17:25:52 +0200 Subject: [PATCH 25/67] Creating test for curating stacktraces --- .../logs/internal/mobile/groupingkey.go | 4 ++++ .../logs/internal/mobile/groupingkey_test.go | 19 +++++++++++-------- .../mobile/testdata/curated_stacktrace1.txt | 1 + .../{stacktrace3.txt => stacktrace2_c.txt} | 0 4 files changed, 16 insertions(+), 8 deletions(-) create mode 100644 enrichments/logs/internal/mobile/testdata/curated_stacktrace1.txt rename enrichments/logs/internal/mobile/testdata/{stacktrace3.txt => stacktrace2_c.txt} (100%) diff --git a/enrichments/logs/internal/mobile/groupingkey.go b/enrichments/logs/internal/mobile/groupingkey.go index a32f75c..85f4b71 100644 --- a/enrichments/logs/internal/mobile/groupingkey.go +++ b/enrichments/logs/internal/mobile/groupingkey.go @@ -1 +1,5 @@ package mobile + +func curateStacktrace(s string) string { + return s +} diff --git a/enrichments/logs/internal/mobile/groupingkey_test.go b/enrichments/logs/internal/mobile/groupingkey_test.go index cd86ada..f5a26e6 100644 --- a/enrichments/logs/internal/mobile/groupingkey_test.go +++ b/enrichments/logs/internal/mobile/groupingkey_test.go @@ -1,7 +1,6 @@ package mobile import ( - "fmt" "os" "path/filepath" "testing" @@ -9,13 +8,17 @@ import ( "github.com/stretchr/testify/assert" ) -func TestCreateGroupingKeyForStacktrace(t *testing.T) { - stacktrace_path := filepath.Join("testdata", "stacktrace1_a.txt") - bytes, err := os.ReadFile(stacktrace_path) +func TestCurateStacktrace(t *testing.T) { + stacktrace := readTestFile(t, "stacktrace1_a.txt") + curated_stacktrace := readTestFile(t, "curated_stacktrace1.txt") + + assert.Equal(t, curated_stacktrace, curateStacktrace(stacktrace)) +} + +func readTestFile(t *testing.T, file_name string) string { + bytes, err := os.ReadFile(filepath.Join("testdata", file_name)) if err != nil { - assert.Fail(t, "Could not read test file") + t.Fatalf("Could not read test file '%v'", file_name) } - stacktrace := string(bytes) - - fmt.Printf("The stacktrace: %s", stacktrace) + return string(bytes) } diff --git a/enrichments/logs/internal/mobile/testdata/curated_stacktrace1.txt b/enrichments/logs/internal/mobile/testdata/curated_stacktrace1.txt new file mode 100644 index 0000000..01b6d06 --- /dev/null +++ b/enrichments/logs/internal/mobile/testdata/curated_stacktrace1.txt @@ -0,0 +1 @@ +java.lang.IllegalArgumentExceptionatorg.example.SomeClass.someMethod(SomeClass.kt:8)atorg.example.Main.main(Main.kt:9) \ No newline at end of file diff --git a/enrichments/logs/internal/mobile/testdata/stacktrace3.txt b/enrichments/logs/internal/mobile/testdata/stacktrace2_c.txt similarity index 100% rename from enrichments/logs/internal/mobile/testdata/stacktrace3.txt rename to enrichments/logs/internal/mobile/testdata/stacktrace2_c.txt From 251b2e627047b28e774408f6c428c02034e4838b Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Wed, 21 May 2025 17:58:21 +0200 Subject: [PATCH 26/67] Curating stacktraces --- enrichments/logs/internal/mobile/groupingkey.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/enrichments/logs/internal/mobile/groupingkey.go b/enrichments/logs/internal/mobile/groupingkey.go index 85f4b71..e93b2f8 100644 --- a/enrichments/logs/internal/mobile/groupingkey.go +++ b/enrichments/logs/internal/mobile/groupingkey.go @@ -1,5 +1,8 @@ package mobile +import "regexp" + func curateStacktrace(s string) string { - return s + unwanted_pattern := regexp.MustCompile("(:\\s.+)|[\r\n\\s]+") + return unwanted_pattern.ReplaceAllString(s, "") } From 7a4c01e7f81044fb7316158bfd4bedf477e55f60 Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Wed, 21 May 2025 18:12:08 +0200 Subject: [PATCH 27/67] Validating curating different types of stacktraces --- .../logs/internal/mobile/groupingkey_test.go | 21 +++++++++++++++---- .../mobile/testdata/curated_stacktrace2.txt | 1 + 2 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 enrichments/logs/internal/mobile/testdata/curated_stacktrace2.txt diff --git a/enrichments/logs/internal/mobile/groupingkey_test.go b/enrichments/logs/internal/mobile/groupingkey_test.go index f5a26e6..8c7f6ba 100644 --- a/enrichments/logs/internal/mobile/groupingkey_test.go +++ b/enrichments/logs/internal/mobile/groupingkey_test.go @@ -9,10 +9,23 @@ import ( ) func TestCurateStacktrace(t *testing.T) { - stacktrace := readTestFile(t, "stacktrace1_a.txt") - curated_stacktrace := readTestFile(t, "curated_stacktrace1.txt") - - assert.Equal(t, curated_stacktrace, curateStacktrace(stacktrace)) + for _, tc := range []struct { + stacktraces []string + curated string + }{ + { + stacktraces: []string{readTestFile(t, "stacktrace1_a.txt"), readTestFile(t, "stacktrace1_b.txt")}, + curated: readTestFile(t, "curated_stacktrace1.txt"), + }, + { + stacktraces: []string{readTestFile(t, "stacktrace2_a.txt"), readTestFile(t, "stacktrace2_b.txt"), readTestFile(t, "stacktrace2_c.txt")}, + curated: readTestFile(t, "curated_stacktrace2.txt"), + }, + } { + for i := 0; i < len(tc.stacktraces); i++ { + assert.Equal(t, tc.curated, curateStacktrace(tc.stacktraces[i])) + } + } } func readTestFile(t *testing.T, file_name string) string { diff --git a/enrichments/logs/internal/mobile/testdata/curated_stacktrace2.txt b/enrichments/logs/internal/mobile/testdata/curated_stacktrace2.txt new file mode 100644 index 0000000..479116b --- /dev/null +++ b/enrichments/logs/internal/mobile/testdata/curated_stacktrace2.txt @@ -0,0 +1 @@ +java.lang.RuntimeExceptionatorg.example.SomeClass.callingOtherMethod(SomeClass.kt:16)atorg.example.Main.main(Main.kt:9)Causedbyatorg.example.SomeOtherClass.someOtherMethod(SomeOtherClass.kt:8)atorg.example.SomeClass.callingOtherMethod(SomeClass.kt:14)...1more \ No newline at end of file From 14e1022963181de8d42b9f8b52a404b57bf5e975 Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Wed, 21 May 2025 18:25:43 +0200 Subject: [PATCH 28/67] Updating tests --- enrichments/logs/internal/mobile/groupingkey_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/enrichments/logs/internal/mobile/groupingkey_test.go b/enrichments/logs/internal/mobile/groupingkey_test.go index 8c7f6ba..9a0fdaf 100644 --- a/enrichments/logs/internal/mobile/groupingkey_test.go +++ b/enrichments/logs/internal/mobile/groupingkey_test.go @@ -22,8 +22,8 @@ func TestCurateStacktrace(t *testing.T) { curated: readTestFile(t, "curated_stacktrace2.txt"), }, } { - for i := 0; i < len(tc.stacktraces); i++ { - assert.Equal(t, tc.curated, curateStacktrace(tc.stacktraces[i])) + for _, stacktrace := range tc.stacktraces { + assert.Equal(t, tc.curated, curateStacktrace(stacktrace)) } } } From 8e2d593a3092807492590685ba45139ecbb02183 Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Thu, 22 May 2025 07:00:49 +0200 Subject: [PATCH 29/67] Creating grouping key for java stacktraces --- .../logs/internal/mobile/groupingkey.go | 17 ++++++++++++---- .../logs/internal/mobile/groupingkey_test.go | 20 +++++++++++++++++++ 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/enrichments/logs/internal/mobile/groupingkey.go b/enrichments/logs/internal/mobile/groupingkey.go index e93b2f8..6e89ed7 100644 --- a/enrichments/logs/internal/mobile/groupingkey.go +++ b/enrichments/logs/internal/mobile/groupingkey.go @@ -1,8 +1,17 @@ package mobile -import "regexp" +import ( + "crypto/sha256" + "encoding/hex" + "regexp" +) -func curateStacktrace(s string) string { - unwanted_pattern := regexp.MustCompile("(:\\s.+)|[\r\n\\s]+") - return unwanted_pattern.ReplaceAllString(s, "") +func CreateGroupingKey(stacktrace string) string { + hash_bytes := sha256.Sum256([]byte(curateStacktrace(stacktrace))) + return hex.EncodeToString(hash_bytes[:]) +} + +func curateStacktrace(stacktrace string) string { + unwanted_pattern := regexp.MustCompile(`(:\s.+)|[\r\n\s]+`) + return unwanted_pattern.ReplaceAllString(stacktrace, "") } diff --git a/enrichments/logs/internal/mobile/groupingkey_test.go b/enrichments/logs/internal/mobile/groupingkey_test.go index 9a0fdaf..f5d9d1c 100644 --- a/enrichments/logs/internal/mobile/groupingkey_test.go +++ b/enrichments/logs/internal/mobile/groupingkey_test.go @@ -28,6 +28,26 @@ func TestCurateStacktrace(t *testing.T) { } } +func TestCreateGroupingKey(t *testing.T) { + for _, tc := range []struct { + stacktraces []string + expected_id string + }{ + { + stacktraces: []string{readTestFile(t, "stacktrace1_a.txt"), readTestFile(t, "stacktrace1_b.txt")}, + expected_id: "fbda93aa3a0ccb785da705ff03697bb7393cb0738e31c596e797b16ea2ba2f02", + }, + { + stacktraces: []string{readTestFile(t, "stacktrace2_a.txt"), readTestFile(t, "stacktrace2_b.txt"), readTestFile(t, "stacktrace2_c.txt")}, + expected_id: "10b6726bc6d9aab69389b8b5dfbd9df1a6e08db75b0777b4f2d0456adeaed50e", + }, + } { + for _, stacktrace := range tc.stacktraces { + assert.Equal(t, tc.expected_id, CreateGroupingKey(stacktrace)) + } + } +} + func readTestFile(t *testing.T, file_name string) string { bytes, err := os.ReadFile(filepath.Join("testdata", file_name)) if err != nil { From 19a946039e9f5f04041ff8b7b2e4bb2f09cd8833 Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Thu, 22 May 2025 09:26:44 +0200 Subject: [PATCH 30/67] Updating tests --- enrichments/logs/internal/mobile/groupingkey_test.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/enrichments/logs/internal/mobile/groupingkey_test.go b/enrichments/logs/internal/mobile/groupingkey_test.go index f5d9d1c..eacc058 100644 --- a/enrichments/logs/internal/mobile/groupingkey_test.go +++ b/enrichments/logs/internal/mobile/groupingkey_test.go @@ -6,6 +6,7 @@ import ( "testing" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) func TestCurateStacktrace(t *testing.T) { @@ -50,8 +51,6 @@ func TestCreateGroupingKey(t *testing.T) { func readTestFile(t *testing.T, file_name string) string { bytes, err := os.ReadFile(filepath.Join("testdata", file_name)) - if err != nil { - t.Fatalf("Could not read test file '%v'", file_name) - } + require.NoError(t, err) return string(bytes) } From f34a28c0be0d64fedacbe8dd0fb62514b491ef83 Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Thu, 22 May 2025 09:48:00 +0200 Subject: [PATCH 31/67] Adding grouping_key to crash events --- enrichments/logs/internal/mobile/event.go | 4 ++++ .../logs/internal/mobile/event_test.go | 3 ++- .../logs/internal/mobile/groupingkey_test.go | 22 ++++++++++++++----- .../mobile/testdata/stacktrace1_a.txt | 4 +--- 4 files changed, 23 insertions(+), 10 deletions(-) diff --git a/enrichments/logs/internal/mobile/event.go b/enrichments/logs/internal/mobile/event.go index a0bce39..ac60ddc 100644 --- a/enrichments/logs/internal/mobile/event.go +++ b/enrichments/logs/internal/mobile/event.go @@ -15,6 +15,10 @@ func EnrichLogEvent(logRecord plog.LogRecord) { if id, err := newUniqueID(); err == nil { logRecord.Attributes().PutStr("error.id", id) } + stacktrace, ok := logRecord.Attributes().Get("exception.stacktrace") + if ok { + logRecord.Attributes().PutStr("error.grouping_key", CreateGroupingKey(stacktrace.AsString())) + } } func newUniqueID() (string, error) { diff --git a/enrichments/logs/internal/mobile/event_test.go b/enrichments/logs/internal/mobile/event_test.go index 1dd5647..e36605a 100644 --- a/enrichments/logs/internal/mobile/event_test.go +++ b/enrichments/logs/internal/mobile/event_test.go @@ -18,7 +18,7 @@ func TestEnrichCrashEvents(t *testing.T) { logRecord.Attributes().PutStr("event.name", "device.crash") logRecord.Attributes().PutStr("exception.message", "Exception message") logRecord.Attributes().PutStr("exception.type", "java.lang.RuntimeException") - logRecord.Attributes().PutStr("exception.stacktrace", `Exception in thread "main" java.lang.RuntimeException: Test exception\\n at com.example.GenerateTrace.methodB(GenerateTrace.java:13)\\n at com.example.GenerateTrace.methodA(GenerateTrace.java:9)\\n at com.example.GenerateTrace.main(GenerateTrace.java:5)`) + logRecord.Attributes().PutStr("exception.stacktrace", "Exception in thread \"main\" java.lang.RuntimeException: Test exception\n at com.example.GenerateTrace.methodB(GenerateTrace.java:13)\n at com.example.GenerateTrace.methodA(GenerateTrace.java:9)\n at com.example.GenerateTrace.main(GenerateTrace.java:5)") expectedLogRecord := plog.NewLogRecord() logRecord.CopyTo(expectedLogRecord) @@ -26,6 +26,7 @@ func TestEnrichCrashEvents(t *testing.T) { expectedLogRecord.Attributes().PutStr("processor.event", "error") expectedLogRecord.Attributes().PutInt("timestamp.us", timestamp.AsTime().UnixMicro()) + expectedLogRecord.Attributes().PutStr("error.grouping_key", "96b957020e07ac5c1ed7f86e7df9e3e393ede1284c2c52cb4e8e64f902d37833") assert.Empty(t, cmp.Diff(logRecord.Attributes().AsRaw(), expectedLogRecord.Attributes().AsRaw(), ignoreMapKey("error.id"))) errorId, ok := logRecord.Attributes().Get("error.id") diff --git a/enrichments/logs/internal/mobile/groupingkey_test.go b/enrichments/logs/internal/mobile/groupingkey_test.go index eacc058..2c2bb8b 100644 --- a/enrichments/logs/internal/mobile/groupingkey_test.go +++ b/enrichments/logs/internal/mobile/groupingkey_test.go @@ -11,41 +11,51 @@ import ( func TestCurateStacktrace(t *testing.T) { for _, tc := range []struct { + name string stacktraces []string curated string }{ { + name: "Standalone stacktrace", stacktraces: []string{readTestFile(t, "stacktrace1_a.txt"), readTestFile(t, "stacktrace1_b.txt")}, curated: readTestFile(t, "curated_stacktrace1.txt"), }, { + name: "Stacktrace with cause", stacktraces: []string{readTestFile(t, "stacktrace2_a.txt"), readTestFile(t, "stacktrace2_b.txt"), readTestFile(t, "stacktrace2_c.txt")}, curated: readTestFile(t, "curated_stacktrace2.txt"), }, } { - for _, stacktrace := range tc.stacktraces { - assert.Equal(t, tc.curated, curateStacktrace(stacktrace)) - } + t.Run(tc.name, func(t *testing.T) { + for _, stacktrace := range tc.stacktraces { + assert.Equal(t, tc.curated, curateStacktrace(stacktrace)) + } + }) } } func TestCreateGroupingKey(t *testing.T) { for _, tc := range []struct { + name string stacktraces []string expected_id string }{ { + name: "Standalone stacktrace", stacktraces: []string{readTestFile(t, "stacktrace1_a.txt"), readTestFile(t, "stacktrace1_b.txt")}, expected_id: "fbda93aa3a0ccb785da705ff03697bb7393cb0738e31c596e797b16ea2ba2f02", }, { + name: "Stacktrace with cause", stacktraces: []string{readTestFile(t, "stacktrace2_a.txt"), readTestFile(t, "stacktrace2_b.txt"), readTestFile(t, "stacktrace2_c.txt")}, expected_id: "10b6726bc6d9aab69389b8b5dfbd9df1a6e08db75b0777b4f2d0456adeaed50e", }, } { - for _, stacktrace := range tc.stacktraces { - assert.Equal(t, tc.expected_id, CreateGroupingKey(stacktrace)) - } + t.Run(tc.name, func(t *testing.T) { + for _, stacktrace := range tc.stacktraces { + assert.Equal(t, tc.expected_id, CreateGroupingKey(stacktrace)) + } + }) } } diff --git a/enrichments/logs/internal/mobile/testdata/stacktrace1_a.txt b/enrichments/logs/internal/mobile/testdata/stacktrace1_a.txt index 5349157..73dd9a2 100644 --- a/enrichments/logs/internal/mobile/testdata/stacktrace1_a.txt +++ b/enrichments/logs/internal/mobile/testdata/stacktrace1_a.txt @@ -1,3 +1 @@ -java.lang.IllegalArgumentException: The arg 'abc' is not valid - at org.example.SomeClass.someMethod(SomeClass.kt:8) - at org.example.Main.main(Main.kt:9) +Exceptioninthread"main"java.lang.RuntimeExceptionatcom.example.GenerateTrace.methodB(GenerateTrace.java:13)atcom.example.GenerateTrace.methodA(GenerateTrace.java:9)atcom.example.GenerateTrace.main(GenerateTrace.java:5) \ No newline at end of file From e8bcd0489fd2ae0666cdfff4ef0f39b1c32d4231 Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Thu, 22 May 2025 10:07:42 +0200 Subject: [PATCH 32/67] Adding error.type crash to crash events --- enrichments/logs/internal/mobile/event.go | 1 + enrichments/logs/internal/mobile/event_test.go | 1 + 2 files changed, 2 insertions(+) diff --git a/enrichments/logs/internal/mobile/event.go b/enrichments/logs/internal/mobile/event.go index ac60ddc..2db275e 100644 --- a/enrichments/logs/internal/mobile/event.go +++ b/enrichments/logs/internal/mobile/event.go @@ -19,6 +19,7 @@ func EnrichLogEvent(logRecord plog.LogRecord) { if ok { logRecord.Attributes().PutStr("error.grouping_key", CreateGroupingKey(stacktrace.AsString())) } + logRecord.Attributes().PutStr("error.type", "crash") } func newUniqueID() (string, error) { diff --git a/enrichments/logs/internal/mobile/event_test.go b/enrichments/logs/internal/mobile/event_test.go index e36605a..d7c1702 100644 --- a/enrichments/logs/internal/mobile/event_test.go +++ b/enrichments/logs/internal/mobile/event_test.go @@ -27,6 +27,7 @@ func TestEnrichCrashEvents(t *testing.T) { expectedLogRecord.Attributes().PutStr("processor.event", "error") expectedLogRecord.Attributes().PutInt("timestamp.us", timestamp.AsTime().UnixMicro()) expectedLogRecord.Attributes().PutStr("error.grouping_key", "96b957020e07ac5c1ed7f86e7df9e3e393ede1284c2c52cb4e8e64f902d37833") + expectedLogRecord.Attributes().PutStr("error.type", "crash") assert.Empty(t, cmp.Diff(logRecord.Attributes().AsRaw(), expectedLogRecord.Attributes().AsRaw(), ignoreMapKey("error.id"))) errorId, ok := logRecord.Attributes().Get("error.id") From 63b629df90ddaf87125d2d7af05c870a700d479a Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Thu, 22 May 2025 15:46:35 +0200 Subject: [PATCH 33/67] Using camelcase for variable names --- enrichments/logs/internal/mobile/groupingkey.go | 8 ++++---- enrichments/logs/internal/mobile/groupingkey_test.go | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/enrichments/logs/internal/mobile/groupingkey.go b/enrichments/logs/internal/mobile/groupingkey.go index 6e89ed7..e10cebc 100644 --- a/enrichments/logs/internal/mobile/groupingkey.go +++ b/enrichments/logs/internal/mobile/groupingkey.go @@ -7,11 +7,11 @@ import ( ) func CreateGroupingKey(stacktrace string) string { - hash_bytes := sha256.Sum256([]byte(curateStacktrace(stacktrace))) - return hex.EncodeToString(hash_bytes[:]) + hashBytes := sha256.Sum256([]byte(curateStacktrace(stacktrace))) + return hex.EncodeToString(hashBytes[:]) } func curateStacktrace(stacktrace string) string { - unwanted_pattern := regexp.MustCompile(`(:\s.+)|[\r\n\s]+`) - return unwanted_pattern.ReplaceAllString(stacktrace, "") + unwantedPattern := regexp.MustCompile(`(:\s.+)|[\r\n\s]+`) + return unwantedPattern.ReplaceAllString(stacktrace, "") } diff --git a/enrichments/logs/internal/mobile/groupingkey_test.go b/enrichments/logs/internal/mobile/groupingkey_test.go index 2c2bb8b..e3112b1 100644 --- a/enrichments/logs/internal/mobile/groupingkey_test.go +++ b/enrichments/logs/internal/mobile/groupingkey_test.go @@ -38,29 +38,29 @@ func TestCreateGroupingKey(t *testing.T) { for _, tc := range []struct { name string stacktraces []string - expected_id string + expectedId string }{ { name: "Standalone stacktrace", stacktraces: []string{readTestFile(t, "stacktrace1_a.txt"), readTestFile(t, "stacktrace1_b.txt")}, - expected_id: "fbda93aa3a0ccb785da705ff03697bb7393cb0738e31c596e797b16ea2ba2f02", + expectedId: "fbda93aa3a0ccb785da705ff03697bb7393cb0738e31c596e797b16ea2ba2f02", }, { name: "Stacktrace with cause", stacktraces: []string{readTestFile(t, "stacktrace2_a.txt"), readTestFile(t, "stacktrace2_b.txt"), readTestFile(t, "stacktrace2_c.txt")}, - expected_id: "10b6726bc6d9aab69389b8b5dfbd9df1a6e08db75b0777b4f2d0456adeaed50e", + expectedId: "10b6726bc6d9aab69389b8b5dfbd9df1a6e08db75b0777b4f2d0456adeaed50e", }, } { t.Run(tc.name, func(t *testing.T) { for _, stacktrace := range tc.stacktraces { - assert.Equal(t, tc.expected_id, CreateGroupingKey(stacktrace)) + assert.Equal(t, tc.expectedId, CreateGroupingKey(stacktrace)) } }) } } -func readTestFile(t *testing.T, file_name string) string { - bytes, err := os.ReadFile(filepath.Join("testdata", file_name)) +func readTestFile(t *testing.T, fileName string) string { + bytes, err := os.ReadFile(filepath.Join("testdata", fileName)) require.NoError(t, err) return string(bytes) } From 010762818cea91858f3f4f20bf7b7bd090495477 Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Thu, 22 May 2025 16:13:57 +0200 Subject: [PATCH 34/67] Updating tests --- .../logs/internal/mobile/event_test.go | 63 ++++++++++++------- .../logs/internal/mobile/groupingkey_test.go | 8 +-- 2 files changed, 46 insertions(+), 25 deletions(-) diff --git a/enrichments/logs/internal/mobile/event_test.go b/enrichments/logs/internal/mobile/event_test.go index d7c1702..51f7cb8 100644 --- a/enrichments/logs/internal/mobile/event_test.go +++ b/enrichments/logs/internal/mobile/event_test.go @@ -4,6 +4,8 @@ import ( "testing" "time" + "maps" + "github.com/google/go-cmp/cmp" "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/pdata/pcommon" @@ -13,28 +15,47 @@ import ( func TestEnrichCrashEvents(t *testing.T) { now := time.Unix(3600, 0) timestamp := pcommon.NewTimestampFromTime(now) - logRecord := plog.NewLogRecord() - logRecord.SetTimestamp(timestamp) - logRecord.Attributes().PutStr("event.name", "device.crash") - logRecord.Attributes().PutStr("exception.message", "Exception message") - logRecord.Attributes().PutStr("exception.type", "java.lang.RuntimeException") - logRecord.Attributes().PutStr("exception.stacktrace", "Exception in thread \"main\" java.lang.RuntimeException: Test exception\n at com.example.GenerateTrace.methodB(GenerateTrace.java:13)\n at com.example.GenerateTrace.methodA(GenerateTrace.java:9)\n at com.example.GenerateTrace.main(GenerateTrace.java:5)") - expectedLogRecord := plog.NewLogRecord() - logRecord.CopyTo(expectedLogRecord) - - EnrichLogEvent(logRecord) - - expectedLogRecord.Attributes().PutStr("processor.event", "error") - expectedLogRecord.Attributes().PutInt("timestamp.us", timestamp.AsTime().UnixMicro()) - expectedLogRecord.Attributes().PutStr("error.grouping_key", "96b957020e07ac5c1ed7f86e7df9e3e393ede1284c2c52cb4e8e64f902d37833") - expectedLogRecord.Attributes().PutStr("error.type", "crash") - - assert.Empty(t, cmp.Diff(logRecord.Attributes().AsRaw(), expectedLogRecord.Attributes().AsRaw(), ignoreMapKey("error.id"))) - errorId, ok := logRecord.Attributes().Get("error.id") - if !ok { - assert.Fail(t, "error.id not found") + stacktrace := "Exception in thread \"main\" java.lang.RuntimeException: Test exception\n at com.example.GenerateTrace.methodB(GenerateTrace.java:13)\n at com.example.GenerateTrace.methodA(GenerateTrace.java:9)\n at com.example.GenerateTrace.main(GenerateTrace.java:5)" + + for _, tc := range []struct { + name string + input func() plog.LogRecord + expectedAttributes map[string]any + }{ + { + name: "crash_event", + input: func() plog.LogRecord { + logRecord := plog.NewLogRecord() + logRecord.SetTimestamp(timestamp) + logRecord.Attributes().PutStr("event.name", "device.crash") + logRecord.Attributes().PutStr("exception.message", "Exception message") + logRecord.Attributes().PutStr("exception.type", "java.lang.RuntimeException") + logRecord.Attributes().PutStr("exception.stacktrace", stacktrace) + return logRecord + }, + expectedAttributes: map[string]any{ + "processor.event": "error", + "timestamp.us": timestamp.AsTime().UnixMicro(), + "error.grouping_key": "96b957020e07ac5c1ed7f86e7df9e3e393ede1284c2c52cb4e8e64f902d37833", + "error.type": "crash", + }, + }, + } { + t.Run(tc.name, func(t *testing.T) { + inputLogRecord := tc.input() + + maps.Copy(tc.expectedAttributes, inputLogRecord.Attributes().AsRaw()) + + EnrichLogEvent(inputLogRecord) + + assert.Empty(t, cmp.Diff(inputLogRecord.Attributes().AsRaw(), tc.expectedAttributes, ignoreMapKey("error.id"))) + errorId, ok := inputLogRecord.Attributes().Get("error.id") + if !ok { + assert.Fail(t, "error.id not found") + } + assert.Equal(t, 32, len(errorId.AsString())) + }) } - assert.Equal(t, 32, len(errorId.AsString())) } func ignoreMapKey(k string) cmp.Option { diff --git a/enrichments/logs/internal/mobile/groupingkey_test.go b/enrichments/logs/internal/mobile/groupingkey_test.go index e3112b1..0509a5d 100644 --- a/enrichments/logs/internal/mobile/groupingkey_test.go +++ b/enrichments/logs/internal/mobile/groupingkey_test.go @@ -16,12 +16,12 @@ func TestCurateStacktrace(t *testing.T) { curated string }{ { - name: "Standalone stacktrace", + name: "standalone_stacktrace", stacktraces: []string{readTestFile(t, "stacktrace1_a.txt"), readTestFile(t, "stacktrace1_b.txt")}, curated: readTestFile(t, "curated_stacktrace1.txt"), }, { - name: "Stacktrace with cause", + name: "stacktrace_with_cause", stacktraces: []string{readTestFile(t, "stacktrace2_a.txt"), readTestFile(t, "stacktrace2_b.txt"), readTestFile(t, "stacktrace2_c.txt")}, curated: readTestFile(t, "curated_stacktrace2.txt"), }, @@ -41,12 +41,12 @@ func TestCreateGroupingKey(t *testing.T) { expectedId string }{ { - name: "Standalone stacktrace", + name: "standalone_stacktrace", stacktraces: []string{readTestFile(t, "stacktrace1_a.txt"), readTestFile(t, "stacktrace1_b.txt")}, expectedId: "fbda93aa3a0ccb785da705ff03697bb7393cb0738e31c596e797b16ea2ba2f02", }, { - name: "Stacktrace with cause", + name: "stacktrace_with_cause", stacktraces: []string{readTestFile(t, "stacktrace2_a.txt"), readTestFile(t, "stacktrace2_b.txt"), readTestFile(t, "stacktrace2_c.txt")}, expectedId: "10b6726bc6d9aab69389b8b5dfbd9df1a6e08db75b0777b4f2d0456adeaed50e", }, From e7b8f8a39e72ba072f49f29eae3a3441dab5aaac Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Thu, 22 May 2025 16:23:25 +0200 Subject: [PATCH 35/67] Using observerdtimestamp when timestamp is not available --- enrichments/logs/internal/mobile/event.go | 6 ++++- .../logs/internal/mobile/event_test.go | 23 +++++++++++++++++-- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/enrichments/logs/internal/mobile/event.go b/enrichments/logs/internal/mobile/event.go index 2db275e..5c01b08 100644 --- a/enrichments/logs/internal/mobile/event.go +++ b/enrichments/logs/internal/mobile/event.go @@ -10,8 +10,12 @@ import ( ) func EnrichLogEvent(logRecord plog.LogRecord) { + timestamp := logRecord.Timestamp() + if timestamp == 0 { + timestamp = logRecord.ObservedTimestamp() + } logRecord.Attributes().PutStr(elasticattr.ProcessorEvent, "error") - logRecord.Attributes().PutInt(elasticattr.TimestampUs, elasticattr.GetTimestampUs(logRecord.Timestamp())) + logRecord.Attributes().PutInt(elasticattr.TimestampUs, elasticattr.GetTimestampUs(timestamp)) if id, err := newUniqueID(); err == nil { logRecord.Attributes().PutStr("error.id", id) } diff --git a/enrichments/logs/internal/mobile/event_test.go b/enrichments/logs/internal/mobile/event_test.go index 51f7cb8..3eac784 100644 --- a/enrichments/logs/internal/mobile/event_test.go +++ b/enrichments/logs/internal/mobile/event_test.go @@ -12,10 +12,11 @@ import ( "go.opentelemetry.io/collector/pdata/plog" ) -func TestEnrichCrashEvents(t *testing.T) { +func TestEnrichEvents(t *testing.T) { now := time.Unix(3600, 0) timestamp := pcommon.NewTimestampFromTime(now) stacktrace := "Exception in thread \"main\" java.lang.RuntimeException: Test exception\n at com.example.GenerateTrace.methodB(GenerateTrace.java:13)\n at com.example.GenerateTrace.methodA(GenerateTrace.java:9)\n at com.example.GenerateTrace.main(GenerateTrace.java:5)" + stacktraceHash := "96b957020e07ac5c1ed7f86e7df9e3e393ede1284c2c52cb4e8e64f902d37833" for _, tc := range []struct { name string @@ -36,7 +37,25 @@ func TestEnrichCrashEvents(t *testing.T) { expectedAttributes: map[string]any{ "processor.event": "error", "timestamp.us": timestamp.AsTime().UnixMicro(), - "error.grouping_key": "96b957020e07ac5c1ed7f86e7df9e3e393ede1284c2c52cb4e8e64f902d37833", + "error.grouping_key": stacktraceHash, + "error.type": "crash", + }, + }, + { + name: "crash_event_without_timestamp", + input: func() plog.LogRecord { + logRecord := plog.NewLogRecord() + logRecord.SetObservedTimestamp(timestamp) + logRecord.Attributes().PutStr("event.name", "device.crash") + logRecord.Attributes().PutStr("exception.message", "Exception message") + logRecord.Attributes().PutStr("exception.type", "java.lang.RuntimeException") + logRecord.Attributes().PutStr("exception.stacktrace", stacktrace) + return logRecord + }, + expectedAttributes: map[string]any{ + "processor.event": "error", + "timestamp.us": timestamp.AsTime().UnixMicro(), + "error.grouping_key": stacktraceHash, "error.type": "crash", }, }, From 4975a425514410e63b3543274ec5a318ea854c14 Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Fri, 23 May 2025 05:05:53 +0200 Subject: [PATCH 36/67] Adding validation for non-crash events --- .../logs/internal/mobile/event_test.go | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/enrichments/logs/internal/mobile/event_test.go b/enrichments/logs/internal/mobile/event_test.go index 3eac784..956e03b 100644 --- a/enrichments/logs/internal/mobile/event_test.go +++ b/enrichments/logs/internal/mobile/event_test.go @@ -59,6 +59,15 @@ func TestEnrichEvents(t *testing.T) { "error.type": "crash", }, }, + { + name: "non_crash_event", + input: func() plog.LogRecord { + logRecord := plog.NewLogRecord() + logRecord.Attributes().PutStr("event.name", "othername") + return logRecord + }, + expectedAttributes: map[string]any{}, + }, } { t.Run(tc.name, func(t *testing.T) { inputLogRecord := tc.input() @@ -68,11 +77,14 @@ func TestEnrichEvents(t *testing.T) { EnrichLogEvent(inputLogRecord) assert.Empty(t, cmp.Diff(inputLogRecord.Attributes().AsRaw(), tc.expectedAttributes, ignoreMapKey("error.id"))) - errorId, ok := inputLogRecord.Attributes().Get("error.id") - if !ok { - assert.Fail(t, "error.id not found") + eventName, ok := inputLogRecord.Attributes().Get("event.name") + if ok && eventName.AsString() == "device.crash" { + errorId, ok := inputLogRecord.Attributes().Get("error.id") + if !ok { + assert.Fail(t, "error.id not found") + } + assert.Equal(t, 32, len(errorId.AsString())) } - assert.Equal(t, 32, len(errorId.AsString())) }) } } From 2560274934653ea3a5d322b200f161832e7af71f Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Fri, 23 May 2025 06:21:56 +0200 Subject: [PATCH 37/67] Validating only events are sent to the event enricher --- enrichments/logs/internal/mobile/event.go | 10 +++- .../logs/internal/mobile/event_test.go | 29 ++++++----- enrichments/logs/logs.go | 17 ++++++- enrichments/logs/logs_test.go | 49 ++++++++++++++++--- enrichments/logs/testdata/logs.yaml | 9 ++++ 5 files changed, 94 insertions(+), 20 deletions(-) diff --git a/enrichments/logs/internal/mobile/event.go b/enrichments/logs/internal/mobile/event.go index 5c01b08..da2aac6 100644 --- a/enrichments/logs/internal/mobile/event.go +++ b/enrichments/logs/internal/mobile/event.go @@ -9,7 +9,15 @@ import ( "go.opentelemetry.io/collector/pdata/plog" ) -func EnrichLogEvent(logRecord plog.LogRecord) { +func EnrichLogEvent(eventName string, logRecord plog.LogRecord) { + logRecord.Attributes().PutStr("event.kind", "event") + + if eventName == "device.crash" { + enrichCrashEvent(logRecord) + } +} + +func enrichCrashEvent(logRecord plog.LogRecord) { timestamp := logRecord.Timestamp() if timestamp == 0 { timestamp = logRecord.ObservedTimestamp() diff --git a/enrichments/logs/internal/mobile/event_test.go b/enrichments/logs/internal/mobile/event_test.go index 956e03b..9f7d801 100644 --- a/enrichments/logs/internal/mobile/event_test.go +++ b/enrichments/logs/internal/mobile/event_test.go @@ -20,11 +20,13 @@ func TestEnrichEvents(t *testing.T) { for _, tc := range []struct { name string + eventName string input func() plog.LogRecord expectedAttributes map[string]any }{ { - name: "crash_event", + name: "crash_event", + eventName: "device.crash", input: func() plog.LogRecord { logRecord := plog.NewLogRecord() logRecord.SetTimestamp(timestamp) @@ -39,10 +41,12 @@ func TestEnrichEvents(t *testing.T) { "timestamp.us": timestamp.AsTime().UnixMicro(), "error.grouping_key": stacktraceHash, "error.type": "crash", + "event.kind": "event", }, }, { - name: "crash_event_without_timestamp", + name: "crash_event_without_timestamp", + eventName: "device.crash", input: func() plog.LogRecord { logRecord := plog.NewLogRecord() logRecord.SetObservedTimestamp(timestamp) @@ -57,16 +61,20 @@ func TestEnrichEvents(t *testing.T) { "timestamp.us": timestamp.AsTime().UnixMicro(), "error.grouping_key": stacktraceHash, "error.type": "crash", + "event.kind": "event", }, }, { - name: "non_crash_event", + name: "non_crash_event", + eventName: "othername", input: func() plog.LogRecord { logRecord := plog.NewLogRecord() logRecord.Attributes().PutStr("event.name", "othername") return logRecord }, - expectedAttributes: map[string]any{}, + expectedAttributes: map[string]any{ + "event.kind": "event", + }, }, } { t.Run(tc.name, func(t *testing.T) { @@ -74,16 +82,15 @@ func TestEnrichEvents(t *testing.T) { maps.Copy(tc.expectedAttributes, inputLogRecord.Attributes().AsRaw()) - EnrichLogEvent(inputLogRecord) + EnrichLogEvent(tc.eventName, inputLogRecord) assert.Empty(t, cmp.Diff(inputLogRecord.Attributes().AsRaw(), tc.expectedAttributes, ignoreMapKey("error.id"))) - eventName, ok := inputLogRecord.Attributes().Get("event.name") - if ok && eventName.AsString() == "device.crash" { - errorId, ok := inputLogRecord.Attributes().Get("error.id") - if !ok { - assert.Fail(t, "error.id not found") - } + errorId, ok := inputLogRecord.Attributes().Get("error.id") + if ok { + assert.Equal(t, "device.crash", tc.eventName) assert.Equal(t, 32, len(errorId.AsString())) + } else { + assert.NotEqual(t, "device.crash", tc.eventName) } }) } diff --git a/enrichments/logs/logs.go b/enrichments/logs/logs.go index 696da99..41ff282 100644 --- a/enrichments/logs/logs.go +++ b/enrichments/logs/logs.go @@ -29,8 +29,23 @@ func (e *Enricher) Enrich(logs plog.Logs) { for j := 0; j < scopeLogs.Len(); j++ { logRecords := scopeLogs.At(j).LogRecords() for k := 0; k < logRecords.Len(); k++ { - mobile.EnrichLogEvent(logRecords.At(k)) + logRecord := logRecords.At(k) + eventName, ok := getEventName(logRecord) + if ok { + mobile.EnrichLogEvent(eventName, logRecord) + } } } } } + +func getEventName(logRecord plog.LogRecord) (string, bool) { + if logRecord.EventName() != "" { + return logRecord.EventName(), true + } + attributeValue, ok := logRecord.Attributes().Get("event.name") + if ok { + return attributeValue.AsString(), true + } + return "", false +} diff --git a/enrichments/logs/logs_test.go b/enrichments/logs/logs_test.go index ebb79d3..cd2d87c 100644 --- a/enrichments/logs/logs_test.go +++ b/enrichments/logs/logs_test.go @@ -14,16 +14,51 @@ func TestEnrichResourceLog(t *testing.T) { traceFile := filepath.Join("testdata", "logs.yaml") logs, err := golden.ReadLogs(traceFile) require.NoError(t, err) + resourceLogs := logs.ResourceLogs().At(0) + logRecords := resourceLogs.ScopeLogs().At(0).LogRecords() + + // This is needed because the yaml unmarshalling is not yet aware of this new field + logRecords.At(2).SetEventName("field.name") enricher := NewEnricher() enricher.Enrich(logs) - resource := logs.ResourceLogs().At(0).Resource() - expectedAttributes := map[string]any{ - "service.name": "my.service", - "agent.name": "android/java", - "telemetry.sdk.name": "android", - "telemetry.sdk.language": "java", + t.Run("resource_enrichment", func(t *testing.T) { + resourceAttributes := resourceLogs.Resource().Attributes() + expectedResourceAttributes := map[string]any{ + "service.name": "my.service", + "agent.name": "android/java", + "telemetry.sdk.name": "android", + "telemetry.sdk.language": "java", + } + assert.Empty(t, cmp.Diff(resourceAttributes.AsRaw(), expectedResourceAttributes)) + }) + + for i, tc := range []struct { + name string + processedAsEvent bool + }{ + { + name: "regular_log", + processedAsEvent: false, + }, + { + name: "event_by_attribute", + processedAsEvent: true, + }, + { + name: "event_by_field", + processedAsEvent: true, + }, + } { + t.Run(tc.name, func(t *testing.T) { + eventKind, ok := logRecords.At(i).Attributes().Get("event.kind") + if ok { + assert.Equal(t, "event", eventKind.AsString()) + assert.True(t, tc.processedAsEvent) + } else { + assert.False(t, tc.processedAsEvent) + } + }) } - assert.Empty(t, cmp.Diff(resource.Attributes().AsRaw(), expectedAttributes)) } diff --git a/enrichments/logs/testdata/logs.yaml b/enrichments/logs/testdata/logs.yaml index c082f76..38ded38 100644 --- a/enrichments/logs/testdata/logs.yaml +++ b/enrichments/logs/testdata/logs.yaml @@ -53,3 +53,12 @@ resourceLogs: - key: some.map.key value: stringValue: some value + + - timeUnixNano: '1544712660400000000' + attributes: + - key: event.name + value: + stringValue: attribute.event + + - timeUnixNano: '1544712660400000000' + eventName: field.name \ No newline at end of file From 8596af8612f48ae496fba0bd6037f47408deb078 Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Fri, 23 May 2025 06:28:42 +0200 Subject: [PATCH 38/67] Updating stacktrace test data --- enrichments/logs/internal/mobile/testdata/stacktrace1_a.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/enrichments/logs/internal/mobile/testdata/stacktrace1_a.txt b/enrichments/logs/internal/mobile/testdata/stacktrace1_a.txt index 73dd9a2..5349157 100644 --- a/enrichments/logs/internal/mobile/testdata/stacktrace1_a.txt +++ b/enrichments/logs/internal/mobile/testdata/stacktrace1_a.txt @@ -1 +1,3 @@ -Exceptioninthread"main"java.lang.RuntimeExceptionatcom.example.GenerateTrace.methodB(GenerateTrace.java:13)atcom.example.GenerateTrace.methodA(GenerateTrace.java:9)atcom.example.GenerateTrace.main(GenerateTrace.java:5) \ No newline at end of file +java.lang.IllegalArgumentException: The arg 'abc' is not valid + at org.example.SomeClass.someMethod(SomeClass.kt:8) + at org.example.Main.main(Main.kt:9) From afd7b691d1327ea3f109ce8685704b8f7d5f6aaa Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Fri, 23 May 2025 11:36:15 +0200 Subject: [PATCH 39/67] Using elasticattr attributes --- elasticattr/attributes.go | 2 ++ enrichments/logs/internal/mobile/event.go | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/elasticattr/attributes.go b/elasticattr/attributes.go index 1101c97..25445b8 100644 --- a/elasticattr/attributes.go +++ b/elasticattr/attributes.go @@ -43,6 +43,7 @@ const ( SpanType = "span.type" SpanSubtype = "span.subtype" EventOutcome = "event.outcome" + EventKind = "event.kind" SuccessCount = "event.success_count" ServiceTargetType = "service.target.type" ServiceTargetName = "service.target.name" @@ -57,6 +58,7 @@ const ( ErrorExceptionHandled = "error.exception.handled" ErrorGroupingKey = "error.grouping_key" ErrorGroupingName = "error.grouping_name" + ErrorType = "error.type" ) func GetTimestampUs(ts pcommon.Timestamp) int64 { diff --git a/enrichments/logs/internal/mobile/event.go b/enrichments/logs/internal/mobile/event.go index da2aac6..129c942 100644 --- a/enrichments/logs/internal/mobile/event.go +++ b/enrichments/logs/internal/mobile/event.go @@ -10,7 +10,7 @@ import ( ) func EnrichLogEvent(eventName string, logRecord plog.LogRecord) { - logRecord.Attributes().PutStr("event.kind", "event") + logRecord.Attributes().PutStr(elasticattr.EventKind, "event") if eventName == "device.crash" { enrichCrashEvent(logRecord) @@ -25,13 +25,13 @@ func enrichCrashEvent(logRecord plog.LogRecord) { logRecord.Attributes().PutStr(elasticattr.ProcessorEvent, "error") logRecord.Attributes().PutInt(elasticattr.TimestampUs, elasticattr.GetTimestampUs(timestamp)) if id, err := newUniqueID(); err == nil { - logRecord.Attributes().PutStr("error.id", id) + logRecord.Attributes().PutStr(elasticattr.ErrorID, id) } stacktrace, ok := logRecord.Attributes().Get("exception.stacktrace") if ok { - logRecord.Attributes().PutStr("error.grouping_key", CreateGroupingKey(stacktrace.AsString())) + logRecord.Attributes().PutStr(elasticattr.ErrorGroupingKey, CreateGroupingKey(stacktrace.AsString())) } - logRecord.Attributes().PutStr("error.type", "crash") + logRecord.Attributes().PutStr(elasticattr.ErrorType, "crash") } func newUniqueID() (string, error) { From b7b397931106dea561a3f2e4ea7eca1f4947f365 Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Fri, 23 May 2025 11:56:04 +0200 Subject: [PATCH 40/67] Adding license headers --- elasticattr/config.go | 17 +++++++++++++++++ enrichments/common/resource/config.go | 17 +++++++++++++++++ enrichments/logs/internal/mobile/event.go | 17 +++++++++++++++++ enrichments/logs/internal/mobile/event_test.go | 17 +++++++++++++++++ enrichments/logs/internal/mobile/groupingkey.go | 17 +++++++++++++++++ .../logs/internal/mobile/groupingkey_test.go | 17 +++++++++++++++++ enrichments/logs/logs.go | 17 +++++++++++++++++ enrichments/logs/logs_test.go | 17 +++++++++++++++++ 8 files changed, 136 insertions(+) diff --git a/elasticattr/config.go b/elasticattr/config.go index 725def7..3406765 100644 --- a/elasticattr/config.go +++ b/elasticattr/config.go @@ -1,3 +1,20 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + package elasticattr // AttributeConfig is the configuration options for each attribute. diff --git a/enrichments/common/resource/config.go b/enrichments/common/resource/config.go index 568f8b1..07779c5 100644 --- a/enrichments/common/resource/config.go +++ b/enrichments/common/resource/config.go @@ -1,3 +1,20 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + package resource import "github.com/elastic/opentelemetry-lib/elasticattr" diff --git a/enrichments/logs/internal/mobile/event.go b/enrichments/logs/internal/mobile/event.go index 129c942..9a3980a 100644 --- a/enrichments/logs/internal/mobile/event.go +++ b/enrichments/logs/internal/mobile/event.go @@ -1,3 +1,20 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + package mobile import ( diff --git a/enrichments/logs/internal/mobile/event_test.go b/enrichments/logs/internal/mobile/event_test.go index 9f7d801..a55a9f6 100644 --- a/enrichments/logs/internal/mobile/event_test.go +++ b/enrichments/logs/internal/mobile/event_test.go @@ -1,3 +1,20 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + package mobile import ( diff --git a/enrichments/logs/internal/mobile/groupingkey.go b/enrichments/logs/internal/mobile/groupingkey.go index e10cebc..ecc99a4 100644 --- a/enrichments/logs/internal/mobile/groupingkey.go +++ b/enrichments/logs/internal/mobile/groupingkey.go @@ -1,3 +1,20 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + package mobile import ( diff --git a/enrichments/logs/internal/mobile/groupingkey_test.go b/enrichments/logs/internal/mobile/groupingkey_test.go index 0509a5d..662aed5 100644 --- a/enrichments/logs/internal/mobile/groupingkey_test.go +++ b/enrichments/logs/internal/mobile/groupingkey_test.go @@ -1,3 +1,20 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + package mobile import ( diff --git a/enrichments/logs/logs.go b/enrichments/logs/logs.go index 41ff282..f89d8d7 100644 --- a/enrichments/logs/logs.go +++ b/enrichments/logs/logs.go @@ -1,3 +1,20 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + package logs import ( diff --git a/enrichments/logs/logs_test.go b/enrichments/logs/logs_test.go index cd2d87c..40aa104 100644 --- a/enrichments/logs/logs_test.go +++ b/enrichments/logs/logs_test.go @@ -1,3 +1,20 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + package logs import ( From c8bed901ea03f5610039ddd9c14fa4b12504d0d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9sar?= <56847527+LikeTheSalad@users.noreply.github.com> Date: Mon, 26 May 2025 10:21:19 +0200 Subject: [PATCH 41/67] Update enrichments/logs/internal/mobile/groupingkey.go Co-authored-by: Felix Barnsteiner --- enrichments/logs/internal/mobile/groupingkey.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/enrichments/logs/internal/mobile/groupingkey.go b/enrichments/logs/internal/mobile/groupingkey.go index ecc99a4..68952ba 100644 --- a/enrichments/logs/internal/mobile/groupingkey.go +++ b/enrichments/logs/internal/mobile/groupingkey.go @@ -29,6 +29,6 @@ func CreateGroupingKey(stacktrace string) string { } func curateStacktrace(stacktrace string) string { - unwantedPattern := regexp.MustCompile(`(:\s.+)|[\r\n\s]+`) + unwantedPattern := regexp.MustCompile(`(:\s.+$)|[\r\n\s]+`) return unwantedPattern.ReplaceAllString(stacktrace, "") } From 7464c1be46f83664ea82db2701e23315f6611385 Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Mon, 26 May 2025 13:49:25 +0200 Subject: [PATCH 42/67] Keeping cause exception name --- enrichments/logs/internal/mobile/groupingkey.go | 6 ++++-- .../logs/internal/mobile/testdata/curated_stacktrace2.txt | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/enrichments/logs/internal/mobile/groupingkey.go b/enrichments/logs/internal/mobile/groupingkey.go index 68952ba..3ef4c23 100644 --- a/enrichments/logs/internal/mobile/groupingkey.go +++ b/enrichments/logs/internal/mobile/groupingkey.go @@ -29,6 +29,8 @@ func CreateGroupingKey(stacktrace string) string { } func curateStacktrace(stacktrace string) string { - unwantedPattern := regexp.MustCompile(`(:\s.+$)|[\r\n\s]+`) - return unwantedPattern.ReplaceAllString(stacktrace, "") + nonMessagePattern := regexp.MustCompile(`(?m)^((?:Caused\sby:\s[^:]+)|(?:[^\s][^:]+))(:\s.+)?$`) + unwantedPattern := regexp.MustCompile(`[\r\n\s]+`) + withoutMessages := nonMessagePattern.ReplaceAllString(stacktrace, "$1") + return unwantedPattern.ReplaceAllString(withoutMessages, "") } diff --git a/enrichments/logs/internal/mobile/testdata/curated_stacktrace2.txt b/enrichments/logs/internal/mobile/testdata/curated_stacktrace2.txt index 479116b..1997a3d 100644 --- a/enrichments/logs/internal/mobile/testdata/curated_stacktrace2.txt +++ b/enrichments/logs/internal/mobile/testdata/curated_stacktrace2.txt @@ -1 +1 @@ -java.lang.RuntimeExceptionatorg.example.SomeClass.callingOtherMethod(SomeClass.kt:16)atorg.example.Main.main(Main.kt:9)Causedbyatorg.example.SomeOtherClass.someOtherMethod(SomeOtherClass.kt:8)atorg.example.SomeClass.callingOtherMethod(SomeClass.kt:14)...1more \ No newline at end of file +java.lang.RuntimeExceptionatorg.example.SomeClass.callingOtherMethod(SomeClass.kt:16)atorg.example.Main.main(Main.kt:9)Causedby:java.lang.IllegalArgumentExceptionatorg.example.SomeOtherClass.someOtherMethod(SomeOtherClass.kt:8)atorg.example.SomeClass.callingOtherMethod(SomeClass.kt:14)...1more \ No newline at end of file From 0945cfecab6152b8f40f881d3ecd9080b2f99c37 Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Mon, 26 May 2025 16:17:10 +0200 Subject: [PATCH 43/67] Removing stacktrace line numbers --- .../logs/internal/mobile/groupingkey.go | 20 +++++++++++++++---- .../mobile/testdata/curated_stacktrace1.txt | 2 +- .../mobile/testdata/curated_stacktrace2.txt | 2 +- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/enrichments/logs/internal/mobile/groupingkey.go b/enrichments/logs/internal/mobile/groupingkey.go index 3ef4c23..b93c7de 100644 --- a/enrichments/logs/internal/mobile/groupingkey.go +++ b/enrichments/logs/internal/mobile/groupingkey.go @@ -21,6 +21,7 @@ import ( "crypto/sha256" "encoding/hex" "regexp" + "strings" ) func CreateGroupingKey(stacktrace string) string { @@ -29,8 +30,19 @@ func CreateGroupingKey(stacktrace string) string { } func curateStacktrace(stacktrace string) string { - nonMessagePattern := regexp.MustCompile(`(?m)^((?:Caused\sby:\s[^:]+)|(?:[^\s][^:]+))(:\s.+)?$`) - unwantedPattern := regexp.MustCompile(`[\r\n\s]+`) - withoutMessages := nonMessagePattern.ReplaceAllString(stacktrace, "$1") - return unwantedPattern.ReplaceAllString(withoutMessages, "") + errorOrCausePattern := regexp.MustCompile(`^((?:Caused\sby:\s[^:]+)|(?:[^\s][^:]+))(:\s.+)?$`) + callSitePattern := regexp.MustCompile(`^\s+at\s.+(:\d+)\)$`) + unwantedPattern := regexp.MustCompile(`\s+`) + + curatedLines := regexp.MustCompile(`(m?).+`).ReplaceAllStringFunc(stacktrace, func(s string) string { + if errorOrCausePattern.MatchString(s) { + return errorOrCausePattern.ReplaceAllString(s, "$1") + } + if callSitePattern.MatchString(s) { + return strings.Replace(s, callSitePattern.FindStringSubmatch(s)[1], "", 1) + } + return s + }) + + return unwantedPattern.ReplaceAllString(curatedLines, "") } diff --git a/enrichments/logs/internal/mobile/testdata/curated_stacktrace1.txt b/enrichments/logs/internal/mobile/testdata/curated_stacktrace1.txt index 01b6d06..6615f70 100644 --- a/enrichments/logs/internal/mobile/testdata/curated_stacktrace1.txt +++ b/enrichments/logs/internal/mobile/testdata/curated_stacktrace1.txt @@ -1 +1 @@ -java.lang.IllegalArgumentExceptionatorg.example.SomeClass.someMethod(SomeClass.kt:8)atorg.example.Main.main(Main.kt:9) \ No newline at end of file +java.lang.IllegalArgumentExceptionatorg.example.SomeClass.someMethod(SomeClass.kt)atorg.example.Main.main(Main.kt) \ No newline at end of file diff --git a/enrichments/logs/internal/mobile/testdata/curated_stacktrace2.txt b/enrichments/logs/internal/mobile/testdata/curated_stacktrace2.txt index 1997a3d..a5d7978 100644 --- a/enrichments/logs/internal/mobile/testdata/curated_stacktrace2.txt +++ b/enrichments/logs/internal/mobile/testdata/curated_stacktrace2.txt @@ -1 +1 @@ -java.lang.RuntimeExceptionatorg.example.SomeClass.callingOtherMethod(SomeClass.kt:16)atorg.example.Main.main(Main.kt:9)Causedby:java.lang.IllegalArgumentExceptionatorg.example.SomeOtherClass.someOtherMethod(SomeOtherClass.kt:8)atorg.example.SomeClass.callingOtherMethod(SomeClass.kt:14)...1more \ No newline at end of file +java.lang.RuntimeExceptionatorg.example.SomeClass.callingOtherMethod(SomeClass.kt)atorg.example.Main.main(Main.kt)Causedby:java.lang.IllegalArgumentExceptionatorg.example.SomeOtherClass.someOtherMethod(SomeOtherClass.kt)atorg.example.SomeClass.callingOtherMethod(SomeClass.kt)...1more \ No newline at end of file From 628010c73a057a62ede6330d951a8d7081497c40 Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Mon, 26 May 2025 16:20:26 +0200 Subject: [PATCH 44/67] Updating groupingkey tests --- enrichments/logs/internal/mobile/groupingkey_test.go | 8 ++++---- .../logs/internal/mobile/testdata/stacktrace1_c.txt | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 enrichments/logs/internal/mobile/testdata/stacktrace1_c.txt diff --git a/enrichments/logs/internal/mobile/groupingkey_test.go b/enrichments/logs/internal/mobile/groupingkey_test.go index 662aed5..2a13b0a 100644 --- a/enrichments/logs/internal/mobile/groupingkey_test.go +++ b/enrichments/logs/internal/mobile/groupingkey_test.go @@ -34,7 +34,7 @@ func TestCurateStacktrace(t *testing.T) { }{ { name: "standalone_stacktrace", - stacktraces: []string{readTestFile(t, "stacktrace1_a.txt"), readTestFile(t, "stacktrace1_b.txt")}, + stacktraces: []string{readTestFile(t, "stacktrace1_a.txt"), readTestFile(t, "stacktrace1_b.txt"), readTestFile(t, "stacktrace1_c.txt")}, curated: readTestFile(t, "curated_stacktrace1.txt"), }, { @@ -59,13 +59,13 @@ func TestCreateGroupingKey(t *testing.T) { }{ { name: "standalone_stacktrace", - stacktraces: []string{readTestFile(t, "stacktrace1_a.txt"), readTestFile(t, "stacktrace1_b.txt")}, - expectedId: "fbda93aa3a0ccb785da705ff03697bb7393cb0738e31c596e797b16ea2ba2f02", + stacktraces: []string{readTestFile(t, "stacktrace1_a.txt"), readTestFile(t, "stacktrace1_b.txt"), readTestFile(t, "stacktrace1_c.txt")}, + expectedId: "d03a030670a234802514cc1e8a7ff74846d5890f5f41499109421bf1d58ab310", }, { name: "stacktrace_with_cause", stacktraces: []string{readTestFile(t, "stacktrace2_a.txt"), readTestFile(t, "stacktrace2_b.txt"), readTestFile(t, "stacktrace2_c.txt")}, - expectedId: "10b6726bc6d9aab69389b8b5dfbd9df1a6e08db75b0777b4f2d0456adeaed50e", + expectedId: "b2f6079aa1ef7044f5f2d8a7fb33a71fc60b0067171f92164b87623bda26646b", }, } { t.Run(tc.name, func(t *testing.T) { diff --git a/enrichments/logs/internal/mobile/testdata/stacktrace1_c.txt b/enrichments/logs/internal/mobile/testdata/stacktrace1_c.txt new file mode 100644 index 0000000..5484345 --- /dev/null +++ b/enrichments/logs/internal/mobile/testdata/stacktrace1_c.txt @@ -0,0 +1,3 @@ +java.lang.IllegalArgumentException: The arg 'ghi' is not valid + at org.example.SomeClass.someMethod(SomeClass.kt:9) + at org.example.Main.main(Main.kt:19) From 4bf601a3a36a11da9395177dd797e16d2af49239 Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Mon, 26 May 2025 16:24:27 +0200 Subject: [PATCH 45/67] Updating event tests --- enrichments/logs/internal/mobile/event_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/enrichments/logs/internal/mobile/event_test.go b/enrichments/logs/internal/mobile/event_test.go index a55a9f6..03c10b9 100644 --- a/enrichments/logs/internal/mobile/event_test.go +++ b/enrichments/logs/internal/mobile/event_test.go @@ -33,7 +33,7 @@ func TestEnrichEvents(t *testing.T) { now := time.Unix(3600, 0) timestamp := pcommon.NewTimestampFromTime(now) stacktrace := "Exception in thread \"main\" java.lang.RuntimeException: Test exception\n at com.example.GenerateTrace.methodB(GenerateTrace.java:13)\n at com.example.GenerateTrace.methodA(GenerateTrace.java:9)\n at com.example.GenerateTrace.main(GenerateTrace.java:5)" - stacktraceHash := "96b957020e07ac5c1ed7f86e7df9e3e393ede1284c2c52cb4e8e64f902d37833" + stacktraceHash := "0d5c9be62be0db506bbc5f968566cab21eefa57763e8502250722337b2819038" for _, tc := range []struct { name string From 6aa037b7c7ea44b214f2957de264194932280f7c Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Tue, 27 May 2025 10:56:18 +0200 Subject: [PATCH 46/67] Replacing sha256 by xxhash --- enrichments/logs/internal/mobile/groupingkey.go | 9 +++++---- enrichments/logs/internal/mobile/groupingkey_test.go | 4 ++-- go.mod | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/enrichments/logs/internal/mobile/groupingkey.go b/enrichments/logs/internal/mobile/groupingkey.go index b93c7de..0bc965e 100644 --- a/enrichments/logs/internal/mobile/groupingkey.go +++ b/enrichments/logs/internal/mobile/groupingkey.go @@ -18,15 +18,16 @@ package mobile import ( - "crypto/sha256" - "encoding/hex" + "fmt" "regexp" "strings" + + "github.com/cespare/xxhash/v2" ) func CreateGroupingKey(stacktrace string) string { - hashBytes := sha256.Sum256([]byte(curateStacktrace(stacktrace))) - return hex.EncodeToString(hashBytes[:]) + hash := xxhash.Sum64String(curateStacktrace(stacktrace)) + return fmt.Sprintf("%016x", hash) } func curateStacktrace(stacktrace string) string { diff --git a/enrichments/logs/internal/mobile/groupingkey_test.go b/enrichments/logs/internal/mobile/groupingkey_test.go index 2a13b0a..4db2a0f 100644 --- a/enrichments/logs/internal/mobile/groupingkey_test.go +++ b/enrichments/logs/internal/mobile/groupingkey_test.go @@ -60,12 +60,12 @@ func TestCreateGroupingKey(t *testing.T) { { name: "standalone_stacktrace", stacktraces: []string{readTestFile(t, "stacktrace1_a.txt"), readTestFile(t, "stacktrace1_b.txt"), readTestFile(t, "stacktrace1_c.txt")}, - expectedId: "d03a030670a234802514cc1e8a7ff74846d5890f5f41499109421bf1d58ab310", + expectedId: "e3d876640dd47864", }, { name: "stacktrace_with_cause", stacktraces: []string{readTestFile(t, "stacktrace2_a.txt"), readTestFile(t, "stacktrace2_b.txt"), readTestFile(t, "stacktrace2_c.txt")}, - expectedId: "b2f6079aa1ef7044f5f2d8a7fb33a71fc60b0067171f92164b87623bda26646b", + expectedId: "390d84a9a633fa73", }, } { t.Run(tc.name, func(t *testing.T) { diff --git a/go.mod b/go.mod index 444e79b..7dff23a 100644 --- a/go.mod +++ b/go.mod @@ -4,6 +4,7 @@ go 1.23.0 require ( github.com/cenkalti/backoff/v4 v4.3.0 + github.com/cespare/xxhash/v2 v2.3.0 github.com/elastic/elastic-transport-go/v8 v8.7.0 github.com/elastic/go-elasticsearch/v8 v8.18.0 github.com/google/go-cmp v0.7.0 @@ -26,7 +27,6 @@ require ( ) require ( - github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/foxboron/go-tpm-keyfiles v0.0.0-20250323135004-b31fac66206e // indirect From 462b27fbae05d7a5d71b20f86650f28938604f5f Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Tue, 27 May 2025 11:03:00 +0200 Subject: [PATCH 47/67] Replace SHA-256 with xxHash and optimize regex patterns in groupingkey.go --- enrichments/logs/internal/mobile/groupingkey.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/enrichments/logs/internal/mobile/groupingkey.go b/enrichments/logs/internal/mobile/groupingkey.go index 0bc965e..2a30ba2 100644 --- a/enrichments/logs/internal/mobile/groupingkey.go +++ b/enrichments/logs/internal/mobile/groupingkey.go @@ -25,17 +25,21 @@ import ( "github.com/cespare/xxhash/v2" ) +var ( + // Regex patterns for stack trace processing + errorOrCausePattern = regexp.MustCompile(`^((?:Caused\sby:\s[^:]+)|(?:[^\s][^:]+))(:\s.+)?$`) + callSitePattern = regexp.MustCompile(`^\s+at\s.+(:\d+)\)$`) + unwantedPattern = regexp.MustCompile(`\s+`) + allLinesPattern = regexp.MustCompile(`(m?).+`) +) + func CreateGroupingKey(stacktrace string) string { hash := xxhash.Sum64String(curateStacktrace(stacktrace)) return fmt.Sprintf("%016x", hash) } func curateStacktrace(stacktrace string) string { - errorOrCausePattern := regexp.MustCompile(`^((?:Caused\sby:\s[^:]+)|(?:[^\s][^:]+))(:\s.+)?$`) - callSitePattern := regexp.MustCompile(`^\s+at\s.+(:\d+)\)$`) - unwantedPattern := regexp.MustCompile(`\s+`) - - curatedLines := regexp.MustCompile(`(m?).+`).ReplaceAllStringFunc(stacktrace, func(s string) string { + curatedLines := allLinesPattern.ReplaceAllStringFunc(stacktrace, func(s string) string { if errorOrCausePattern.MatchString(s) { return errorOrCausePattern.ReplaceAllString(s, "$1") } From 1126cb0ed1a61f1b3d593ed944570cdf831ce86d Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Tue, 27 May 2025 11:03:27 +0200 Subject: [PATCH 48/67] Update test expectations in event_test.go for xxHash output --- enrichments/logs/internal/mobile/event_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/enrichments/logs/internal/mobile/event_test.go b/enrichments/logs/internal/mobile/event_test.go index 03c10b9..70a39c1 100644 --- a/enrichments/logs/internal/mobile/event_test.go +++ b/enrichments/logs/internal/mobile/event_test.go @@ -33,7 +33,7 @@ func TestEnrichEvents(t *testing.T) { now := time.Unix(3600, 0) timestamp := pcommon.NewTimestampFromTime(now) stacktrace := "Exception in thread \"main\" java.lang.RuntimeException: Test exception\n at com.example.GenerateTrace.methodB(GenerateTrace.java:13)\n at com.example.GenerateTrace.methodA(GenerateTrace.java:9)\n at com.example.GenerateTrace.main(GenerateTrace.java:5)" - stacktraceHash := "0d5c9be62be0db506bbc5f968566cab21eefa57763e8502250722337b2819038" + stacktraceHash := "e25c4196dc720d91" for _, tc := range []struct { name string From 9edaab49f62b3b7d6a415becf1342a0f69cf2b08 Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Thu, 29 May 2025 10:19:04 +0200 Subject: [PATCH 49/67] Make error grouping key conditional on Java language --- enrichments/logs/internal/mobile/event.go | 19 +++++--- .../logs/internal/mobile/event_test.go | 44 ++++++++++++++++--- enrichments/logs/logs.go | 9 +++- 3 files changed, 60 insertions(+), 12 deletions(-) diff --git a/enrichments/logs/internal/mobile/event.go b/enrichments/logs/internal/mobile/event.go index 9a3980a..2b67e9a 100644 --- a/enrichments/logs/internal/mobile/event.go +++ b/enrichments/logs/internal/mobile/event.go @@ -26,15 +26,21 @@ import ( "go.opentelemetry.io/collector/pdata/plog" ) -func EnrichLogEvent(eventName string, logRecord plog.LogRecord) { +// EventContext contains contextual information for log event enrichment +type EventContext struct { + EventName string + ResourceAttributes map[string]any +} + +func EnrichLogEvent(ctx EventContext, logRecord plog.LogRecord) { logRecord.Attributes().PutStr(elasticattr.EventKind, "event") - if eventName == "device.crash" { - enrichCrashEvent(logRecord) + if ctx.EventName == "device.crash" { + enrichCrashEvent(logRecord, ctx.ResourceAttributes) } } -func enrichCrashEvent(logRecord plog.LogRecord) { +func enrichCrashEvent(logRecord plog.LogRecord, resourceAttrs map[string]any) { timestamp := logRecord.Timestamp() if timestamp == 0 { timestamp = logRecord.ObservedTimestamp() @@ -46,7 +52,10 @@ func enrichCrashEvent(logRecord plog.LogRecord) { } stacktrace, ok := logRecord.Attributes().Get("exception.stacktrace") if ok { - logRecord.Attributes().PutStr(elasticattr.ErrorGroupingKey, CreateGroupingKey(stacktrace.AsString())) + language, hasLanguage := resourceAttrs["telemetry.sdk.language"] + if hasLanguage && language == "java" { + logRecord.Attributes().PutStr(elasticattr.ErrorGroupingKey, CreateGroupingKey(stacktrace.AsString())) + } } logRecord.Attributes().PutStr(elasticattr.ErrorType, "crash") } diff --git a/enrichments/logs/internal/mobile/event_test.go b/enrichments/logs/internal/mobile/event_test.go index 70a39c1..d427628 100644 --- a/enrichments/logs/internal/mobile/event_test.go +++ b/enrichments/logs/internal/mobile/event_test.go @@ -39,11 +39,15 @@ func TestEnrichEvents(t *testing.T) { name string eventName string input func() plog.LogRecord + resourceAttrs map[string]any expectedAttributes map[string]any }{ { - name: "crash_event", + name: "crash_event_java", eventName: "device.crash", + resourceAttrs: map[string]any{ + "telemetry.sdk.language": "java", + }, input: func() plog.LogRecord { logRecord := plog.NewLogRecord() logRecord.SetTimestamp(timestamp) @@ -62,8 +66,11 @@ func TestEnrichEvents(t *testing.T) { }, }, { - name: "crash_event_without_timestamp", + name: "crash_event_without_timestamp_java", eventName: "device.crash", + resourceAttrs: map[string]any{ + "telemetry.sdk.language": "java", + }, input: func() plog.LogRecord { logRecord := plog.NewLogRecord() logRecord.SetObservedTimestamp(timestamp) @@ -82,8 +89,31 @@ func TestEnrichEvents(t *testing.T) { }, }, { - name: "non_crash_event", - eventName: "othername", + name: "crash_event_non_java", + eventName: "device.crash", + resourceAttrs: map[string]any{ + "telemetry.sdk.language": "go", + }, + input: func() plog.LogRecord { + logRecord := plog.NewLogRecord() + logRecord.SetTimestamp(timestamp) + logRecord.Attributes().PutStr("event.name", "device.crash") + logRecord.Attributes().PutStr("exception.message", "Exception message") + logRecord.Attributes().PutStr("exception.type", "go.error") + logRecord.Attributes().PutStr("exception.stacktrace", stacktrace) + return logRecord + }, + expectedAttributes: map[string]any{ + "processor.event": "error", + "timestamp.us": timestamp.AsTime().UnixMicro(), + "error.type": "crash", + "event.kind": "event", + }, + }, + { + name: "non_crash_event", + eventName: "othername", + resourceAttrs: map[string]any{}, input: func() plog.LogRecord { logRecord := plog.NewLogRecord() logRecord.Attributes().PutStr("event.name", "othername") @@ -99,7 +129,11 @@ func TestEnrichEvents(t *testing.T) { maps.Copy(tc.expectedAttributes, inputLogRecord.Attributes().AsRaw()) - EnrichLogEvent(tc.eventName, inputLogRecord) + ctx := EventContext{ + EventName: tc.eventName, + ResourceAttributes: tc.resourceAttrs, + } + EnrichLogEvent(ctx, inputLogRecord) assert.Empty(t, cmp.Diff(inputLogRecord.Attributes().AsRaw(), tc.expectedAttributes, ignoreMapKey("error.id"))) errorId, ok := inputLogRecord.Attributes().Get("error.id") diff --git a/enrichments/logs/logs.go b/enrichments/logs/logs.go index f89d8d7..73389b9 100644 --- a/enrichments/logs/logs.go +++ b/enrichments/logs/logs.go @@ -41,7 +41,8 @@ func (e *Enricher) Enrich(logs plog.Logs) { for i := 0; i < resourceLogs.Len(); i++ { resourceLog := resourceLogs.At(i) - resource.EnrichResource(resourceLog.Resource(), resourceConfig) + res := resourceLog.Resource() + resource.EnrichResource(res, resourceConfig) scopeLogs := resourceLog.ScopeLogs() for j := 0; j < scopeLogs.Len(); j++ { logRecords := scopeLogs.At(j).LogRecords() @@ -49,7 +50,11 @@ func (e *Enricher) Enrich(logs plog.Logs) { logRecord := logRecords.At(k) eventName, ok := getEventName(logRecord) if ok { - mobile.EnrichLogEvent(eventName, logRecord) + ctx := mobile.EventContext{ + EventName: eventName, + ResourceAttributes: res.Attributes().AsRaw(), + } + mobile.EnrichLogEvent(ctx, logRecord) } } } From c15e5617fcd9c0ba5f1ce7c657ede141c0ce649d Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Thu, 29 May 2025 10:27:52 +0200 Subject: [PATCH 50/67] Addressing struct pointer lint issue --- enrichments/logs/internal/mobile/event.go | 2 +- enrichments/logs/internal/mobile/event_test.go | 2 +- enrichments/logs/logs.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/enrichments/logs/internal/mobile/event.go b/enrichments/logs/internal/mobile/event.go index 2b67e9a..b3ab577 100644 --- a/enrichments/logs/internal/mobile/event.go +++ b/enrichments/logs/internal/mobile/event.go @@ -28,8 +28,8 @@ import ( // EventContext contains contextual information for log event enrichment type EventContext struct { - EventName string ResourceAttributes map[string]any + EventName string } func EnrichLogEvent(ctx EventContext, logRecord plog.LogRecord) { diff --git a/enrichments/logs/internal/mobile/event_test.go b/enrichments/logs/internal/mobile/event_test.go index d427628..2808683 100644 --- a/enrichments/logs/internal/mobile/event_test.go +++ b/enrichments/logs/internal/mobile/event_test.go @@ -130,8 +130,8 @@ func TestEnrichEvents(t *testing.T) { maps.Copy(tc.expectedAttributes, inputLogRecord.Attributes().AsRaw()) ctx := EventContext{ - EventName: tc.eventName, ResourceAttributes: tc.resourceAttrs, + EventName: tc.eventName, } EnrichLogEvent(ctx, inputLogRecord) diff --git a/enrichments/logs/logs.go b/enrichments/logs/logs.go index 73389b9..b84419e 100644 --- a/enrichments/logs/logs.go +++ b/enrichments/logs/logs.go @@ -51,8 +51,8 @@ func (e *Enricher) Enrich(logs plog.Logs) { eventName, ok := getEventName(logRecord) if ok { ctx := mobile.EventContext{ - EventName: eventName, ResourceAttributes: res.Attributes().AsRaw(), + EventName: eventName, } mobile.EnrichLogEvent(ctx, logRecord) } From 5dbfb38adc5e39d1ebf6450e9cf69d7ea7b6f24b Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Thu, 29 May 2025 11:06:48 +0200 Subject: [PATCH 51/67] Avoiding creating new map instances on each loop iteration --- enrichments/logs/logs.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/enrichments/logs/logs.go b/enrichments/logs/logs.go index b84419e..07fa90f 100644 --- a/enrichments/logs/logs.go +++ b/enrichments/logs/logs.go @@ -41,8 +41,9 @@ func (e *Enricher) Enrich(logs plog.Logs) { for i := 0; i < resourceLogs.Len(); i++ { resourceLog := resourceLogs.At(i) - res := resourceLog.Resource() - resource.EnrichResource(res, resourceConfig) + logsResource := resourceLog.Resource() + resource.EnrichResource(logsResource, resourceConfig) + resourceAttrs := logsResource.Attributes().AsRaw() scopeLogs := resourceLog.ScopeLogs() for j := 0; j < scopeLogs.Len(); j++ { logRecords := scopeLogs.At(j).LogRecords() @@ -51,7 +52,7 @@ func (e *Enricher) Enrich(logs plog.Logs) { eventName, ok := getEventName(logRecord) if ok { ctx := mobile.EventContext{ - ResourceAttributes: res.Attributes().AsRaw(), + ResourceAttributes: resourceAttrs, EventName: eventName, } mobile.EnrichLogEvent(ctx, logRecord) From 39760441f2ca3f1de6a3cd824bda11872b22134e Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Tue, 10 Jun 2025 06:14:54 +0200 Subject: [PATCH 52/67] Move Android stacktrace test data to dedicated subfolder --- enrichments/logs/internal/mobile/groupingkey_test.go | 2 +- .../mobile/testdata/{ => android}/curated_stacktrace1.txt | 0 .../mobile/testdata/{ => android}/curated_stacktrace2.txt | 0 .../internal/mobile/testdata/{ => android}/stacktrace1_a.txt | 0 .../internal/mobile/testdata/{ => android}/stacktrace1_b.txt | 0 .../internal/mobile/testdata/{ => android}/stacktrace1_c.txt | 0 .../internal/mobile/testdata/{ => android}/stacktrace2_a.txt | 0 .../internal/mobile/testdata/{ => android}/stacktrace2_b.txt | 0 .../internal/mobile/testdata/{ => android}/stacktrace2_c.txt | 0 9 files changed, 1 insertion(+), 1 deletion(-) rename enrichments/logs/internal/mobile/testdata/{ => android}/curated_stacktrace1.txt (100%) rename enrichments/logs/internal/mobile/testdata/{ => android}/curated_stacktrace2.txt (100%) rename enrichments/logs/internal/mobile/testdata/{ => android}/stacktrace1_a.txt (100%) rename enrichments/logs/internal/mobile/testdata/{ => android}/stacktrace1_b.txt (100%) rename enrichments/logs/internal/mobile/testdata/{ => android}/stacktrace1_c.txt (100%) rename enrichments/logs/internal/mobile/testdata/{ => android}/stacktrace2_a.txt (100%) rename enrichments/logs/internal/mobile/testdata/{ => android}/stacktrace2_b.txt (100%) rename enrichments/logs/internal/mobile/testdata/{ => android}/stacktrace2_c.txt (100%) diff --git a/enrichments/logs/internal/mobile/groupingkey_test.go b/enrichments/logs/internal/mobile/groupingkey_test.go index 4db2a0f..233bb04 100644 --- a/enrichments/logs/internal/mobile/groupingkey_test.go +++ b/enrichments/logs/internal/mobile/groupingkey_test.go @@ -77,7 +77,7 @@ func TestCreateGroupingKey(t *testing.T) { } func readTestFile(t *testing.T, fileName string) string { - bytes, err := os.ReadFile(filepath.Join("testdata", fileName)) + bytes, err := os.ReadFile(filepath.Join("testdata", "android", fileName)) require.NoError(t, err) return string(bytes) } diff --git a/enrichments/logs/internal/mobile/testdata/curated_stacktrace1.txt b/enrichments/logs/internal/mobile/testdata/android/curated_stacktrace1.txt similarity index 100% rename from enrichments/logs/internal/mobile/testdata/curated_stacktrace1.txt rename to enrichments/logs/internal/mobile/testdata/android/curated_stacktrace1.txt diff --git a/enrichments/logs/internal/mobile/testdata/curated_stacktrace2.txt b/enrichments/logs/internal/mobile/testdata/android/curated_stacktrace2.txt similarity index 100% rename from enrichments/logs/internal/mobile/testdata/curated_stacktrace2.txt rename to enrichments/logs/internal/mobile/testdata/android/curated_stacktrace2.txt diff --git a/enrichments/logs/internal/mobile/testdata/stacktrace1_a.txt b/enrichments/logs/internal/mobile/testdata/android/stacktrace1_a.txt similarity index 100% rename from enrichments/logs/internal/mobile/testdata/stacktrace1_a.txt rename to enrichments/logs/internal/mobile/testdata/android/stacktrace1_a.txt diff --git a/enrichments/logs/internal/mobile/testdata/stacktrace1_b.txt b/enrichments/logs/internal/mobile/testdata/android/stacktrace1_b.txt similarity index 100% rename from enrichments/logs/internal/mobile/testdata/stacktrace1_b.txt rename to enrichments/logs/internal/mobile/testdata/android/stacktrace1_b.txt diff --git a/enrichments/logs/internal/mobile/testdata/stacktrace1_c.txt b/enrichments/logs/internal/mobile/testdata/android/stacktrace1_c.txt similarity index 100% rename from enrichments/logs/internal/mobile/testdata/stacktrace1_c.txt rename to enrichments/logs/internal/mobile/testdata/android/stacktrace1_c.txt diff --git a/enrichments/logs/internal/mobile/testdata/stacktrace2_a.txt b/enrichments/logs/internal/mobile/testdata/android/stacktrace2_a.txt similarity index 100% rename from enrichments/logs/internal/mobile/testdata/stacktrace2_a.txt rename to enrichments/logs/internal/mobile/testdata/android/stacktrace2_a.txt diff --git a/enrichments/logs/internal/mobile/testdata/stacktrace2_b.txt b/enrichments/logs/internal/mobile/testdata/android/stacktrace2_b.txt similarity index 100% rename from enrichments/logs/internal/mobile/testdata/stacktrace2_b.txt rename to enrichments/logs/internal/mobile/testdata/android/stacktrace2_b.txt diff --git a/enrichments/logs/internal/mobile/testdata/stacktrace2_c.txt b/enrichments/logs/internal/mobile/testdata/android/stacktrace2_c.txt similarity index 100% rename from enrichments/logs/internal/mobile/testdata/stacktrace2_c.txt rename to enrichments/logs/internal/mobile/testdata/android/stacktrace2_c.txt From e28bd47c82298812e22a587b68c2c4fb49c007b0 Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Tue, 10 Jun 2025 06:21:18 +0200 Subject: [PATCH 53/67] Adding ios crash test files --- .../mobile/testdata/ios/thread-0-crash.txt | 273 ++++++++++++++++++ .../mobile/testdata/ios/thread-8-crash.txt | 259 +++++++++++++++++ 2 files changed, 532 insertions(+) create mode 100644 enrichments/logs/internal/mobile/testdata/ios/thread-0-crash.txt create mode 100644 enrichments/logs/internal/mobile/testdata/ios/thread-8-crash.txt diff --git a/enrichments/logs/internal/mobile/testdata/ios/thread-0-crash.txt b/enrichments/logs/internal/mobile/testdata/ios/thread-0-crash.txt new file mode 100644 index 0000000..82364a2 --- /dev/null +++ b/enrichments/logs/internal/mobile/testdata/ios/thread-0-crash.txt @@ -0,0 +1,273 @@ +Incident Identifier: 9782DB4A-7524-4A8F-B7E3-E209B314F750 +Hardware Model:            arm64 +Process:                  opbeans-swift [88086] +Path:                        /Users/brycebuchanan/Library/Developer/CoreSimulator/Devices/5F5E45F7-760E-4589-9F48-B7264D35395A/data/Containers/Bundle/Application/6817BDFA-329C-4E47-B7C7-B4D053B81515/opbeans-swift.app/opbeans-swift +Identifier:            co.elastic.opbeans-swift +Version:                  4.0.0 (01042024) +Code Type:              ARM-64 +Parent Process:    launchd_sim [63657] + +Date/Time:              2025-06-05 15:02:14 +0000 +OS Version:            Mac OS X 18.4 (24F74) +Report Version:    104 + +Exception Type:    SIGTRAP +Exception Codes: TRAP_BRKPT at 0x195712d2c +Crashed Thread:    0 + +Thread 0 Crashed: +0      libswiftCore.dylib                                    0x0000000195712d2c 0x1956e8000 + 175404 +1      opbeans-swift.debug.dylib                      0x0000000104d46e7c 0x104d20000 + 159356 +2      SwiftUICore                                                  0x00000001d4350138 0x1d42a0000 + 721208 +3      SwiftUICore                                                  0x00000001d4501710 0x1d42a0000 + 2496272 +4      SwiftUICore                                                  0x00000001d435953c 0x1d42a0000 + 759100 +5      SwiftUICore                                                  0x00000001d435953c 0x1d42a0000 + 759100 +6      SwiftUI                                                          0x00000001d3443c38 0x1d30fe000 + 3431480 +7      SwiftUI                                                          0x00000001d36e3880 0x1d30fe000 + 6183040 +8      SwiftUICore                                                  0x00000001d4350138 0x1d42a0000 + 721208 +9      SwiftUICore                                                  0x00000001d466e028 0x1d42a0000 + 3989544 +10    SwiftUICore                                                  0x00000001d466d620 0x1d42a0000 + 3986976 +11    SwiftUI                                                          0x00000001d3ad5ac8 0x1d30fe000 + 10320584 +12    SwiftUI                                                          0x00000001d3ad5b40 0x1d30fe000 + 10320704 +13    UIKitCore                                                      0x00000001856f3394 0x184d72000 + 9966484 +14    UIKitCore                                                      0x00000001856fab0c 0x184d72000 + 9997068 +15    UIKitCore                                                      0x00000001856f8318 0x184d72000 + 9986840 +16    UIKitCore                                                      0x00000001856f807c 0x184d72000 + 9986172 +17    UIKitCore                                                      0x00000001856ed930 0x184d72000 + 9943344 +18    UIKitCore                                                      0x00000001856ecc2c 0x184d72000 + 9940012 +19    UIKitCore                                                      0x00000001856ec978 0x184d72000 + 9939320 +20    UIKitCore                                                      0x0000000185c0921c 0x184d72000 + 15299100 +21    UIKitCore                                                      0x0000000185be8bfc 0x184d72000 + 15166460 +22    UIKitCore                                                      0x0000000185c731bc 0x184d72000 + 15733180 +23    UIKitCore                                                      0x0000000185c75e60 0x184d72000 + 15744608 +24    UIKitCore                                                      0x0000000185c6e474 0x184d72000 + 15713396 +25    UIKitCore                                                      0x0000000185133f04 0x184d72000 + 3940100 +26    UIKitCore                                                      0x0000000185afd9b8 0x184d72000 + 14203320 +27    UIKitCore                                                      0x0000000185afcdd4 0x184d72000 + 14200276 +28    CoreFoundation                                            0x00000001804284b8 0x180395000 + 603320 +29    CoreFoundation                                            0x0000000180428400 0x180395000 + 603136 +30    CoreFoundation                                            0x0000000180427b88 0x180395000 + 600968 +31    CoreFoundation                                            0x0000000180422584 0x180395000 + 578948 +32    CoreFoundation                                            0x0000000180421e3c 0x180395000 + 577084 +33    GraphicsServices                                        0x0000000190f62d00 0x190f60000 + 11520 +34    UIKitCore                                                      0x0000000185bcec98 0x184d72000 + 15060120 +35    UIKitCore                                                      0x0000000185bd3064 0x184d72000 + 15077476 +36    SwiftUI                                                          0x00000001d3953aa8 0x1d30fe000 + 8739496 +37    SwiftUI                                                          0x00000001d39537d0 0x1d30fe000 + 8738768 +38    SwiftUI                                                          0x00000001d36e09e0 0x1d30fe000 + 6171104 +39    opbeans-swift.debug.dylib                      0x0000000104d4b934 0x104d20000 + 178484 +40    opbeans-swift.debug.dylib                      0x0000000104d4b9e0 0x104d20000 + 178656 +41    ???                                                                  0x000000010227d3d8 0x0 + 0 +42    ???                                                                  0x000000010235ab98 0x0 + 0 + +Thread 1: +0      libsystem_kernel.dylib                            0x00000001021c6680 0x1021c4000 + 9856 +1      libsystem_pthread.dylib                          0x000000010214598c 0x102144000 + 6540 + +Thread 2: +0      libsystem_kernel.dylib                            0x00000001021c7e44 0x1021c4000 + 15940 +1      libsystem_c.dylib                                      0x000000018016ed28 0x1800fe000 + 462120 +2      opbeans-swift.debug.dylib                      0x0000000104d49c08 0x104d20000 + 171016 +3      opbeans-swift.debug.dylib                      0x0000000104d42814 0x104d20000 + 141332 +4      libdispatch.dylib                                      0x000000018017c788 0x18017b000 + 6024 +5      libdispatch.dylib                                      0x0000000180197278 0x18017b000 + 115320 +6      libdispatch.dylib                                      0x00000001801b2350 0x18017b000 + 226128 +7      libdispatch.dylib                                      0x000000018018fc10 0x18017b000 + 85008 +8      libdispatch.dylib                                      0x00000001801903b4 0x18017b000 + 86964 +9      libsystem_pthread.dylib                          0x0000000102146b90 0x102144000 + 11152 +10    libsystem_pthread.dylib                          0x000000010214598c 0x102144000 + 6540 + +Thread 3: +0      libsystem_kernel.dylib                            0x00000001021c4b70 0x1021c4000 + 2928 +1      libsystem_kernel.dylib                            0x00000001021ccc28 0x1021c4000 + 35880 +2      libsystem_kernel.dylib                            0x00000001021c4ed8 0x1021c4000 + 3800 +3      CoreFoundation                                            0x0000000180427d14 0x180395000 + 601364 +4      CoreFoundation                                            0x00000001804226f4 0x180395000 + 579316 +5      CoreFoundation                                            0x0000000180421e3c 0x180395000 + 577084 +6      Foundation                                                    0x0000000180f22ddc 0x18082c000 + 7302620 +7      Foundation                                                    0x0000000180f22ffc 0x18082c000 + 7303164 +8      UIKitCore                                                      0x0000000185c7c724 0x184d72000 + 15771428 +9      Foundation                                                    0x0000000180f49b98 0x18082c000 + 7461784 +10    libsystem_pthread.dylib                          0x000000010214a5f0 0x102144000 + 26096 +11    libsystem_pthread.dylib                          0x0000000102145998 0x102144000 + 6552 + +Thread 4: +0      libsystem_kernel.dylib                            0x00000001021c6680 0x1021c4000 + 9856 +1      libsystem_pthread.dylib                          0x000000010214598c 0x102144000 + 6540 + +Thread 5: +0      libsystem_kernel.dylib                            0x00000001021ca670 0x1021c4000 + 26224 +1      opbeans-swift.debug.dylib                      0x00000001056408f0 0x104d20000 + 9570544 +2      opbeans-swift.debug.dylib                      0x0000000105640938 0x104d20000 + 9570616 +3      opbeans-swift.debug.dylib                      0x00000001056392c0 0x104d20000 + 9540288 +4      opbeans-swift.debug.dylib                      0x0000000105640810 0x104d20000 + 9570320 +5      opbeans-swift.debug.dylib                      0x0000000105622bd0 0x104d20000 + 9448400 +6      opbeans-swift.debug.dylib                      0x0000000105623ea0 0x104d20000 + 9453216 +7      opbeans-swift.debug.dylib                      0x0000000105618b48 0x104d20000 + 9407304 +8      opbeans-swift.debug.dylib                      0x0000000105621c64 0x104d20000 + 9444452 +9      opbeans-swift.debug.dylib                      0x000000010561ca80 0x104d20000 + 9423488 +10    opbeans-swift.debug.dylib                      0x0000000105611004 0x104d20000 + 9375748 +11    opbeans-swift.debug.dylib                      0x000000010561205c 0x104d20000 + 9379932 +12    opbeans-swift.debug.dylib                      0x0000000105615f50 0x104d20000 + 9396048 +13    opbeans-swift.debug.dylib                      0x000000010560a4c8 0x104d20000 + 9348296 +14    opbeans-swift.debug.dylib                      0x00000001056153c0 0x104d20000 + 9393088 +15    opbeans-swift.debug.dylib                      0x000000010560a590 0x104d20000 + 9348496 +16    opbeans-swift.debug.dylib                      0x000000010560a460 0x104d20000 + 9348192 +17    opbeans-swift.debug.dylib                      0x0000000105611410 0x104d20000 + 9376784 +18    opbeans-swift.debug.dylib                      0x00000001055c206c 0x104d20000 + 9052268 +19    opbeans-swift.debug.dylib                      0x00000001055c2660 0x104d20000 + 9053792 +20    opbeans-swift.debug.dylib                      0x00000001055c6e44 0x104d20000 + 9072196 +21    opbeans-swift.debug.dylib                      0x00000001056418b4 0x104d20000 + 9574580 +22    opbeans-swift.debug.dylib                      0x0000000105643fac 0x104d20000 + 9584556 +23    opbeans-swift.debug.dylib                      0x0000000105644064 0x104d20000 + 9584740 +24    libsystem_pthread.dylib                          0x000000010214a5f0 0x102144000 + 26096 +25    libsystem_pthread.dylib                          0x0000000102145998 0x102144000 + 6552 + +Thread 6: +0      libsystem_kernel.dylib                            0x00000001021c8014 0x1021c4000 + 16404 +1      Foundation                                                    0x0000000180ecb4ec 0x18082c000 + 6943980 +2      opbeans-swift.debug.dylib                      0x0000000104ee4f90 0x104d20000 + 1855376 +3      opbeans-swift.debug.dylib                      0x0000000104ee5934 0x104d20000 + 1857844 +4      opbeans-swift.debug.dylib                      0x0000000104e13e98 0x104d20000 + 999064 +5      opbeans-swift.debug.dylib                      0x0000000104ee4d5c 0x104d20000 + 1854812 +6      opbeans-swift.debug.dylib                      0x0000000104ee5230 0x104d20000 + 1856048 +7      Foundation                                                    0x0000000180f49b98 0x18082c000 + 7461784 +8      libsystem_pthread.dylib                          0x000000010214a5f0 0x102144000 + 26096 +9      libsystem_pthread.dylib                          0x0000000102145998 0x102144000 + 6552 + +Thread 7: +0      libsystem_kernel.dylib                            0x00000001021c8014 0x1021c4000 + 16404 +1      Foundation                                                    0x0000000180ecb4ec 0x18082c000 + 6943980 +2      opbeans-swift.debug.dylib                      0x0000000104e13ba0 0x104d20000 + 998304 +3      opbeans-swift.debug.dylib                      0x0000000104e14308 0x104d20000 + 1000200 +4      opbeans-swift.debug.dylib                      0x0000000104e13e98 0x104d20000 + 999064 +5      opbeans-swift.debug.dylib                      0x0000000104e13968 0x104d20000 + 997736 +6      opbeans-swift.debug.dylib                      0x0000000104e13f24 0x104d20000 + 999204 +7      Foundation                                                    0x0000000180f49b98 0x18082c000 + 7461784 +8      libsystem_pthread.dylib                          0x000000010214a5f0 0x102144000 + 26096 +9      libsystem_pthread.dylib                          0x0000000102145998 0x102144000 + 6552 + +Thread 8: +0      libsystem_kernel.dylib                            0x00000001021c8014 0x1021c4000 + 16404 +1      Foundation                                                    0x0000000180ecb4ec 0x18082c000 + 6943980 +2      opbeans-swift.debug.dylib                      0x0000000104e13ba0 0x104d20000 + 998304 +3      opbeans-swift.debug.dylib                      0x0000000104e14308 0x104d20000 + 1000200 +4      opbeans-swift.debug.dylib                      0x0000000104e13e98 0x104d20000 + 999064 +5      opbeans-swift.debug.dylib                      0x0000000104e13968 0x104d20000 + 997736 +6      opbeans-swift.debug.dylib                      0x0000000104e13f24 0x104d20000 + 999204 +7      Foundation                                                    0x0000000180f49b98 0x18082c000 + 7461784 +8      libsystem_pthread.dylib                          0x000000010214a5f0 0x102144000 + 26096 +9      libsystem_pthread.dylib                          0x0000000102145998 0x102144000 + 6552 + +Thread 9: +0      libsystem_kernel.dylib                            0x00000001021c6680 0x1021c4000 + 9856 +1      libsystem_pthread.dylib                          0x000000010214598c 0x102144000 + 6540 + +Thread 10: +0      libswiftCore.dylib                                    0x00000001959fc4ac 0x1956e8000 + 3228844 +1      libswiftCore.dylib                                    0x00000001959fb838 0x1956e8000 + 3225656 +2      libswiftCore.dylib                                    0x00000001959f9cc8 0x1956e8000 + 3218632 +3      AttributeGraph                                            0x00000001bfecd3e8 0x1bfeb1000 + 115688 +4      AttributeGraph                                            0x00000001bfececb4 0x1bfeb1000 + 122036 +5      libdispatch.dylib                                      0x0000000180197278 0x18017b000 + 115320 +6      libdispatch.dylib                                      0x00000001801b2350 0x18017b000 + 226128 +7      libdispatch.dylib                                      0x000000018018fc10 0x18017b000 + 85008 +8      libdispatch.dylib                                      0x00000001801903b4 0x18017b000 + 86964 +9      libsystem_pthread.dylib                          0x0000000102146b90 0x102144000 + 11152 +10    libsystem_pthread.dylib                          0x000000010214598c 0x102144000 + 6540 + +Thread 11: +0      libsystem_kernel.dylib                            0x00000001021c6680 0x1021c4000 + 9856 +1      libsystem_pthread.dylib                          0x000000010214598c 0x102144000 + 6540 + +Thread 12: +0      libsystem_kernel.dylib                            0x00000001021c6680 0x1021c4000 + 9856 +1      libsystem_pthread.dylib                          0x000000010214598c 0x102144000 + 6540 + +Thread 13: +0      opbeans-swift.debug.dylib                      0x0000000105b8e770 0x104d20000 + 15132528 +1      opbeans-swift.debug.dylib                      0x0000000105b841d4 0x104d20000 + 15090132 +2      libsystem_pthread.dylib                          0x000000010214a5f0 0x102144000 + 26096 +3      libsystem_pthread.dylib                          0x0000000102145998 0x102144000 + 6552 + +Thread 14: +0      libsystem_kernel.dylib                            0x00000001021cef98 0x1021c4000 + 44952 +1      libsystem_pthread.dylib                          0x000000010214a5f0 0x102144000 + 26096 +2      libsystem_pthread.dylib                          0x0000000102145998 0x102144000 + 6552 + +Thread 0 crashed with ARM-64 Thread State: +        pc: 0x0000000195712d2c          fp: 0x000000016dccf120          sp: 0x000000016dccf0a0          x0: 0xe800000000000000 +        x1: 0x0000000000000000          x2: 0x0000000000000000          x3: 0x00006000002318e0          x4: 0x0000000000000008 +        x5: 0x000000016dccef80          x6: 0x2168736172432041          x7: 0x0000000000000000          x8: 0x0000000000000200 +        x9: 0x00000000aa093855        x10: 0x00000000000001ff        x11: 0x00000000000018c0        x12: 0x00000000000007fb +      x13: 0x00000000000007fd        x14: 0x00000000aa2940c7        x15: 0x00000000aa093855        x16: 0x00000000aa200000 +      x17: 0x00000000000000c7        x18: 0x0000000000000000        x19: 0x0000600000c02f70        x20: 0x0000000000000000 +      x21: 0x0000000000000001        x22: 0x0000600000c02f98        x23: 0x00000001d312b8bc        x24: 0x0000600000004070 +      x25: 0x0000600000c032d0        x26: 0x0000000000000000        x27: 0x0000000000000002        x28: 0x0000600000214a20 +        lr: 0x0000000195712d2c      cpsr: 0x0000000060001000 + +Binary Images: +              0x10212c000 -                0x10212ffff +opbeans-swift arm64    /Users/brycebuchanan/Library/Developer/CoreSimulator/Devices/5F5E45F7-760E-4589-9F48-B7264D35395A/data/Containers/Bundle/Application/6817BDFA-329C-4E47-B7C7-B4D053B81515/opbeans-swift.app/opbeans-swift +              0x102144000 -                0x102153fff    libsystem_pthread.dylib arm64    /usr/lib/system/libsystem_pthread.dylib +              0x1021a4000 -                0x1021abfff    libsystem_platform.dylib arm64    <93afc0a9eec93f50933909c7757aa50a> /usr/lib/system/libsystem_platform.dylib +              0x1021c4000 -                0x1021fffff    libsystem_kernel.dylib arm64    <4068b2eea54f397e882dc5e3a40b789a> /usr/lib/system/libsystem_kernel.dylib +              0x1025b8000 -                0x1025c3fff    libobjc-trampolines.dylib arm64    <22dfc62173863de387b29ed27c8be84d> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libobjc-trampolines.dylib +              0x104d20000 -                0x105d77fff    opbeans-swift.debug.dylib arm64    /Users/brycebuchanan/Library/Developer/CoreSimulator/Devices/5F5E45F7-760E-4589-9F48-B7264D35395A/data/Containers/Bundle/Application/6817BDFA-329C-4E47-B7C7-B4D053B81515/opbeans-swift.app/opbeans-swift.debug.dylib +              0x180068000 -                0x1800a491f    libobjc.A.dylib arm64    <3286911c7f923620b8f718ac6061e9d9> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libobjc.A.dylib +              0x1800a5000 -                0x1800be21f    libsystem_trace.dylib arm64    <6faa12e4083d35cc8347750f34ffd1ec> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_trace.dylib +              0x1800bf000 -                0x1800faa9f    libxpc.dylib arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libxpc.dylib +              0x1800fb000 -                0x1800fdda8    libsystem_blocks.dylib arm64    <301e8d00828631bea19935b6d8cf38bf> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_blocks.dylib +              0x1800fe000 -                0x18017a79b    libsystem_c.dylib arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_c.dylib +              0x18017b000 -                0x1801bfb5f    libdispatch.dylib arm64    <7bee27fdf519330daebed6ace467df22> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libdispatch.dylib +              0x1801c0000 -                0x1801ffef7    libsystem_malloc.dylib arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_malloc.dylib +              0x180200000 -                0x18029a64f    libcorecrypto.dylib arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libcorecrypto.dylib +              0x18029b000 -                0x1802b6fff    libc++abi.dylib arm64    <3a16c8a1792d38cf967a72505dfb87e4> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libc++abi.dylib +              0x1802b7000 -                0x1802e1fe2    libdyld.dylib arm64    <4056bff4af5930e787914708c49cffe0> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libdyld.dylib +              0x1802e2000 -                0x1802ea673    libsystem_darwin.dylib arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_darwin.dylib +              0x1802eb000 -                0x18036fffb    libc++.1.dylib arm64    <494bdb39105636e6910ccaf9ec5f81ec> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libc++.1.dylib +              0x180370000 -                0x18039471f    libsystem_info.dylib arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_info.dylib +              0x180395000 -                0x1807acfff    CoreFoundation arm64    <3d4aa1d503aa3365b767944509b9bbfd> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation +              0x1807ad000 -                0x18082b8f3    SystemConfiguration arm64    <99a4dd2c4d163a949d01598c00290588> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration +              0x18082c000 -                0x1813f18df    Foundation arm64    <6ec60314780a318f8bdb5d173b13970e> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Foundation.framework/Foundation +              0x1813f2000 -                0x18141fc77    libCRFSuite.dylib arm64    <1f512f0900fa39c4989738225a6aa14f> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libCRFSuite.dylib +              0x181420000 -                0x181638c9f    CoreServices arm64    <1b198a214877379c85f072a271ec1b01> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreServices.framework/CoreServices +              0x181639000 -                0x1816970f7    libSparse.dylib arm64    <0a4389578a323fe8b05ea13f01072a89> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libSparse.dylib +              0x181698000 -                0x181bf90df    ImageIO arm64    <4674256467fc3ecb915fd8002783c749> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/ImageIO.framework/ImageIO +              0x181bfe000 -                0x181de1b7f    CoreText arm64    <880e3304e1373f38abf0567290c4381f> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreText.framework/CoreText +              0x181de2000 -                0x181f95b9f    Security arm64    <19a0b76e287e33cbb59c0724e7d2b0a8> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Security.framework/Security +              0x181f96000 -                0x18203359f    IOKit arm64    <0771439acb1338c0a90c213036acacbd> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit +              0x182034000 -                0x1820738ff    libMobileGestalt.dylib arm64    <1bffa8a238ce35ab843550706f48ef22> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libMobileGestalt.dylib +              0x182074000 -                0x1820ce5e7    libprotobuf.dylib arm64    <991ed98608833f95990c0d8e51f4aec0> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libprotobuf.dylib +              0x1820cf000 -                0x1820e08cf    libprotobuf-lite.dylib arm64    <55e763046f0c34d4bf931375658f8d29> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libprotobuf-lite.dylib +              0x1820e1000 -                0x18237800b    libicucore.A.dylib arm64    <4d469ab560b7304cb3fcfa97344d6c8c> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libicucore.A.dylib +              0x182379000 -                0x1823a8113    CoreServicesInternal arm64    <0202b827fc4f3c28b26de9dbaca54155> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/CoreServicesInternal.framework/CoreServicesInternal +              0x1823a9000 -                0x1823e403f    WirelessDiagnostics arm64    <543efd2f9ff039c2ba3646787872865e> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/WirelessDiagnostics.framework/WirelessDiagnostics +              0x1823e5000 -                0x1824157b7    libAWDSupport.dylib arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libAWDSupport.dylib +              0x182416000 -                0x18282649f    CoreAudio arm64    <52498879022c3b1f90ab296710191a77> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreAudio.framework/CoreAudio +              0x182827000 -                0x182bb0e9f    CoreImage arm64    <585bedb6c5ce36dca76ddb4ee06386fd> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreImage.framework/CoreImage +              0x182e48000 -                0x182fc2edf    libsqlite3.dylib arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libsqlite3.dylib +              0x182fc3000 -                0x182fcf51e    libsystem_notify.dylib arm64    <239dd2c6bd8c3cfd9500a63b808d4b7f> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_notify.dylib +              0x183499000 -                0x1834da47f    AppSupport arm64    <75cb542596413012957045d95cbf4148> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/AppSupport.framework/AppSupport +              0x1834db000 -                0x1834db387    libnetwork.dylib arm64    <60305c56f5f7381fa84bd6a416bfb3c7> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libnetwork.dylib +              0x1834dc000 -                0x1835ec9df    ManagedConfiguration arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/ManagedConfiguration.framework/ManagedConfiguration +              0x1835ed000 -                0x183624ebf    CoreServicesStore arm64    <6bb5163cec18358596d353506709a991> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/CoreServicesStore.framework/CoreServicesStore +              0x183625000 -                0x183641e7f    UserManagement arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UserManagement.framework/UserManagement +              0x183b23000 -                0x183b3b6ff    ProtocolBuffer arm64    <887ce4ece3d23e8681706f52b6e3f504> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/ProtocolBuffer.framework/ProtocolBuffer +              0x183b3c000 -                0x183b4f9bf    CommonUtilities arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/CommonUtilities.framework/CommonUtilities +              0x183b50000 -                0x183ba9eff    RunningBoardServices arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/RunningBoardServices.framework/RunningBoardServices +              0x183baa000 -                0x183c7795f    BaseBoard arm64    <3299412bf1c13fc28f2f885df7dfee05> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/BaseBoard.framework/BaseBoard +              0x1845a8000 -                0x1847fbdff    CoreLocation arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreLocation.framework/CoreLocation +              0x184805000 -                0x1848774df    Accounts arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Accounts.framework/Accounts +              0x184899000 -                0x184c1a83f    CFNetwork arm64    <4642e7e4b83d3225a892a22fdca4c077> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CFNetwork.framework/CFNetwork +              0x184c1b000 -                0x184d7105f    UIFoundation arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIFoundation.framework/UIFoundation +              0x184d72000 -                0x186adb8df    UIKitCore arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore +              0x186adc000 -                0x186ae89bf    AssertionServices arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/AssertionServices.framework/AssertionServices +              0x186ae9000 -                0x186ce9e3f    CoreTelephony arm64    <3324ab32d1f43ad1950c444cd71ec436> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreTelephony.framework/CoreTelephony +              0x186cea000 -                0x186ceaf9f    AggregateDictionary arm64    <86115f236ca130a98b3949a8e0f4938d> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/AggregateDictionary.framework/AggregateDictionary +              0x186ceb000 -                0x186d01c0b    libsystem_asl.dylib arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_asl.dylib +              0x186d02000 -                0x186dc783f    CloudDocs arm64    <9c28961eeb07396ab773714e63201a91> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/CloudDocs.framework/CloudDocs +              0x186dc8000 -                0x1871a7edf    CoreData arm64    <7bf1e626f000323eb3a6f9faae15b48a> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreData.framework/CoreData +              0x1876ba000 -                0x18771d6df    BoardServices arm64    <5c560e9f2a9f3c55a2064168a4009432> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/BoardServices.framework/BoardServices +              0x18771e000 -                0x1877e44ff    libboringssl.dylib arm64    <0463a94630f33854b4ae368a9287e4a0> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libboringssl.dylib +              0x1877e5000 -                0x18781269f    CoreAnalytics arm64    <69494a450b2d3d82bdc99860d46f2699> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/CoreAnalytics.framework/CoreAnalytics +              0x187813000 -                0x187b4bf9f    CloudKit arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/Ru<…> diff --git a/enrichments/logs/internal/mobile/testdata/ios/thread-8-crash.txt b/enrichments/logs/internal/mobile/testdata/ios/thread-8-crash.txt new file mode 100644 index 0000000..1bb388a --- /dev/null +++ b/enrichments/logs/internal/mobile/testdata/ios/thread-8-crash.txt @@ -0,0 +1,259 @@ +Incident Identifier: F8222EAC-3E63-48A3-8C40-CF22FEA7D952 +Hardware Model:            arm64 +Process:                  opbeans-swift [11220] +Path:                        /Users/brycebuchanan/Library/Developer/CoreSimulator/Devices/5F5E45F7-760E-4589-9F48-B7264D35395A/data/Containers/Bundle/Application/06BCE84E-9AB0-42C0-8D74-72B8945645BC/opbeans-swift.app/opbeans-swift +Identifier:            co.elastic.opbeans-swift +Version:                  4.0.0 (01042024) +Code Type:              ARM-64 +Parent Process:    launchd_sim [63657] + +Date/Time:              2025-06-05 15:46:48 +0000 +OS Version:            Mac OS X 18.4 (24F74) +Report Version:    104 + +Exception Type:    SIGTRAP +Exception Codes: TRAP_BRKPT at 0x195712d2c +Crashed Thread:    8 + +Thread 0: +0      libsystem_kernel.dylib                            0x00000001047b0b70 0x1047b0000 + 2928 +1      libsystem_kernel.dylib                            0x00000001047b8c28 0x1047b0000 + 35880 +2      libsystem_kernel.dylib                            0x00000001047b0ed8 0x1047b0000 + 3800 +3      CoreFoundation                                            0x0000000180427d14 0x180395000 + 601364 +4      CoreFoundation                                            0x00000001804226f4 0x180395000 + 579316 +5      CoreFoundation                                            0x0000000180421e3c 0x180395000 + 577084 +6      GraphicsServices                                        0x0000000190f62d00 0x190f60000 + 11520 +7      UIKitCore                                                      0x0000000185bcec98 0x184d72000 + 15060120 +8      UIKitCore                                                      0x0000000185bd3064 0x184d72000 + 15077476 +9      SwiftUI                                                          0x00000001d3953aa8 0x1d30fe000 + 8739496 +10    SwiftUI                                                          0x00000001d39537d0 0x1d30fe000 + 8738768 +11    SwiftUI                                                          0x00000001d36e09e0 0x1d30fe000 + 6171104 +12    opbeans-swift.debug.dylib                      0x000000010707bb5c 0x107050000 + 179036 +13    opbeans-swift.debug.dylib                      0x000000010707bc08 0x107050000 + 179208 +14    ???                                                                  0x00000001046f93d8 0x0 + 0 +15    ???                                                                  0x00000001045ceb98 0x0 + 0 + +Thread 1: +0      libsystem_kernel.dylib                            0x00000001047b2680 0x1047b0000 + 9856 +1      libsystem_pthread.dylib                          0x00000001043dd98c 0x1043dc000 + 6540 + +Thread 2: +0      libsystem_kernel.dylib                            0x00000001047b2680 0x1047b0000 + 9856 +1      libsystem_pthread.dylib                          0x00000001043dd98c 0x1043dc000 + 6540 + +Thread 3: +0      libsystem_kernel.dylib                            0x00000001047b2680 0x1047b0000 + 9856 +1      libsystem_pthread.dylib                          0x00000001043dd98c 0x1043dc000 + 6540 + +Thread 4: +0      libsystem_kernel.dylib                            0x00000001047b0b70 0x1047b0000 + 2928 +1      libsystem_kernel.dylib                            0x00000001047b8c28 0x1047b0000 + 35880 +2      libsystem_kernel.dylib                            0x00000001047b0ed8 0x1047b0000 + 3800 +3      CoreFoundation                                            0x0000000180427d14 0x180395000 + 601364 +4      CoreFoundation                                            0x00000001804226f4 0x180395000 + 579316 +5      CoreFoundation                                            0x0000000180421e3c 0x180395000 + 577084 +6      Foundation                                                    0x0000000180f22ddc 0x18082c000 + 7302620 +7      Foundation                                                    0x0000000180f22ffc 0x18082c000 + 7303164 +8      UIKitCore                                                      0x0000000185c7c724 0x184d72000 + 15771428 +9      Foundation                                                    0x0000000180f49b98 0x18082c000 + 7461784 +10    libsystem_pthread.dylib                          0x00000001043e25f0 0x1043dc000 + 26096 +11    libsystem_pthread.dylib                          0x00000001043dd998 0x1043dc000 + 6552 + +Thread 5: +0      libsystem_kernel.dylib                            0x00000001047b2680 0x1047b0000 + 9856 +1      libsystem_pthread.dylib                          0x00000001043dd98c 0x1043dc000 + 6540 + +Thread 6: +0      libsystem_kernel.dylib                            0x00000001047b3e44 0x1047b0000 + 15940 +1      libsystem_c.dylib                                      0x000000018016ed28 0x1800fe000 + 462120 +2      opbeans-swift.debug.dylib                      0x0000000107079e30 0x107050000 + 171568 +3      opbeans-swift.debug.dylib                      0x0000000107072814 0x107050000 + 141332 +4      libdispatch.dylib                                      0x000000018017c788 0x18017b000 + 6024 +5      libdispatch.dylib                                      0x0000000180197278 0x18017b000 + 115320 +6      libdispatch.dylib                                      0x00000001801b2350 0x18017b000 + 226128 +7      libdispatch.dylib                                      0x000000018018fc10 0x18017b000 + 85008 +8      libdispatch.dylib                                      0x00000001801903b4 0x18017b000 + 86964 +9      libsystem_pthread.dylib                          0x00000001043deb90 0x1043dc000 + 11152 +10    libsystem_pthread.dylib                          0x00000001043dd98c 0x1043dc000 + 6540 + +Thread 7: +0      libsystem_kernel.dylib                            0x00000001047b2680 0x1047b0000 + 9856 +1      libsystem_pthread.dylib                          0x00000001043dd98c 0x1043dc000 + 6540 + +Thread 8 Crashed: +0      libswiftCore.dylib                                    0x0000000195712d2c 0x1956e8000 + 175404 +1      opbeans-swift.debug.dylib                      0x0000000107077048 0x107050000 + 159816 +2      opbeans-swift.debug.dylib                      0x0000000107072814 0x107050000 + 141332 +3      libdispatch.dylib                                      0x000000018017c788 0x18017b000 + 6024 +4      libdispatch.dylib                                      0x0000000180197278 0x18017b000 + 115320 +5      libdispatch.dylib                                      0x00000001801b2350 0x18017b000 + 226128 +6      libdispatch.dylib                                      0x000000018018fc10 0x18017b000 + 85008 +7      libdispatch.dylib                                      0x00000001801903b4 0x18017b000 + 86964 +8      libsystem_pthread.dylib                          0x00000001043deb90 0x1043dc000 + 11152 +9      libsystem_pthread.dylib                          0x00000001043dd98c 0x1043dc000 + 6540 + +Thread 9: +0      libsystem_kernel.dylib                            0x00000001047b2680 0x1047b0000 + 9856 +1      libsystem_pthread.dylib                          0x00000001043dd98c 0x1043dc000 + 6540 + +Thread 10: +0      libsystem_kernel.dylib                            0x00000001047b6670 0x1047b0000 + 26224 +1      opbeans-swift.debug.dylib                      0x0000000107970b18 0x107050000 + 9571096 +2      opbeans-swift.debug.dylib                      0x0000000107970b60 0x107050000 + 9571168 +3      opbeans-swift.debug.dylib                      0x00000001079694e8 0x107050000 + 9540840 +4      opbeans-swift.debug.dylib                      0x0000000107970a38 0x107050000 + 9570872 +5      opbeans-swift.debug.dylib                      0x0000000107952df8 0x107050000 + 9448952 +6      opbeans-swift.debug.dylib                      0x00000001079540c8 0x107050000 + 9453768 +7      opbeans-swift.debug.dylib                      0x0000000107948d70 0x107050000 + 9407856 +8      opbeans-swift.debug.dylib                      0x0000000107951e8c 0x107050000 + 9445004 +9      opbeans-swift.debug.dylib                      0x000000010794cca8 0x107050000 + 9424040 +10    opbeans-swift.debug.dylib                      0x000000010794122c 0x107050000 + 9376300 +11    opbeans-swift.debug.dylib                      0x0000000107942284 0x107050000 + 9380484 +12    opbeans-swift.debug.dylib                      0x0000000107946178 0x107050000 + 9396600 +13    opbeans-swift.debug.dylib                      0x000000010793a6f0 0x107050000 + 9348848 +14    opbeans-swift.debug.dylib                      0x00000001079455e8 0x107050000 + 9393640 +15    opbeans-swift.debug.dylib                      0x000000010793a7b8 0x107050000 + 9349048 +16    opbeans-swift.debug.dylib                      0x000000010793a688 0x107050000 + 9348744 +17    opbeans-swift.debug.dylib                      0x0000000107941638 0x107050000 + 9377336 +18    opbeans-swift.debug.dylib                      0x00000001078f2294 0x107050000 + 9052820 +19    opbeans-swift.debug.dylib                      0x00000001078f2888 0x107050000 + 9054344 +20    opbeans-swift.debug.dylib                      0x00000001078f706c 0x107050000 + 9072748 +21    opbeans-swift.debug.dylib                      0x0000000107971adc 0x107050000 + 9575132 +22    opbeans-swift.debug.dylib                      0x00000001079741d4 0x107050000 + 9585108 +23    opbeans-swift.debug.dylib                      0x000000010797428c 0x107050000 + 9585292 +24    libsystem_pthread.dylib                          0x00000001043e25f0 0x1043dc000 + 26096 +25    libsystem_pthread.dylib                          0x00000001043dd998 0x1043dc000 + 6552 + +Thread 11: +0      libsystem_kernel.dylib                            0x00000001047b4014 0x1047b0000 + 16404 +1      Foundation                                                    0x0000000180ecb4ec 0x18082c000 + 6943980 +2      opbeans-swift.debug.dylib                      0x00000001072151b8 0x107050000 + 1855928 +3      opbeans-swift.debug.dylib                      0x0000000107215b5c 0x107050000 + 1858396 +4      opbeans-swift.debug.dylib                      0x00000001071440c0 0x107050000 + 999616 +5      opbeans-swift.debug.dylib                      0x0000000107214f84 0x107050000 + 1855364 +6      opbeans-swift.debug.dylib                      0x0000000107215458 0x107050000 + 1856600 +7      Foundation                                                    0x0000000180f49b98 0x18082c000 + 7461784 +8      libsystem_pthread.dylib                          0x00000001043e25f0 0x1043dc000 + 26096 +9      libsystem_pthread.dylib                          0x00000001043dd998 0x1043dc000 + 6552 + +Thread 12: +0      libsystem_kernel.dylib                            0x00000001047b4014 0x1047b0000 + 16404 +1      Foundation                                                    0x0000000180ecb4ec 0x18082c000 + 6943980 +2      opbeans-swift.debug.dylib                      0x0000000107143dc8 0x107050000 + 998856 +3      opbeans-swift.debug.dylib                      0x0000000107144530 0x107050000 + 1000752 +4      opbeans-swift.debug.dylib                      0x00000001071440c0 0x107050000 + 999616 +5      opbeans-swift.debug.dylib                      0x0000000107143b90 0x107050000 + 998288 +6      opbeans-swift.debug.dylib                      0x000000010714414c 0x107050000 + 999756 +7      Foundation                                                    0x0000000180f49b98 0x18082c000 + 7461784 +8      libsystem_pthread.dylib                          0x00000001043e25f0 0x1043dc000 + 26096 +9      libsystem_pthread.dylib                          0x00000001043dd998 0x1043dc000 + 6552 + +Thread 13: +0      libsystem_kernel.dylib                            0x00000001047b4014 0x1047b0000 + 16404 +1      Foundation                                                    0x0000000180ecb4ec 0x18082c000 + 6943980 +2      opbeans-swift.debug.dylib                      0x0000000107143dc8 0x107050000 + 998856 +3      opbeans-swift.debug.dylib                      0x0000000107144530 0x107050000 + 1000752 +4      opbeans-swift.debug.dylib                      0x00000001071440c0 0x107050000 + 999616 +5      opbeans-swift.debug.dylib                      0x0000000107143b90 0x107050000 + 998288 +6      opbeans-swift.debug.dylib                      0x000000010714414c 0x107050000 + 999756 +7      Foundation                                                    0x0000000180f49b98 0x18082c000 + 7461784 +8      libsystem_pthread.dylib                          0x00000001043e25f0 0x1043dc000 + 26096 +9      libsystem_pthread.dylib                          0x00000001043dd998 0x1043dc000 + 6552 + +Thread 14: +0      opbeans-swift.debug.dylib                      0x0000000107ebe9b0 0x107050000 + 15133104 +1      opbeans-swift.debug.dylib                      0x0000000107eb4414 0x107050000 + 15090708 +2      libsystem_pthread.dylib                          0x00000001043e25f0 0x1043dc000 + 26096 +3      libsystem_pthread.dylib                          0x00000001043dd998 0x1043dc000 + 6552 + +Thread 15: +0      libsystem_kernel.dylib                            0x00000001047baf98 0x1047b0000 + 44952 +1      libsystem_pthread.dylib                          0x00000001043e25f0 0x1043dc000 + 26096 +2      libsystem_pthread.dylib                          0x00000001043dd998 0x1043dc000 + 6552 + +Thread 16: +0      ???                                                                  0x0000000000000000 0x0 + 0 + +Thread 8 crashed with ARM-64 Thread State: +        pc: 0x0000000195712d2c          fp: 0x000000016c0c6e00          sp: 0x000000016c0c6d80          x0: 0xe800000000000000 +        x1: 0x0000000000000000          x2: 0x0000000000000000          x3: 0x00006000003d9f80          x4: 0x0000000000000008 +        x5: 0x000000016c0c6c60          x6: 0x2168736172432041          x7: 0x0000000000000000          x8: 0x0000000000000200 +        x9: 0x00000000c8a8709c        x10: 0x00000000000001ff        x11: 0x0000000000001f60        x12: 0x00000000000007fb +      x13: 0x00000000000007fd        x14: 0x00000000c8c878fc        x15: 0x00000000c8a8709c        x16: 0x00000000c8c00000 +      x17: 0x00000000000000fc        x18: 0x0000000000000000        x19: 0x0000600000c253e0        x20: 0x0000000000000000 +      x21: 0xffffffffffffffff        x22: 0x0000000000000000        x23: 0x00000000fff0ffff        x24: 0x0000600001720d00 +      x25: 0x0000000000000000        x26: 0x0000000000000114        x27: 0x0000000000000004        x28: 0x0000000000000000 +        lr: 0x0000000195712d2c      cpsr: 0x0000000060001000 + +Binary Images: +              0x1043c4000 -                0x1043c7fff +opbeans-swift arm64    /Users/brycebuchanan/Library/Developer/CoreSimulator/Devices/5F5E45F7-760E-4589-9F48-B7264D35395A/data/Containers/Bundle/Application/06BCE84E-9AB0-42C0-8D74-72B8945645BC/opbeans-swift.app/opbeans-swift +              0x1043dc000 -                0x1043ebfff    libsystem_pthread.dylib arm64    /usr/lib/system/libsystem_pthread.dylib +              0x10443c000 -                0x104443fff    libsystem_platform.dylib arm64    <93afc0a9eec93f50933909c7757aa50a> /usr/lib/system/libsystem_platform.dylib +              0x1047b0000 -                0x1047ebfff    libsystem_kernel.dylib arm64    <4068b2eea54f397e882dc5e3a40b789a> /usr/lib/system/libsystem_kernel.dylib +              0x104848000 -                0x104853fff    libobjc-trampolines.dylib arm64    <22dfc62173863de387b29ed27c8be84d> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libobjc-trampolines.dylib +              0x107050000 -                0x1080a7fff    opbeans-swift.debug.dylib arm64    /Users/brycebuchanan/Library/Developer/CoreSimulator/Devices/5F5E45F7-760E-4589-9F48-B7264D35395A/data/Containers/Bundle/Application/06BCE84E-9AB0-42C0-8D74-72B8945645BC/opbeans-swift.app/opbeans-swift.debug.dylib +              0x180068000 -                0x1800a491f    libobjc.A.dylib arm64    <3286911c7f923620b8f718ac6061e9d9> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libobjc.A.dylib +              0x1800a5000 -                0x1800be21f    libsystem_trace.dylib arm64    <6faa12e4083d35cc8347750f34ffd1ec> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_trace.dylib +              0x1800bf000 -                0x1800faa9f    libxpc.dylib arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libxpc.dylib +              0x1800fb000 -                0x1800fdda8    libsystem_blocks.dylib arm64    <301e8d00828631bea19935b6d8cf38bf> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_blocks.dylib +              0x1800fe000 -                0x18017a79b    libsystem_c.dylib arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_c.dylib +              0x18017b000 -                0x1801bfb5f    libdispatch.dylib arm64    <7bee27fdf519330daebed6ace467df22> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libdispatch.dylib +              0x1801c0000 -                0x1801ffef7    libsystem_malloc.dylib arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_malloc.dylib +              0x180200000 -                0x18029a64f    libcorecrypto.dylib arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libcorecrypto.dylib +              0x18029b000 -                0x1802b6fff    libc++abi.dylib arm64    <3a16c8a1792d38cf967a72505dfb87e4> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libc++abi.dylib +              0x1802b7000 -                0x1802e1fe2    libdyld.dylib arm64    <4056bff4af5930e787914708c49cffe0> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libdyld.dylib +              0x1802e2000 -                0x1802ea673    libsystem_darwin.dylib arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_darwin.dylib +              0x1802eb000 -                0x18036fffb    libc++.1.dylib arm64    <494bdb39105636e6910ccaf9ec5f81ec> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libc++.1.dylib +              0x180370000 -                0x18039471f    libsystem_info.dylib arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_info.dylib +              0x180395000 -                0x1807acfff    CoreFoundation arm64    <3d4aa1d503aa3365b767944509b9bbfd> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation +              0x1807ad000 -                0x18082b8f3    SystemConfiguration arm64    <99a4dd2c4d163a949d01598c00290588> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration +              0x18082c000 -                0x1813f18df    Foundation arm64    <6ec60314780a318f8bdb5d173b13970e> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Foundation.framework/Foundation +              0x1813f2000 -                0x18141fc77    libCRFSuite.dylib arm64    <1f512f0900fa39c4989738225a6aa14f> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libCRFSuite.dylib +              0x181420000 -                0x181638c9f    CoreServices arm64    <1b198a214877379c85f072a271ec1b01> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreServices.framework/CoreServices +              0x181639000 -                0x1816970f7    libSparse.dylib arm64    <0a4389578a323fe8b05ea13f01072a89> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libSparse.dylib +              0x181698000 -                0x181bf90df    ImageIO arm64    <4674256467fc3ecb915fd8002783c749> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/ImageIO.framework/ImageIO +              0x181bfe000 -                0x181de1b7f    CoreText arm64    <880e3304e1373f38abf0567290c4381f> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreText.framework/CoreText +              0x181de2000 -                0x181f95b9f    Security arm64    <19a0b76e287e33cbb59c0724e7d2b0a8> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Security.framework/Security +              0x181f96000 -                0x18203359f    IOKit arm64    <0771439acb1338c0a90c213036acacbd> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit +              0x182034000 -                0x1820738ff    libMobileGestalt.dylib arm64    <1bffa8a238ce35ab843550706f48ef22> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libMobileGestalt.dylib +              0x182074000 -                0x1820ce5e7    libprotobuf.dylib arm64    <991ed98608833f95990c0d8e51f4aec0> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libprotobuf.dylib +              0x1820cf000 -                0x1820e08cf    libprotobuf-lite.dylib arm64    <55e763046f0c34d4bf931375658f8d29> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libprotobuf-lite.dylib +              0x1820e1000 -                0x18237800b    libicucore.A.dylib arm64    <4d469ab560b7304cb3fcfa97344d6c8c> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libicucore.A.dylib +              0x182379000 -                0x1823a8113    CoreServicesInternal arm64    <0202b827fc4f3c28b26de9dbaca54155> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/CoreServicesInternal.framework/CoreServicesInternal +              0x1823a9000 -                0x1823e403f    WirelessDiagnostics arm64    <543efd2f9ff039c2ba3646787872865e> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/WirelessDiagnostics.framework/WirelessDiagnostics +              0x1823e5000 -                0x1824157b7    libAWDSupport.dylib arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libAWDSupport.dylib +              0x182416000 -                0x18282649f    CoreAudio arm64    <52498879022c3b1f90ab296710191a77> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreAudio.framework/CoreAudio +              0x182827000 -                0x182bb0e9f    CoreImage arm64    <585bedb6c5ce36dca76ddb4ee06386fd> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreImage.framework/CoreImage +              0x182e48000 -                0x182fc2edf    libsqlite3.dylib arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libsqlite3.dylib +              0x182fc3000 -                0x182fcf51e    libsystem_notify.dylib arm64    <239dd2c6bd8c3cfd9500a63b808d4b7f> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_notify.dylib +              0x183499000 -                0x1834da47f    AppSupport arm64    <75cb542596413012957045d95cbf4148> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/AppSupport.framework/AppSupport +              0x1834db000 -                0x1834db387    libnetwork.dylib arm64    <60305c56f5f7381fa84bd6a416bfb3c7> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libnetwork.dylib +              0x1834dc000 -                0x1835ec9df    ManagedConfiguration arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/ManagedConfiguration.framework/ManagedConfiguration +              0x1835ed000 -                0x183624ebf    CoreServicesStore arm64    <6bb5163cec18358596d353506709a991> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/CoreServicesStore.framework/CoreServicesStore +              0x183625000 -                0x183641e7f    UserManagement arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UserManagement.framework/UserManagement +              0x183b23000 -                0x183b3b6ff    ProtocolBuffer arm64    <887ce4ece3d23e8681706f52b6e3f504> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/ProtocolBuffer.framework/ProtocolBuffer +              0x183b3c000 -                0x183b4f9bf    CommonUtilities arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/CommonUtilities.framework/CommonUtilities +              0x183b50000 -                0x183ba9eff    RunningBoardServices arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/RunningBoardServices.framework/RunningBoardServices +              0x183baa000 -                0x183c7795f    BaseBoard arm64    <3299412bf1c13fc28f2f885df7dfee05> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/BaseBoard.framework/BaseBoard +              0x1845a8000 -                0x1847fbdff    CoreLocation arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreLocation.framework/CoreLocation +              0x184805000 -                0x1848774df    Accounts arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Accounts.framework/Accounts +              0x184899000 -                0x184c1a83f    CFNetwork arm64    <4642e7e4b83d3225a892a22fdca4c077> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CFNetwork.framework/CFNetwork +              0x184c1b000 -                0x184d7105f    UIFoundation arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIFoundation.framework/UIFoundation +              0x184d72000 -                0x186adb8df    UIKitCore arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore +              0x186adc000 -                0x186ae89bf    AssertionServices arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/AssertionServices.framework/AssertionServices +              0x186ae9000 -                0x186ce9e3f    CoreTelephony arm64    <3324ab32d1f43ad1950c444cd71ec436> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreTelephony.framework/CoreTelephony +              0x186cea000 -                0x186ceaf9f    AggregateDictionary arm64    <86115f236ca130a98b3949a8e0f4938d> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/AggregateDictionary.framework/AggregateDictionary +              0x186ceb000 -                0x186d01c0b    libsystem_asl.dylib arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_asl.dylib +              0x186d02000 -                0x186dc783f    CloudDocs arm64    <9c28961eeb07396ab773714e63201a91> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/CloudDocs.framework/CloudDocs +              0x186dc8000 -                0x1871a7edf    CoreData arm64    <7bf1e626f000323eb3a6f9faae15b48a> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreData.framework/CoreData +              0x1876ba000 -                0x18771d6df    BoardServices arm64    <5c560e9f2a9f3c55a2064168a4009432> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/BoardServices.framework/BoardServices +              0x18771e000 -                0x1877e44ff    libboringssl.dylib arm64    <0463a94630f33854b4ae368a9287e4a0> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libboringssl.dylib +              0x1877e5000 -                0x18781269f    CoreAnalytics arm64    <69494a450b2d3d82bdc99860d46f2699> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/CoreAnalytics.framework/CoreAnalytics +              0x187813000 -                0x187b4bf9f    CloudKit arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CloudKit.framework/CloudKit +              0x187b4c000 -                0x187bebc3f    SpringBoardServices arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/SpringBoardServices.framework/SpringBoardServices +              0x187bec000 -                0x187cab3df    FrontBoardServices arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices +              0x187cac000 -                0x188b2cf5f    Network arm64    <70ba19ba63ce3b4c9464c95a607990bd> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Network.framework/Network +              0x188b2d000 -                0x188b994a3    libusrtcp.dylib arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libusrtcp.dylib +              0x188b9a000 -                0x18a6026ff    GeoServices arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/GeoServices.framework/GeoServices +              0x18a603000 -                0x18a618e33    TCC arm64    <00c5cd7d98443e978c555918455a3a97> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/TCC.framework/TCC +              0x18a619000 -                0x18a67e5bf    IMFoundation arm64    <2e1611cba49a33959d60584f62766efb> /Library/Developer/Co<…> From e7fbdd893597f407ed7e317188b036786ab43482 Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Tue, 10 Jun 2025 06:46:42 +0200 Subject: [PATCH 54/67] Add Swift stack trace grouping key function using xxHash for iOS crashes --- enrichments/logs/internal/mobile/event.go | 2 +- .../logs/internal/mobile/groupingkey.go | 74 ++++++++++++++++++- .../logs/internal/mobile/groupingkey_test.go | 55 +++++++++++--- .../{android => java}/curated_stacktrace1.txt | 0 .../{android => java}/curated_stacktrace2.txt | 0 .../{android => java}/stacktrace1_a.txt | 0 .../{android => java}/stacktrace1_b.txt | 0 .../{android => java}/stacktrace1_c.txt | 0 .../{android => java}/stacktrace2_a.txt | 0 .../{android => java}/stacktrace2_b.txt | 0 .../{android => java}/stacktrace2_c.txt | 0 .../{ios => swift}/thread-0-crash.txt | 0 .../{ios => swift}/thread-8-crash.txt | 0 13 files changed, 114 insertions(+), 17 deletions(-) rename enrichments/logs/internal/mobile/testdata/{android => java}/curated_stacktrace1.txt (100%) rename enrichments/logs/internal/mobile/testdata/{android => java}/curated_stacktrace2.txt (100%) rename enrichments/logs/internal/mobile/testdata/{android => java}/stacktrace1_a.txt (100%) rename enrichments/logs/internal/mobile/testdata/{android => java}/stacktrace1_b.txt (100%) rename enrichments/logs/internal/mobile/testdata/{android => java}/stacktrace1_c.txt (100%) rename enrichments/logs/internal/mobile/testdata/{android => java}/stacktrace2_a.txt (100%) rename enrichments/logs/internal/mobile/testdata/{android => java}/stacktrace2_b.txt (100%) rename enrichments/logs/internal/mobile/testdata/{android => java}/stacktrace2_c.txt (100%) rename enrichments/logs/internal/mobile/testdata/{ios => swift}/thread-0-crash.txt (100%) rename enrichments/logs/internal/mobile/testdata/{ios => swift}/thread-8-crash.txt (100%) diff --git a/enrichments/logs/internal/mobile/event.go b/enrichments/logs/internal/mobile/event.go index b3ab577..39dd575 100644 --- a/enrichments/logs/internal/mobile/event.go +++ b/enrichments/logs/internal/mobile/event.go @@ -54,7 +54,7 @@ func enrichCrashEvent(logRecord plog.LogRecord, resourceAttrs map[string]any) { if ok { language, hasLanguage := resourceAttrs["telemetry.sdk.language"] if hasLanguage && language == "java" { - logRecord.Attributes().PutStr(elasticattr.ErrorGroupingKey, CreateGroupingKey(stacktrace.AsString())) + logRecord.Attributes().PutStr(elasticattr.ErrorGroupingKey, CreateJavaStacktraceGroupingKey(stacktrace.AsString())) } } logRecord.Attributes().PutStr(elasticattr.ErrorType, "crash") diff --git a/enrichments/logs/internal/mobile/groupingkey.go b/enrichments/logs/internal/mobile/groupingkey.go index 2a30ba2..0b525f9 100644 --- a/enrichments/logs/internal/mobile/groupingkey.go +++ b/enrichments/logs/internal/mobile/groupingkey.go @@ -26,19 +26,23 @@ import ( ) var ( - // Regex patterns for stack trace processing + // Regex patterns for java stack trace processing errorOrCausePattern = regexp.MustCompile(`^((?:Caused\sby:\s[^:]+)|(?:[^\s][^:]+))(:\s.+)?$`) callSitePattern = regexp.MustCompile(`^\s+at\s.+(:\d+)\)$`) unwantedPattern = regexp.MustCompile(`\s+`) allLinesPattern = regexp.MustCompile(`(m?).+`) + + // Regex patterns for swift stack trace processing + iosCrashedThreadPattern = regexp.MustCompile(`^Thread\s+(\d+)\s+Crashed:$`) + iosThreadPattern = regexp.MustCompile(`^Thread\s+(\d+):$`) ) -func CreateGroupingKey(stacktrace string) string { - hash := xxhash.Sum64String(curateStacktrace(stacktrace)) +func CreateJavaStacktraceGroupingKey(stacktrace string) string { + hash := xxhash.Sum64String(curateJavaStacktrace(stacktrace)) return fmt.Sprintf("%016x", hash) } -func curateStacktrace(stacktrace string) string { +func curateJavaStacktrace(stacktrace string) string { curatedLines := allLinesPattern.ReplaceAllStringFunc(stacktrace, func(s string) string { if errorOrCausePattern.MatchString(s) { return errorOrCausePattern.ReplaceAllString(s, "$1") @@ -51,3 +55,65 @@ func curateStacktrace(stacktrace string) string { return unwantedPattern.ReplaceAllString(curatedLines, "") } + +func CreateSwiftStacktraceGroupingKey(stacktrace string) string { + // Extract the crashed thread block + crashThreadContent := extractCrashedThread(stacktrace) + + // Hash the crashed thread content using xxhash + hash := xxhash.Sum64String(crashThreadContent) + return fmt.Sprintf("%016x", hash) +} + +func extractCrashedThread(stacktrace string) string { + lines := strings.Split(stacktrace, "\n") + + var crashedThreadLines []string + var inCrashedThread bool + + for i, line := range lines { + // Check if this line indicates the start of the crashed thread + if iosCrashedThreadPattern.MatchString(line) { + inCrashedThread = true + crashThreadMatch := iosCrashedThreadPattern.FindStringSubmatch(line) + crashThreadNum := crashThreadMatch[1] + crashThreadHeader := fmt.Sprintf("Thread %s Crashed:", crashThreadNum) + crashThreadVerbatim := fmt.Sprintf("Thread%sCrashed", crashThreadNum) + crashThreadFormatted := unwantedPattern.ReplaceAllString(crashThreadVerbatim, "") + crashThreadHeader = unwantedPattern.ReplaceAllString(crashThreadHeader, "") + + // Start capturing the crashed thread, beginning with the header + crashGrepKey := fmt.Sprintf("%s:", crashThreadFormatted) + crashedThreadLines = append(crashedThreadLines, crashGrepKey) + continue + } + + // Check if we've found the end of the crashed thread section + // End is marked by either a new thread section or an empty line followed by another section + if inCrashedThread && (iosThreadPattern.MatchString(line) || + (len(strings.TrimSpace(line)) == 0 && i+1 < len(lines) && len(strings.TrimSpace(lines[i+1])) > 0 && + !strings.HasPrefix(strings.TrimSpace(lines[i+1]), "0"))) { + break + } + + // Add line to the crashed thread content if we're in the crashed thread section + if inCrashedThread && len(strings.TrimSpace(line)) > 0 { + // Format the line to remove unnecessary whitespace + formattedLine := unwantedPattern.ReplaceAllString(line, "") + crashLines := unwantedPattern.ReplaceAllString(formattedLine, "") + crashLines = strings.ReplaceAll(crashLines, ":", "") + crashLines = strings.ReplaceAll(crashLines, "+", "") + crashLines = strings.ReplaceAll(crashLines, "0x", "") + crashLines = strings.Join(strings.Fields(crashLines), "") + crashLines = strings.Trim(crashLines, "0123456789") + + // Add the formatted line to our result + if len(crashLines) > 0 { + crashedThreadLines = append(crashedThreadLines, crashLines) + } + } + } + + // Join all lines with a separator to create the final string for hashing + return strings.Join(crashedThreadLines, "") +} diff --git a/enrichments/logs/internal/mobile/groupingkey_test.go b/enrichments/logs/internal/mobile/groupingkey_test.go index 233bb04..549643b 100644 --- a/enrichments/logs/internal/mobile/groupingkey_test.go +++ b/enrichments/logs/internal/mobile/groupingkey_test.go @@ -26,7 +26,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestCurateStacktrace(t *testing.T) { +func TestCurateJavaStacktrace(t *testing.T) { for _, tc := range []struct { name string stacktraces []string @@ -34,24 +34,24 @@ func TestCurateStacktrace(t *testing.T) { }{ { name: "standalone_stacktrace", - stacktraces: []string{readTestFile(t, "stacktrace1_a.txt"), readTestFile(t, "stacktrace1_b.txt"), readTestFile(t, "stacktrace1_c.txt")}, - curated: readTestFile(t, "curated_stacktrace1.txt"), + stacktraces: []string{readJavaStacktraceFile(t, "stacktrace1_a.txt"), readJavaStacktraceFile(t, "stacktrace1_b.txt"), readJavaStacktraceFile(t, "stacktrace1_c.txt")}, + curated: readJavaStacktraceFile(t, "curated_stacktrace1.txt"), }, { name: "stacktrace_with_cause", - stacktraces: []string{readTestFile(t, "stacktrace2_a.txt"), readTestFile(t, "stacktrace2_b.txt"), readTestFile(t, "stacktrace2_c.txt")}, - curated: readTestFile(t, "curated_stacktrace2.txt"), + stacktraces: []string{readJavaStacktraceFile(t, "stacktrace2_a.txt"), readJavaStacktraceFile(t, "stacktrace2_b.txt"), readJavaStacktraceFile(t, "stacktrace2_c.txt")}, + curated: readJavaStacktraceFile(t, "curated_stacktrace2.txt"), }, } { t.Run(tc.name, func(t *testing.T) { for _, stacktrace := range tc.stacktraces { - assert.Equal(t, tc.curated, curateStacktrace(stacktrace)) + assert.Equal(t, tc.curated, curateJavaStacktrace(stacktrace)) } }) } } -func TestCreateGroupingKey(t *testing.T) { +func TestCreateJavaStacktraceGroupingKey(t *testing.T) { for _, tc := range []struct { name string stacktraces []string @@ -59,25 +59,56 @@ func TestCreateGroupingKey(t *testing.T) { }{ { name: "standalone_stacktrace", - stacktraces: []string{readTestFile(t, "stacktrace1_a.txt"), readTestFile(t, "stacktrace1_b.txt"), readTestFile(t, "stacktrace1_c.txt")}, + stacktraces: []string{readJavaStacktraceFile(t, "stacktrace1_a.txt"), readJavaStacktraceFile(t, "stacktrace1_b.txt"), readJavaStacktraceFile(t, "stacktrace1_c.txt")}, expectedId: "e3d876640dd47864", }, { name: "stacktrace_with_cause", - stacktraces: []string{readTestFile(t, "stacktrace2_a.txt"), readTestFile(t, "stacktrace2_b.txt"), readTestFile(t, "stacktrace2_c.txt")}, + stacktraces: []string{readJavaStacktraceFile(t, "stacktrace2_a.txt"), readJavaStacktraceFile(t, "stacktrace2_b.txt"), readJavaStacktraceFile(t, "stacktrace2_c.txt")}, expectedId: "390d84a9a633fa73", }, } { t.Run(tc.name, func(t *testing.T) { for _, stacktrace := range tc.stacktraces { - assert.Equal(t, tc.expectedId, CreateGroupingKey(stacktrace)) + assert.Equal(t, tc.expectedId, CreateJavaStacktraceGroupingKey(stacktrace)) } }) } } -func readTestFile(t *testing.T, fileName string) string { - bytes, err := os.ReadFile(filepath.Join("testdata", "android", fileName)) +func TestCreateSwiftStacktraceGroupingKey(t *testing.T) { + for _, tc := range []struct { + name string + crashFile string + expectedId string + }{ + { + name: "thread_0_crash", + crashFile: "thread-0-crash.txt", + expectedId: "b032e62a8ac17471", + }, + { + name: "thread_8_crash", + crashFile: "thread-8-crash.txt", + expectedId: "11af41fb7f4bc7ac", + }, + } { + t.Run(tc.name, func(t *testing.T) { + crashReport := readSwiftStacktraceFile(t, tc.crashFile) + actualId := CreateSwiftStacktraceGroupingKey(crashReport) + assert.Equal(t, tc.expectedId, actualId) + }) + } +} + +func readJavaStacktraceFile(t *testing.T, fileName string) string { + bytes, err := os.ReadFile(filepath.Join("testdata", "java", fileName)) + require.NoError(t, err) + return string(bytes) +} + +func readSwiftStacktraceFile(t *testing.T, fileName string) string { + bytes, err := os.ReadFile(filepath.Join("testdata", "swift", fileName)) require.NoError(t, err) return string(bytes) } diff --git a/enrichments/logs/internal/mobile/testdata/android/curated_stacktrace1.txt b/enrichments/logs/internal/mobile/testdata/java/curated_stacktrace1.txt similarity index 100% rename from enrichments/logs/internal/mobile/testdata/android/curated_stacktrace1.txt rename to enrichments/logs/internal/mobile/testdata/java/curated_stacktrace1.txt diff --git a/enrichments/logs/internal/mobile/testdata/android/curated_stacktrace2.txt b/enrichments/logs/internal/mobile/testdata/java/curated_stacktrace2.txt similarity index 100% rename from enrichments/logs/internal/mobile/testdata/android/curated_stacktrace2.txt rename to enrichments/logs/internal/mobile/testdata/java/curated_stacktrace2.txt diff --git a/enrichments/logs/internal/mobile/testdata/android/stacktrace1_a.txt b/enrichments/logs/internal/mobile/testdata/java/stacktrace1_a.txt similarity index 100% rename from enrichments/logs/internal/mobile/testdata/android/stacktrace1_a.txt rename to enrichments/logs/internal/mobile/testdata/java/stacktrace1_a.txt diff --git a/enrichments/logs/internal/mobile/testdata/android/stacktrace1_b.txt b/enrichments/logs/internal/mobile/testdata/java/stacktrace1_b.txt similarity index 100% rename from enrichments/logs/internal/mobile/testdata/android/stacktrace1_b.txt rename to enrichments/logs/internal/mobile/testdata/java/stacktrace1_b.txt diff --git a/enrichments/logs/internal/mobile/testdata/android/stacktrace1_c.txt b/enrichments/logs/internal/mobile/testdata/java/stacktrace1_c.txt similarity index 100% rename from enrichments/logs/internal/mobile/testdata/android/stacktrace1_c.txt rename to enrichments/logs/internal/mobile/testdata/java/stacktrace1_c.txt diff --git a/enrichments/logs/internal/mobile/testdata/android/stacktrace2_a.txt b/enrichments/logs/internal/mobile/testdata/java/stacktrace2_a.txt similarity index 100% rename from enrichments/logs/internal/mobile/testdata/android/stacktrace2_a.txt rename to enrichments/logs/internal/mobile/testdata/java/stacktrace2_a.txt diff --git a/enrichments/logs/internal/mobile/testdata/android/stacktrace2_b.txt b/enrichments/logs/internal/mobile/testdata/java/stacktrace2_b.txt similarity index 100% rename from enrichments/logs/internal/mobile/testdata/android/stacktrace2_b.txt rename to enrichments/logs/internal/mobile/testdata/java/stacktrace2_b.txt diff --git a/enrichments/logs/internal/mobile/testdata/android/stacktrace2_c.txt b/enrichments/logs/internal/mobile/testdata/java/stacktrace2_c.txt similarity index 100% rename from enrichments/logs/internal/mobile/testdata/android/stacktrace2_c.txt rename to enrichments/logs/internal/mobile/testdata/java/stacktrace2_c.txt diff --git a/enrichments/logs/internal/mobile/testdata/ios/thread-0-crash.txt b/enrichments/logs/internal/mobile/testdata/swift/thread-0-crash.txt similarity index 100% rename from enrichments/logs/internal/mobile/testdata/ios/thread-0-crash.txt rename to enrichments/logs/internal/mobile/testdata/swift/thread-0-crash.txt diff --git a/enrichments/logs/internal/mobile/testdata/ios/thread-8-crash.txt b/enrichments/logs/internal/mobile/testdata/swift/thread-8-crash.txt similarity index 100% rename from enrichments/logs/internal/mobile/testdata/ios/thread-8-crash.txt rename to enrichments/logs/internal/mobile/testdata/swift/thread-8-crash.txt From ff7dff862d04a92ac9e313e3c58317a5d5cce414 Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Tue, 10 Jun 2025 07:07:19 +0200 Subject: [PATCH 55/67] Adding testdata curated swift stacktraces --- .../internal/mobile/testdata/swift/curated-thread-0-crash.txt | 1 + .../internal/mobile/testdata/swift/curated-thread-8-crash.txt | 1 + 2 files changed, 2 insertions(+) create mode 100644 enrichments/logs/internal/mobile/testdata/swift/curated-thread-0-crash.txt create mode 100644 enrichments/logs/internal/mobile/testdata/swift/curated-thread-8-crash.txt diff --git a/enrichments/logs/internal/mobile/testdata/swift/curated-thread-0-crash.txt b/enrichments/logs/internal/mobile/testdata/swift/curated-thread-0-crash.txt new file mode 100644 index 0000000..c741f12 --- /dev/null +++ b/enrichments/logs/internal/mobile/testdata/swift/curated-thread-0-crash.txt @@ -0,0 +1 @@ +Thread0Crashed:0libswiftCore.dylib0x0000000195712d2c0x1956e8000+1754041opbeans-swift.debug.dylib0x0000000104d46e7c0x104d20000+1593562SwiftUICore0x00000001d43501380x1d42a0000+7212083SwiftUICore0x00000001d45017100x1d42a0000+24962724SwiftUICore0x00000001d435953c0x1d42a0000+7591005SwiftUICore0x00000001d435953c0x1d42a0000+7591006SwiftUI0x00000001d3443c380x1d30fe000+34314807SwiftUI0x00000001d36e38800x1d30fe000+61830408SwiftUICore0x00000001d43501380x1d42a0000+7212089SwiftUICore0x00000001d466e0280x1d42a0000+398954410SwiftUICore0x00000001d466d6200x1d42a0000+398697611SwiftUI0x00000001d3ad5ac80x1d30fe000+1032058412SwiftUI0x00000001d3ad5b400x1d30fe000+1032070413UIKitCore0x00000001856f33940x184d72000+996648414UIKitCore0x00000001856fab0c0x184d72000+999706815UIKitCore0x00000001856f83180x184d72000+998684016UIKitCore0x00000001856f807c0x184d72000+998617217UIKitCore0x00000001856ed9300x184d72000+994334418UIKitCore0x00000001856ecc2c0x184d72000+994001219UIKitCore0x00000001856ec9780x184d72000+993932020UIKitCore0x0000000185c0921c0x184d72000+1529910021UIKitCore0x0000000185be8bfc0x184d72000+1516646022UIKitCore0x0000000185c731bc0x184d72000+1573318023UIKitCore0x0000000185c75e600x184d72000+1574460824UIKitCore0x0000000185c6e4740x184d72000+1571339625UIKitCore0x0000000185133f040x184d72000+394010026UIKitCore0x0000000185afd9b80x184d72000+1420332027UIKitCore0x0000000185afcdd40x184d72000+1420027628CoreFoundation0x00000001804284b80x180395000+60332029CoreFoundation0x00000001804284000x180395000+60313630CoreFoundation0x0000000180427b880x180395000+60096831CoreFoundation0x00000001804225840x180395000+57894832CoreFoundation0x0000000180421e3c0x180395000+57708433GraphicsServices0x0000000190f62d000x190f60000+1152034UIKitCore0x0000000185bcec980x184d72000+1506012035UIKitCore0x0000000185bd30640x184d72000+1507747636SwiftUI0x00000001d3953aa80x1d30fe000+873949637SwiftUI0x00000001d39537d00x1d30fe000+873876838SwiftUI0x00000001d36e09e00x1d30fe000+617110439opbeans-swift.debug.dylib0x0000000104d4b9340x104d20000+17848440opbeans-swift.debug.dylib0x0000000104d4b9e00x104d20000+17865641???0x000000010227d3d80x0+042???0x000000010235ab980x0+0 \ No newline at end of file diff --git a/enrichments/logs/internal/mobile/testdata/swift/curated-thread-8-crash.txt b/enrichments/logs/internal/mobile/testdata/swift/curated-thread-8-crash.txt new file mode 100644 index 0000000..b93b6fb --- /dev/null +++ b/enrichments/logs/internal/mobile/testdata/swift/curated-thread-8-crash.txt @@ -0,0 +1 @@ +Thread8Crashed:0libswiftCore.dylib0x0000000195712d2c0x1956e8000+1754041opbeans-swift.debug.dylib0x00000001070770480x107050000+1598162opbeans-swift.debug.dylib0x00000001070728140x107050000+1413323libdispatch.dylib0x000000018017c7880x18017b000+60244libdispatch.dylib0x00000001801972780x18017b000+1153205libdispatch.dylib0x00000001801b23500x18017b000+2261286libdispatch.dylib0x000000018018fc100x18017b000+850087libdispatch.dylib0x00000001801903b40x18017b000+869648libsystem_pthread.dylib0x00000001043deb900x1043dc000+111529libsystem_pthread.dylib0x00000001043dd98c0x1043dc000+6540 \ No newline at end of file From eef5cf44916ae401a3932b2b7c8d3ce0e704e5bb Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Wed, 11 Jun 2025 16:55:54 +0200 Subject: [PATCH 56/67] Removing unicode chars from ios stacktraces --- .../mobile/testdata/swift/thread-0-crash.txt | 470 +++++++++--------- .../mobile/testdata/swift/thread-8-crash.txt | 436 ++++++++-------- 2 files changed, 453 insertions(+), 453 deletions(-) diff --git a/enrichments/logs/internal/mobile/testdata/swift/thread-0-crash.txt b/enrichments/logs/internal/mobile/testdata/swift/thread-0-crash.txt index 82364a2..127f177 100644 --- a/enrichments/logs/internal/mobile/testdata/swift/thread-0-crash.txt +++ b/enrichments/logs/internal/mobile/testdata/swift/thread-0-crash.txt @@ -1,273 +1,273 @@ Incident Identifier: 9782DB4A-7524-4A8F-B7E3-E209B314F750 -Hardware Model:            arm64 -Process:                  opbeans-swift [88086] -Path:                        /Users/brycebuchanan/Library/Developer/CoreSimulator/Devices/5F5E45F7-760E-4589-9F48-B7264D35395A/data/Containers/Bundle/Application/6817BDFA-329C-4E47-B7C7-B4D053B81515/opbeans-swift.app/opbeans-swift -Identifier:            co.elastic.opbeans-swift -Version:                  4.0.0 (01042024) -Code Type:              ARM-64 -Parent Process:    launchd_sim [63657] +Hardware Model: arm64 +Process: opbeans-swift [88086] +Path: /Users/brycebuchanan/Library/Developer/CoreSimulator/Devices/5F5E45F7-760E-4589-9F48-B7264D35395A/data/Containers/Bundle/Application/6817BDFA-329C-4E47-B7C7-B4D053B81515/opbeans-swift.app/opbeans-swift +Identifier: co.elastic.opbeans-swift +Version: 4.0.0 (01042024) +Code Type: ARM-64 +Parent Process: launchd_sim [63657] -Date/Time:              2025-06-05 15:02:14 +0000 -OS Version:            Mac OS X 18.4 (24F74) -Report Version:    104 +Date/Time: 2025-06-05 15:02:14 +0000 +OS Version: Mac OS X 18.4 (24F74) +Report Version: 104 -Exception Type:    SIGTRAP +Exception Type: SIGTRAP Exception Codes: TRAP_BRKPT at 0x195712d2c -Crashed Thread:    0 +Crashed Thread: 0 Thread 0 Crashed: -0      libswiftCore.dylib                                    0x0000000195712d2c 0x1956e8000 + 175404 -1      opbeans-swift.debug.dylib                      0x0000000104d46e7c 0x104d20000 + 159356 -2      SwiftUICore                                                  0x00000001d4350138 0x1d42a0000 + 721208 -3      SwiftUICore                                                  0x00000001d4501710 0x1d42a0000 + 2496272 -4      SwiftUICore                                                  0x00000001d435953c 0x1d42a0000 + 759100 -5      SwiftUICore                                                  0x00000001d435953c 0x1d42a0000 + 759100 -6      SwiftUI                                                          0x00000001d3443c38 0x1d30fe000 + 3431480 -7      SwiftUI                                                          0x00000001d36e3880 0x1d30fe000 + 6183040 -8      SwiftUICore                                                  0x00000001d4350138 0x1d42a0000 + 721208 -9      SwiftUICore                                                  0x00000001d466e028 0x1d42a0000 + 3989544 -10    SwiftUICore                                                  0x00000001d466d620 0x1d42a0000 + 3986976 -11    SwiftUI                                                          0x00000001d3ad5ac8 0x1d30fe000 + 10320584 -12    SwiftUI                                                          0x00000001d3ad5b40 0x1d30fe000 + 10320704 -13    UIKitCore                                                      0x00000001856f3394 0x184d72000 + 9966484 -14    UIKitCore                                                      0x00000001856fab0c 0x184d72000 + 9997068 -15    UIKitCore                                                      0x00000001856f8318 0x184d72000 + 9986840 -16    UIKitCore                                                      0x00000001856f807c 0x184d72000 + 9986172 -17    UIKitCore                                                      0x00000001856ed930 0x184d72000 + 9943344 -18    UIKitCore                                                      0x00000001856ecc2c 0x184d72000 + 9940012 -19    UIKitCore                                                      0x00000001856ec978 0x184d72000 + 9939320 -20    UIKitCore                                                      0x0000000185c0921c 0x184d72000 + 15299100 -21    UIKitCore                                                      0x0000000185be8bfc 0x184d72000 + 15166460 -22    UIKitCore                                                      0x0000000185c731bc 0x184d72000 + 15733180 -23    UIKitCore                                                      0x0000000185c75e60 0x184d72000 + 15744608 -24    UIKitCore                                                      0x0000000185c6e474 0x184d72000 + 15713396 -25    UIKitCore                                                      0x0000000185133f04 0x184d72000 + 3940100 -26    UIKitCore                                                      0x0000000185afd9b8 0x184d72000 + 14203320 -27    UIKitCore                                                      0x0000000185afcdd4 0x184d72000 + 14200276 -28    CoreFoundation                                            0x00000001804284b8 0x180395000 + 603320 -29    CoreFoundation                                            0x0000000180428400 0x180395000 + 603136 -30    CoreFoundation                                            0x0000000180427b88 0x180395000 + 600968 -31    CoreFoundation                                            0x0000000180422584 0x180395000 + 578948 -32    CoreFoundation                                            0x0000000180421e3c 0x180395000 + 577084 -33    GraphicsServices                                        0x0000000190f62d00 0x190f60000 + 11520 -34    UIKitCore                                                      0x0000000185bcec98 0x184d72000 + 15060120 -35    UIKitCore                                                      0x0000000185bd3064 0x184d72000 + 15077476 -36    SwiftUI                                                          0x00000001d3953aa8 0x1d30fe000 + 8739496 -37    SwiftUI                                                          0x00000001d39537d0 0x1d30fe000 + 8738768 -38    SwiftUI                                                          0x00000001d36e09e0 0x1d30fe000 + 6171104 -39    opbeans-swift.debug.dylib                      0x0000000104d4b934 0x104d20000 + 178484 -40    opbeans-swift.debug.dylib                      0x0000000104d4b9e0 0x104d20000 + 178656 -41    ???                                                                  0x000000010227d3d8 0x0 + 0 -42    ???                                                                  0x000000010235ab98 0x0 + 0 +0 libswiftCore.dylib 0x0000000195712d2c 0x1956e8000 + 175404 +1 opbeans-swift.debug.dylib 0x0000000104d46e7c 0x104d20000 + 159356 +2 SwiftUICore 0x00000001d4350138 0x1d42a0000 + 721208 +3 SwiftUICore 0x00000001d4501710 0x1d42a0000 + 2496272 +4 SwiftUICore 0x00000001d435953c 0x1d42a0000 + 759100 +5 SwiftUICore 0x00000001d435953c 0x1d42a0000 + 759100 +6 SwiftUI 0x00000001d3443c38 0x1d30fe000 + 3431480 +7 SwiftUI 0x00000001d36e3880 0x1d30fe000 + 6183040 +8 SwiftUICore 0x00000001d4350138 0x1d42a0000 + 721208 +9 SwiftUICore 0x00000001d466e028 0x1d42a0000 + 3989544 +10 SwiftUICore 0x00000001d466d620 0x1d42a0000 + 3986976 +11 SwiftUI 0x00000001d3ad5ac8 0x1d30fe000 + 10320584 +12 SwiftUI 0x00000001d3ad5b40 0x1d30fe000 + 10320704 +13 UIKitCore 0x00000001856f3394 0x184d72000 + 9966484 +14 UIKitCore 0x00000001856fab0c 0x184d72000 + 9997068 +15 UIKitCore 0x00000001856f8318 0x184d72000 + 9986840 +16 UIKitCore 0x00000001856f807c 0x184d72000 + 9986172 +17 UIKitCore 0x00000001856ed930 0x184d72000 + 9943344 +18 UIKitCore 0x00000001856ecc2c 0x184d72000 + 9940012 +19 UIKitCore 0x00000001856ec978 0x184d72000 + 9939320 +20 UIKitCore 0x0000000185c0921c 0x184d72000 + 15299100 +21 UIKitCore 0x0000000185be8bfc 0x184d72000 + 15166460 +22 UIKitCore 0x0000000185c731bc 0x184d72000 + 15733180 +23 UIKitCore 0x0000000185c75e60 0x184d72000 + 15744608 +24 UIKitCore 0x0000000185c6e474 0x184d72000 + 15713396 +25 UIKitCore 0x0000000185133f04 0x184d72000 + 3940100 +26 UIKitCore 0x0000000185afd9b8 0x184d72000 + 14203320 +27 UIKitCore 0x0000000185afcdd4 0x184d72000 + 14200276 +28 CoreFoundation 0x00000001804284b8 0x180395000 + 603320 +29 CoreFoundation 0x0000000180428400 0x180395000 + 603136 +30 CoreFoundation 0x0000000180427b88 0x180395000 + 600968 +31 CoreFoundation 0x0000000180422584 0x180395000 + 578948 +32 CoreFoundation 0x0000000180421e3c 0x180395000 + 577084 +33 GraphicsServices 0x0000000190f62d00 0x190f60000 + 11520 +34 UIKitCore 0x0000000185bcec98 0x184d72000 + 15060120 +35 UIKitCore 0x0000000185bd3064 0x184d72000 + 15077476 +36 SwiftUI 0x00000001d3953aa8 0x1d30fe000 + 8739496 +37 SwiftUI 0x00000001d39537d0 0x1d30fe000 + 8738768 +38 SwiftUI 0x00000001d36e09e0 0x1d30fe000 + 6171104 +39 opbeans-swift.debug.dylib 0x0000000104d4b934 0x104d20000 + 178484 +40 opbeans-swift.debug.dylib 0x0000000104d4b9e0 0x104d20000 + 178656 +41 ??? 0x000000010227d3d8 0x0 + 0 +42 ??? 0x000000010235ab98 0x0 + 0 Thread 1: -0      libsystem_kernel.dylib                            0x00000001021c6680 0x1021c4000 + 9856 -1      libsystem_pthread.dylib                          0x000000010214598c 0x102144000 + 6540 +0 libsystem_kernel.dylib 0x00000001021c6680 0x1021c4000 + 9856 +1 libsystem_pthread.dylib 0x000000010214598c 0x102144000 + 6540 Thread 2: -0      libsystem_kernel.dylib                            0x00000001021c7e44 0x1021c4000 + 15940 -1      libsystem_c.dylib                                      0x000000018016ed28 0x1800fe000 + 462120 -2      opbeans-swift.debug.dylib                      0x0000000104d49c08 0x104d20000 + 171016 -3      opbeans-swift.debug.dylib                      0x0000000104d42814 0x104d20000 + 141332 -4      libdispatch.dylib                                      0x000000018017c788 0x18017b000 + 6024 -5      libdispatch.dylib                                      0x0000000180197278 0x18017b000 + 115320 -6      libdispatch.dylib                                      0x00000001801b2350 0x18017b000 + 226128 -7      libdispatch.dylib                                      0x000000018018fc10 0x18017b000 + 85008 -8      libdispatch.dylib                                      0x00000001801903b4 0x18017b000 + 86964 -9      libsystem_pthread.dylib                          0x0000000102146b90 0x102144000 + 11152 -10    libsystem_pthread.dylib                          0x000000010214598c 0x102144000 + 6540 +0 libsystem_kernel.dylib 0x00000001021c7e44 0x1021c4000 + 15940 +1 libsystem_c.dylib 0x000000018016ed28 0x1800fe000 + 462120 +2 opbeans-swift.debug.dylib 0x0000000104d49c08 0x104d20000 + 171016 +3 opbeans-swift.debug.dylib 0x0000000104d42814 0x104d20000 + 141332 +4 libdispatch.dylib 0x000000018017c788 0x18017b000 + 6024 +5 libdispatch.dylib 0x0000000180197278 0x18017b000 + 115320 +6 libdispatch.dylib 0x00000001801b2350 0x18017b000 + 226128 +7 libdispatch.dylib 0x000000018018fc10 0x18017b000 + 85008 +8 libdispatch.dylib 0x00000001801903b4 0x18017b000 + 86964 +9 libsystem_pthread.dylib 0x0000000102146b90 0x102144000 + 11152 +10 libsystem_pthread.dylib 0x000000010214598c 0x102144000 + 6540 Thread 3: -0      libsystem_kernel.dylib                            0x00000001021c4b70 0x1021c4000 + 2928 -1      libsystem_kernel.dylib                            0x00000001021ccc28 0x1021c4000 + 35880 -2      libsystem_kernel.dylib                            0x00000001021c4ed8 0x1021c4000 + 3800 -3      CoreFoundation                                            0x0000000180427d14 0x180395000 + 601364 -4      CoreFoundation                                            0x00000001804226f4 0x180395000 + 579316 -5      CoreFoundation                                            0x0000000180421e3c 0x180395000 + 577084 -6      Foundation                                                    0x0000000180f22ddc 0x18082c000 + 7302620 -7      Foundation                                                    0x0000000180f22ffc 0x18082c000 + 7303164 -8      UIKitCore                                                      0x0000000185c7c724 0x184d72000 + 15771428 -9      Foundation                                                    0x0000000180f49b98 0x18082c000 + 7461784 -10    libsystem_pthread.dylib                          0x000000010214a5f0 0x102144000 + 26096 -11    libsystem_pthread.dylib                          0x0000000102145998 0x102144000 + 6552 +0 libsystem_kernel.dylib 0x00000001021c4b70 0x1021c4000 + 2928 +1 libsystem_kernel.dylib 0x00000001021ccc28 0x1021c4000 + 35880 +2 libsystem_kernel.dylib 0x00000001021c4ed8 0x1021c4000 + 3800 +3 CoreFoundation 0x0000000180427d14 0x180395000 + 601364 +4 CoreFoundation 0x00000001804226f4 0x180395000 + 579316 +5 CoreFoundation 0x0000000180421e3c 0x180395000 + 577084 +6 Foundation 0x0000000180f22ddc 0x18082c000 + 7302620 +7 Foundation 0x0000000180f22ffc 0x18082c000 + 7303164 +8 UIKitCore 0x0000000185c7c724 0x184d72000 + 15771428 +9 Foundation 0x0000000180f49b98 0x18082c000 + 7461784 +10 libsystem_pthread.dylib 0x000000010214a5f0 0x102144000 + 26096 +11 libsystem_pthread.dylib 0x0000000102145998 0x102144000 + 6552 Thread 4: -0      libsystem_kernel.dylib                            0x00000001021c6680 0x1021c4000 + 9856 -1      libsystem_pthread.dylib                          0x000000010214598c 0x102144000 + 6540 +0 libsystem_kernel.dylib 0x00000001021c6680 0x1021c4000 + 9856 +1 libsystem_pthread.dylib 0x000000010214598c 0x102144000 + 6540 Thread 5: -0      libsystem_kernel.dylib                            0x00000001021ca670 0x1021c4000 + 26224 -1      opbeans-swift.debug.dylib                      0x00000001056408f0 0x104d20000 + 9570544 -2      opbeans-swift.debug.dylib                      0x0000000105640938 0x104d20000 + 9570616 -3      opbeans-swift.debug.dylib                      0x00000001056392c0 0x104d20000 + 9540288 -4      opbeans-swift.debug.dylib                      0x0000000105640810 0x104d20000 + 9570320 -5      opbeans-swift.debug.dylib                      0x0000000105622bd0 0x104d20000 + 9448400 -6      opbeans-swift.debug.dylib                      0x0000000105623ea0 0x104d20000 + 9453216 -7      opbeans-swift.debug.dylib                      0x0000000105618b48 0x104d20000 + 9407304 -8      opbeans-swift.debug.dylib                      0x0000000105621c64 0x104d20000 + 9444452 -9      opbeans-swift.debug.dylib                      0x000000010561ca80 0x104d20000 + 9423488 -10    opbeans-swift.debug.dylib                      0x0000000105611004 0x104d20000 + 9375748 -11    opbeans-swift.debug.dylib                      0x000000010561205c 0x104d20000 + 9379932 -12    opbeans-swift.debug.dylib                      0x0000000105615f50 0x104d20000 + 9396048 -13    opbeans-swift.debug.dylib                      0x000000010560a4c8 0x104d20000 + 9348296 -14    opbeans-swift.debug.dylib                      0x00000001056153c0 0x104d20000 + 9393088 -15    opbeans-swift.debug.dylib                      0x000000010560a590 0x104d20000 + 9348496 -16    opbeans-swift.debug.dylib                      0x000000010560a460 0x104d20000 + 9348192 -17    opbeans-swift.debug.dylib                      0x0000000105611410 0x104d20000 + 9376784 -18    opbeans-swift.debug.dylib                      0x00000001055c206c 0x104d20000 + 9052268 -19    opbeans-swift.debug.dylib                      0x00000001055c2660 0x104d20000 + 9053792 -20    opbeans-swift.debug.dylib                      0x00000001055c6e44 0x104d20000 + 9072196 -21    opbeans-swift.debug.dylib                      0x00000001056418b4 0x104d20000 + 9574580 -22    opbeans-swift.debug.dylib                      0x0000000105643fac 0x104d20000 + 9584556 -23    opbeans-swift.debug.dylib                      0x0000000105644064 0x104d20000 + 9584740 -24    libsystem_pthread.dylib                          0x000000010214a5f0 0x102144000 + 26096 -25    libsystem_pthread.dylib                          0x0000000102145998 0x102144000 + 6552 +0 libsystem_kernel.dylib 0x00000001021ca670 0x1021c4000 + 26224 +1 opbeans-swift.debug.dylib 0x00000001056408f0 0x104d20000 + 9570544 +2 opbeans-swift.debug.dylib 0x0000000105640938 0x104d20000 + 9570616 +3 opbeans-swift.debug.dylib 0x00000001056392c0 0x104d20000 + 9540288 +4 opbeans-swift.debug.dylib 0x0000000105640810 0x104d20000 + 9570320 +5 opbeans-swift.debug.dylib 0x0000000105622bd0 0x104d20000 + 9448400 +6 opbeans-swift.debug.dylib 0x0000000105623ea0 0x104d20000 + 9453216 +7 opbeans-swift.debug.dylib 0x0000000105618b48 0x104d20000 + 9407304 +8 opbeans-swift.debug.dylib 0x0000000105621c64 0x104d20000 + 9444452 +9 opbeans-swift.debug.dylib 0x000000010561ca80 0x104d20000 + 9423488 +10 opbeans-swift.debug.dylib 0x0000000105611004 0x104d20000 + 9375748 +11 opbeans-swift.debug.dylib 0x000000010561205c 0x104d20000 + 9379932 +12 opbeans-swift.debug.dylib 0x0000000105615f50 0x104d20000 + 9396048 +13 opbeans-swift.debug.dylib 0x000000010560a4c8 0x104d20000 + 9348296 +14 opbeans-swift.debug.dylib 0x00000001056153c0 0x104d20000 + 9393088 +15 opbeans-swift.debug.dylib 0x000000010560a590 0x104d20000 + 9348496 +16 opbeans-swift.debug.dylib 0x000000010560a460 0x104d20000 + 9348192 +17 opbeans-swift.debug.dylib 0x0000000105611410 0x104d20000 + 9376784 +18 opbeans-swift.debug.dylib 0x00000001055c206c 0x104d20000 + 9052268 +19 opbeans-swift.debug.dylib 0x00000001055c2660 0x104d20000 + 9053792 +20 opbeans-swift.debug.dylib 0x00000001055c6e44 0x104d20000 + 9072196 +21 opbeans-swift.debug.dylib 0x00000001056418b4 0x104d20000 + 9574580 +22 opbeans-swift.debug.dylib 0x0000000105643fac 0x104d20000 + 9584556 +23 opbeans-swift.debug.dylib 0x0000000105644064 0x104d20000 + 9584740 +24 libsystem_pthread.dylib 0x000000010214a5f0 0x102144000 + 26096 +25 libsystem_pthread.dylib 0x0000000102145998 0x102144000 + 6552 Thread 6: -0      libsystem_kernel.dylib                            0x00000001021c8014 0x1021c4000 + 16404 -1      Foundation                                                    0x0000000180ecb4ec 0x18082c000 + 6943980 -2      opbeans-swift.debug.dylib                      0x0000000104ee4f90 0x104d20000 + 1855376 -3      opbeans-swift.debug.dylib                      0x0000000104ee5934 0x104d20000 + 1857844 -4      opbeans-swift.debug.dylib                      0x0000000104e13e98 0x104d20000 + 999064 -5      opbeans-swift.debug.dylib                      0x0000000104ee4d5c 0x104d20000 + 1854812 -6      opbeans-swift.debug.dylib                      0x0000000104ee5230 0x104d20000 + 1856048 -7      Foundation                                                    0x0000000180f49b98 0x18082c000 + 7461784 -8      libsystem_pthread.dylib                          0x000000010214a5f0 0x102144000 + 26096 -9      libsystem_pthread.dylib                          0x0000000102145998 0x102144000 + 6552 +0 libsystem_kernel.dylib 0x00000001021c8014 0x1021c4000 + 16404 +1 Foundation 0x0000000180ecb4ec 0x18082c000 + 6943980 +2 opbeans-swift.debug.dylib 0x0000000104ee4f90 0x104d20000 + 1855376 +3 opbeans-swift.debug.dylib 0x0000000104ee5934 0x104d20000 + 1857844 +4 opbeans-swift.debug.dylib 0x0000000104e13e98 0x104d20000 + 999064 +5 opbeans-swift.debug.dylib 0x0000000104ee4d5c 0x104d20000 + 1854812 +6 opbeans-swift.debug.dylib 0x0000000104ee5230 0x104d20000 + 1856048 +7 Foundation 0x0000000180f49b98 0x18082c000 + 7461784 +8 libsystem_pthread.dylib 0x000000010214a5f0 0x102144000 + 26096 +9 libsystem_pthread.dylib 0x0000000102145998 0x102144000 + 6552 Thread 7: -0      libsystem_kernel.dylib                            0x00000001021c8014 0x1021c4000 + 16404 -1      Foundation                                                    0x0000000180ecb4ec 0x18082c000 + 6943980 -2      opbeans-swift.debug.dylib                      0x0000000104e13ba0 0x104d20000 + 998304 -3      opbeans-swift.debug.dylib                      0x0000000104e14308 0x104d20000 + 1000200 -4      opbeans-swift.debug.dylib                      0x0000000104e13e98 0x104d20000 + 999064 -5      opbeans-swift.debug.dylib                      0x0000000104e13968 0x104d20000 + 997736 -6      opbeans-swift.debug.dylib                      0x0000000104e13f24 0x104d20000 + 999204 -7      Foundation                                                    0x0000000180f49b98 0x18082c000 + 7461784 -8      libsystem_pthread.dylib                          0x000000010214a5f0 0x102144000 + 26096 -9      libsystem_pthread.dylib                          0x0000000102145998 0x102144000 + 6552 +0 libsystem_kernel.dylib 0x00000001021c8014 0x1021c4000 + 16404 +1 Foundation 0x0000000180ecb4ec 0x18082c000 + 6943980 +2 opbeans-swift.debug.dylib 0x0000000104e13ba0 0x104d20000 + 998304 +3 opbeans-swift.debug.dylib 0x0000000104e14308 0x104d20000 + 1000200 +4 opbeans-swift.debug.dylib 0x0000000104e13e98 0x104d20000 + 999064 +5 opbeans-swift.debug.dylib 0x0000000104e13968 0x104d20000 + 997736 +6 opbeans-swift.debug.dylib 0x0000000104e13f24 0x104d20000 + 999204 +7 Foundation 0x0000000180f49b98 0x18082c000 + 7461784 +8 libsystem_pthread.dylib 0x000000010214a5f0 0x102144000 + 26096 +9 libsystem_pthread.dylib 0x0000000102145998 0x102144000 + 6552 Thread 8: -0      libsystem_kernel.dylib                            0x00000001021c8014 0x1021c4000 + 16404 -1      Foundation                                                    0x0000000180ecb4ec 0x18082c000 + 6943980 -2      opbeans-swift.debug.dylib                      0x0000000104e13ba0 0x104d20000 + 998304 -3      opbeans-swift.debug.dylib                      0x0000000104e14308 0x104d20000 + 1000200 -4      opbeans-swift.debug.dylib                      0x0000000104e13e98 0x104d20000 + 999064 -5      opbeans-swift.debug.dylib                      0x0000000104e13968 0x104d20000 + 997736 -6      opbeans-swift.debug.dylib                      0x0000000104e13f24 0x104d20000 + 999204 -7      Foundation                                                    0x0000000180f49b98 0x18082c000 + 7461784 -8      libsystem_pthread.dylib                          0x000000010214a5f0 0x102144000 + 26096 -9      libsystem_pthread.dylib                          0x0000000102145998 0x102144000 + 6552 +0 libsystem_kernel.dylib 0x00000001021c8014 0x1021c4000 + 16404 +1 Foundation 0x0000000180ecb4ec 0x18082c000 + 6943980 +2 opbeans-swift.debug.dylib 0x0000000104e13ba0 0x104d20000 + 998304 +3 opbeans-swift.debug.dylib 0x0000000104e14308 0x104d20000 + 1000200 +4 opbeans-swift.debug.dylib 0x0000000104e13e98 0x104d20000 + 999064 +5 opbeans-swift.debug.dylib 0x0000000104e13968 0x104d20000 + 997736 +6 opbeans-swift.debug.dylib 0x0000000104e13f24 0x104d20000 + 999204 +7 Foundation 0x0000000180f49b98 0x18082c000 + 7461784 +8 libsystem_pthread.dylib 0x000000010214a5f0 0x102144000 + 26096 +9 libsystem_pthread.dylib 0x0000000102145998 0x102144000 + 6552 Thread 9: -0      libsystem_kernel.dylib                            0x00000001021c6680 0x1021c4000 + 9856 -1      libsystem_pthread.dylib                          0x000000010214598c 0x102144000 + 6540 +0 libsystem_kernel.dylib 0x00000001021c6680 0x1021c4000 + 9856 +1 libsystem_pthread.dylib 0x000000010214598c 0x102144000 + 6540 Thread 10: -0      libswiftCore.dylib                                    0x00000001959fc4ac 0x1956e8000 + 3228844 -1      libswiftCore.dylib                                    0x00000001959fb838 0x1956e8000 + 3225656 -2      libswiftCore.dylib                                    0x00000001959f9cc8 0x1956e8000 + 3218632 -3      AttributeGraph                                            0x00000001bfecd3e8 0x1bfeb1000 + 115688 -4      AttributeGraph                                            0x00000001bfececb4 0x1bfeb1000 + 122036 -5      libdispatch.dylib                                      0x0000000180197278 0x18017b000 + 115320 -6      libdispatch.dylib                                      0x00000001801b2350 0x18017b000 + 226128 -7      libdispatch.dylib                                      0x000000018018fc10 0x18017b000 + 85008 -8      libdispatch.dylib                                      0x00000001801903b4 0x18017b000 + 86964 -9      libsystem_pthread.dylib                          0x0000000102146b90 0x102144000 + 11152 -10    libsystem_pthread.dylib                          0x000000010214598c 0x102144000 + 6540 +0 libswiftCore.dylib 0x00000001959fc4ac 0x1956e8000 + 3228844 +1 libswiftCore.dylib 0x00000001959fb838 0x1956e8000 + 3225656 +2 libswiftCore.dylib 0x00000001959f9cc8 0x1956e8000 + 3218632 +3 AttributeGraph 0x00000001bfecd3e8 0x1bfeb1000 + 115688 +4 AttributeGraph 0x00000001bfececb4 0x1bfeb1000 + 122036 +5 libdispatch.dylib 0x0000000180197278 0x18017b000 + 115320 +6 libdispatch.dylib 0x00000001801b2350 0x18017b000 + 226128 +7 libdispatch.dylib 0x000000018018fc10 0x18017b000 + 85008 +8 libdispatch.dylib 0x00000001801903b4 0x18017b000 + 86964 +9 libsystem_pthread.dylib 0x0000000102146b90 0x102144000 + 11152 +10 libsystem_pthread.dylib 0x000000010214598c 0x102144000 + 6540 Thread 11: -0      libsystem_kernel.dylib                            0x00000001021c6680 0x1021c4000 + 9856 -1      libsystem_pthread.dylib                          0x000000010214598c 0x102144000 + 6540 +0 libsystem_kernel.dylib 0x00000001021c6680 0x1021c4000 + 9856 +1 libsystem_pthread.dylib 0x000000010214598c 0x102144000 + 6540 Thread 12: -0      libsystem_kernel.dylib                            0x00000001021c6680 0x1021c4000 + 9856 -1      libsystem_pthread.dylib                          0x000000010214598c 0x102144000 + 6540 +0 libsystem_kernel.dylib 0x00000001021c6680 0x1021c4000 + 9856 +1 libsystem_pthread.dylib 0x000000010214598c 0x102144000 + 6540 Thread 13: -0      opbeans-swift.debug.dylib                      0x0000000105b8e770 0x104d20000 + 15132528 -1      opbeans-swift.debug.dylib                      0x0000000105b841d4 0x104d20000 + 15090132 -2      libsystem_pthread.dylib                          0x000000010214a5f0 0x102144000 + 26096 -3      libsystem_pthread.dylib                          0x0000000102145998 0x102144000 + 6552 +0 opbeans-swift.debug.dylib 0x0000000105b8e770 0x104d20000 + 15132528 +1 opbeans-swift.debug.dylib 0x0000000105b841d4 0x104d20000 + 15090132 +2 libsystem_pthread.dylib 0x000000010214a5f0 0x102144000 + 26096 +3 libsystem_pthread.dylib 0x0000000102145998 0x102144000 + 6552 Thread 14: -0      libsystem_kernel.dylib                            0x00000001021cef98 0x1021c4000 + 44952 -1      libsystem_pthread.dylib                          0x000000010214a5f0 0x102144000 + 26096 -2      libsystem_pthread.dylib                          0x0000000102145998 0x102144000 + 6552 +0 libsystem_kernel.dylib 0x00000001021cef98 0x1021c4000 + 44952 +1 libsystem_pthread.dylib 0x000000010214a5f0 0x102144000 + 26096 +2 libsystem_pthread.dylib 0x0000000102145998 0x102144000 + 6552 Thread 0 crashed with ARM-64 Thread State: -        pc: 0x0000000195712d2c          fp: 0x000000016dccf120          sp: 0x000000016dccf0a0          x0: 0xe800000000000000 -        x1: 0x0000000000000000          x2: 0x0000000000000000          x3: 0x00006000002318e0          x4: 0x0000000000000008 -        x5: 0x000000016dccef80          x6: 0x2168736172432041          x7: 0x0000000000000000          x8: 0x0000000000000200 -        x9: 0x00000000aa093855        x10: 0x00000000000001ff        x11: 0x00000000000018c0        x12: 0x00000000000007fb -      x13: 0x00000000000007fd        x14: 0x00000000aa2940c7        x15: 0x00000000aa093855        x16: 0x00000000aa200000 -      x17: 0x00000000000000c7        x18: 0x0000000000000000        x19: 0x0000600000c02f70        x20: 0x0000000000000000 -      x21: 0x0000000000000001        x22: 0x0000600000c02f98        x23: 0x00000001d312b8bc        x24: 0x0000600000004070 -      x25: 0x0000600000c032d0        x26: 0x0000000000000000        x27: 0x0000000000000002        x28: 0x0000600000214a20 -        lr: 0x0000000195712d2c      cpsr: 0x0000000060001000 + pc: 0x0000000195712d2c fp: 0x000000016dccf120 sp: 0x000000016dccf0a0 x0: 0xe800000000000000 + x1: 0x0000000000000000 x2: 0x0000000000000000 x3: 0x00006000002318e0 x4: 0x0000000000000008 + x5: 0x000000016dccef80 x6: 0x2168736172432041 x7: 0x0000000000000000 x8: 0x0000000000000200 + x9: 0x00000000aa093855 x10: 0x00000000000001ff x11: 0x00000000000018c0 x12: 0x00000000000007fb + x13: 0x00000000000007fd x14: 0x00000000aa2940c7 x15: 0x00000000aa093855 x16: 0x00000000aa200000 + x17: 0x00000000000000c7 x18: 0x0000000000000000 x19: 0x0000600000c02f70 x20: 0x0000000000000000 + x21: 0x0000000000000001 x22: 0x0000600000c02f98 x23: 0x00000001d312b8bc x24: 0x0000600000004070 + x25: 0x0000600000c032d0 x26: 0x0000000000000000 x27: 0x0000000000000002 x28: 0x0000600000214a20 + lr: 0x0000000195712d2c cpsr: 0x0000000060001000 Binary Images: -              0x10212c000 -                0x10212ffff +opbeans-swift arm64    /Users/brycebuchanan/Library/Developer/CoreSimulator/Devices/5F5E45F7-760E-4589-9F48-B7264D35395A/data/Containers/Bundle/Application/6817BDFA-329C-4E47-B7C7-B4D053B81515/opbeans-swift.app/opbeans-swift -              0x102144000 -                0x102153fff    libsystem_pthread.dylib arm64    /usr/lib/system/libsystem_pthread.dylib -              0x1021a4000 -                0x1021abfff    libsystem_platform.dylib arm64    <93afc0a9eec93f50933909c7757aa50a> /usr/lib/system/libsystem_platform.dylib -              0x1021c4000 -                0x1021fffff    libsystem_kernel.dylib arm64    <4068b2eea54f397e882dc5e3a40b789a> /usr/lib/system/libsystem_kernel.dylib -              0x1025b8000 -                0x1025c3fff    libobjc-trampolines.dylib arm64    <22dfc62173863de387b29ed27c8be84d> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libobjc-trampolines.dylib -              0x104d20000 -                0x105d77fff    opbeans-swift.debug.dylib arm64    /Users/brycebuchanan/Library/Developer/CoreSimulator/Devices/5F5E45F7-760E-4589-9F48-B7264D35395A/data/Containers/Bundle/Application/6817BDFA-329C-4E47-B7C7-B4D053B81515/opbeans-swift.app/opbeans-swift.debug.dylib -              0x180068000 -                0x1800a491f    libobjc.A.dylib arm64    <3286911c7f923620b8f718ac6061e9d9> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libobjc.A.dylib -              0x1800a5000 -                0x1800be21f    libsystem_trace.dylib arm64    <6faa12e4083d35cc8347750f34ffd1ec> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_trace.dylib -              0x1800bf000 -                0x1800faa9f    libxpc.dylib arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libxpc.dylib -              0x1800fb000 -                0x1800fdda8    libsystem_blocks.dylib arm64    <301e8d00828631bea19935b6d8cf38bf> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_blocks.dylib -              0x1800fe000 -                0x18017a79b    libsystem_c.dylib arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_c.dylib -              0x18017b000 -                0x1801bfb5f    libdispatch.dylib arm64    <7bee27fdf519330daebed6ace467df22> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libdispatch.dylib -              0x1801c0000 -                0x1801ffef7    libsystem_malloc.dylib arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_malloc.dylib -              0x180200000 -                0x18029a64f    libcorecrypto.dylib arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libcorecrypto.dylib -              0x18029b000 -                0x1802b6fff    libc++abi.dylib arm64    <3a16c8a1792d38cf967a72505dfb87e4> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libc++abi.dylib -              0x1802b7000 -                0x1802e1fe2    libdyld.dylib arm64    <4056bff4af5930e787914708c49cffe0> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libdyld.dylib -              0x1802e2000 -                0x1802ea673    libsystem_darwin.dylib arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_darwin.dylib -              0x1802eb000 -                0x18036fffb    libc++.1.dylib arm64    <494bdb39105636e6910ccaf9ec5f81ec> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libc++.1.dylib -              0x180370000 -                0x18039471f    libsystem_info.dylib arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_info.dylib -              0x180395000 -                0x1807acfff    CoreFoundation arm64    <3d4aa1d503aa3365b767944509b9bbfd> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation -              0x1807ad000 -                0x18082b8f3    SystemConfiguration arm64    <99a4dd2c4d163a949d01598c00290588> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration -              0x18082c000 -                0x1813f18df    Foundation arm64    <6ec60314780a318f8bdb5d173b13970e> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Foundation.framework/Foundation -              0x1813f2000 -                0x18141fc77    libCRFSuite.dylib arm64    <1f512f0900fa39c4989738225a6aa14f> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libCRFSuite.dylib -              0x181420000 -                0x181638c9f    CoreServices arm64    <1b198a214877379c85f072a271ec1b01> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreServices.framework/CoreServices -              0x181639000 -                0x1816970f7    libSparse.dylib arm64    <0a4389578a323fe8b05ea13f01072a89> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libSparse.dylib -              0x181698000 -                0x181bf90df    ImageIO arm64    <4674256467fc3ecb915fd8002783c749> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/ImageIO.framework/ImageIO -              0x181bfe000 -                0x181de1b7f    CoreText arm64    <880e3304e1373f38abf0567290c4381f> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreText.framework/CoreText -              0x181de2000 -                0x181f95b9f    Security arm64    <19a0b76e287e33cbb59c0724e7d2b0a8> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Security.framework/Security -              0x181f96000 -                0x18203359f    IOKit arm64    <0771439acb1338c0a90c213036acacbd> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit -              0x182034000 -                0x1820738ff    libMobileGestalt.dylib arm64    <1bffa8a238ce35ab843550706f48ef22> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libMobileGestalt.dylib -              0x182074000 -                0x1820ce5e7    libprotobuf.dylib arm64    <991ed98608833f95990c0d8e51f4aec0> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libprotobuf.dylib -              0x1820cf000 -                0x1820e08cf    libprotobuf-lite.dylib arm64    <55e763046f0c34d4bf931375658f8d29> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libprotobuf-lite.dylib -              0x1820e1000 -                0x18237800b    libicucore.A.dylib arm64    <4d469ab560b7304cb3fcfa97344d6c8c> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libicucore.A.dylib -              0x182379000 -                0x1823a8113    CoreServicesInternal arm64    <0202b827fc4f3c28b26de9dbaca54155> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/CoreServicesInternal.framework/CoreServicesInternal -              0x1823a9000 -                0x1823e403f    WirelessDiagnostics arm64    <543efd2f9ff039c2ba3646787872865e> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/WirelessDiagnostics.framework/WirelessDiagnostics -              0x1823e5000 -                0x1824157b7    libAWDSupport.dylib arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libAWDSupport.dylib -              0x182416000 -                0x18282649f    CoreAudio arm64    <52498879022c3b1f90ab296710191a77> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreAudio.framework/CoreAudio -              0x182827000 -                0x182bb0e9f    CoreImage arm64    <585bedb6c5ce36dca76ddb4ee06386fd> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreImage.framework/CoreImage -              0x182e48000 -                0x182fc2edf    libsqlite3.dylib arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libsqlite3.dylib -              0x182fc3000 -                0x182fcf51e    libsystem_notify.dylib arm64    <239dd2c6bd8c3cfd9500a63b808d4b7f> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_notify.dylib -              0x183499000 -                0x1834da47f    AppSupport arm64    <75cb542596413012957045d95cbf4148> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/AppSupport.framework/AppSupport -              0x1834db000 -                0x1834db387    libnetwork.dylib arm64    <60305c56f5f7381fa84bd6a416bfb3c7> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libnetwork.dylib -              0x1834dc000 -                0x1835ec9df    ManagedConfiguration arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/ManagedConfiguration.framework/ManagedConfiguration -              0x1835ed000 -                0x183624ebf    CoreServicesStore arm64    <6bb5163cec18358596d353506709a991> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/CoreServicesStore.framework/CoreServicesStore -              0x183625000 -                0x183641e7f    UserManagement arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UserManagement.framework/UserManagement -              0x183b23000 -                0x183b3b6ff    ProtocolBuffer arm64    <887ce4ece3d23e8681706f52b6e3f504> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/ProtocolBuffer.framework/ProtocolBuffer -              0x183b3c000 -                0x183b4f9bf    CommonUtilities arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/CommonUtilities.framework/CommonUtilities -              0x183b50000 -                0x183ba9eff    RunningBoardServices arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/RunningBoardServices.framework/RunningBoardServices -              0x183baa000 -                0x183c7795f    BaseBoard arm64    <3299412bf1c13fc28f2f885df7dfee05> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/BaseBoard.framework/BaseBoard -              0x1845a8000 -                0x1847fbdff    CoreLocation arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreLocation.framework/CoreLocation -              0x184805000 -                0x1848774df    Accounts arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Accounts.framework/Accounts -              0x184899000 -                0x184c1a83f    CFNetwork arm64    <4642e7e4b83d3225a892a22fdca4c077> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CFNetwork.framework/CFNetwork -              0x184c1b000 -                0x184d7105f    UIFoundation arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIFoundation.framework/UIFoundation -              0x184d72000 -                0x186adb8df    UIKitCore arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore -              0x186adc000 -                0x186ae89bf    AssertionServices arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/AssertionServices.framework/AssertionServices -              0x186ae9000 -                0x186ce9e3f    CoreTelephony arm64    <3324ab32d1f43ad1950c444cd71ec436> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreTelephony.framework/CoreTelephony -              0x186cea000 -                0x186ceaf9f    AggregateDictionary arm64    <86115f236ca130a98b3949a8e0f4938d> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/AggregateDictionary.framework/AggregateDictionary -              0x186ceb000 -                0x186d01c0b    libsystem_asl.dylib arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_asl.dylib -              0x186d02000 -                0x186dc783f    CloudDocs arm64    <9c28961eeb07396ab773714e63201a91> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/CloudDocs.framework/CloudDocs -              0x186dc8000 -                0x1871a7edf    CoreData arm64    <7bf1e626f000323eb3a6f9faae15b48a> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreData.framework/CoreData -              0x1876ba000 -                0x18771d6df    BoardServices arm64    <5c560e9f2a9f3c55a2064168a4009432> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/BoardServices.framework/BoardServices -              0x18771e000 -                0x1877e44ff    libboringssl.dylib arm64    <0463a94630f33854b4ae368a9287e4a0> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libboringssl.dylib -              0x1877e5000 -                0x18781269f    CoreAnalytics arm64    <69494a450b2d3d82bdc99860d46f2699> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/CoreAnalytics.framework/CoreAnalytics -              0x187813000 -                0x187b4bf9f    CloudKit arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/Ru<…> + 0x10212c000 - 0x10212ffff +opbeans-swift arm64 /Users/brycebuchanan/Library/Developer/CoreSimulator/Devices/5F5E45F7-760E-4589-9F48-B7264D35395A/data/Containers/Bundle/Application/6817BDFA-329C-4E47-B7C7-B4D053B81515/opbeans-swift.app/opbeans-swift + 0x102144000 - 0x102153fff libsystem_pthread.dylib arm64 /usr/lib/system/libsystem_pthread.dylib + 0x1021a4000 - 0x1021abfff libsystem_platform.dylib arm64 <93afc0a9eec93f50933909c7757aa50a> /usr/lib/system/libsystem_platform.dylib + 0x1021c4000 - 0x1021fffff libsystem_kernel.dylib arm64 <4068b2eea54f397e882dc5e3a40b789a> /usr/lib/system/libsystem_kernel.dylib + 0x1025b8000 - 0x1025c3fff libobjc-trampolines.dylib arm64 <22dfc62173863de387b29ed27c8be84d> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libobjc-trampolines.dylib + 0x104d20000 - 0x105d77fff opbeans-swift.debug.dylib arm64 /Users/brycebuchanan/Library/Developer/CoreSimulator/Devices/5F5E45F7-760E-4589-9F48-B7264D35395A/data/Containers/Bundle/Application/6817BDFA-329C-4E47-B7C7-B4D053B81515/opbeans-swift.app/opbeans-swift.debug.dylib + 0x180068000 - 0x1800a491f libobjc.A.dylib arm64 <3286911c7f923620b8f718ac6061e9d9> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libobjc.A.dylib + 0x1800a5000 - 0x1800be21f libsystem_trace.dylib arm64 <6faa12e4083d35cc8347750f34ffd1ec> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_trace.dylib + 0x1800bf000 - 0x1800faa9f libxpc.dylib arm64 /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libxpc.dylib + 0x1800fb000 - 0x1800fdda8 libsystem_blocks.dylib arm64 <301e8d00828631bea19935b6d8cf38bf> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_blocks.dylib + 0x1800fe000 - 0x18017a79b libsystem_c.dylib arm64 /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_c.dylib + 0x18017b000 - 0x1801bfb5f libdispatch.dylib arm64 <7bee27fdf519330daebed6ace467df22> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libdispatch.dylib + 0x1801c0000 - 0x1801ffef7 libsystem_malloc.dylib arm64 /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_malloc.dylib + 0x180200000 - 0x18029a64f libcorecrypto.dylib arm64 /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libcorecrypto.dylib + 0x18029b000 - 0x1802b6fff libc++abi.dylib arm64 <3a16c8a1792d38cf967a72505dfb87e4> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libc++abi.dylib + 0x1802b7000 - 0x1802e1fe2 libdyld.dylib arm64 <4056bff4af5930e787914708c49cffe0> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libdyld.dylib + 0x1802e2000 - 0x1802ea673 libsystem_darwin.dylib arm64 /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_darwin.dylib + 0x1802eb000 - 0x18036fffb libc++.1.dylib arm64 <494bdb39105636e6910ccaf9ec5f81ec> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libc++.1.dylib + 0x180370000 - 0x18039471f libsystem_info.dylib arm64 /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_info.dylib + 0x180395000 - 0x1807acfff CoreFoundation arm64 <3d4aa1d503aa3365b767944509b9bbfd> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation + 0x1807ad000 - 0x18082b8f3 SystemConfiguration arm64 <99a4dd2c4d163a949d01598c00290588> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration + 0x18082c000 - 0x1813f18df Foundation arm64 <6ec60314780a318f8bdb5d173b13970e> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Foundation.framework/Foundation + 0x1813f2000 - 0x18141fc77 libCRFSuite.dylib arm64 <1f512f0900fa39c4989738225a6aa14f> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libCRFSuite.dylib + 0x181420000 - 0x181638c9f CoreServices arm64 <1b198a214877379c85f072a271ec1b01> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreServices.framework/CoreServices + 0x181639000 - 0x1816970f7 libSparse.dylib arm64 <0a4389578a323fe8b05ea13f01072a89> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libSparse.dylib + 0x181698000 - 0x181bf90df ImageIO arm64 <4674256467fc3ecb915fd8002783c749> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/ImageIO.framework/ImageIO + 0x181bfe000 - 0x181de1b7f CoreText arm64 <880e3304e1373f38abf0567290c4381f> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreText.framework/CoreText + 0x181de2000 - 0x181f95b9f Security arm64 <19a0b76e287e33cbb59c0724e7d2b0a8> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Security.framework/Security + 0x181f96000 - 0x18203359f IOKit arm64 <0771439acb1338c0a90c213036acacbd> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit + 0x182034000 - 0x1820738ff libMobileGestalt.dylib arm64 <1bffa8a238ce35ab843550706f48ef22> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libMobileGestalt.dylib + 0x182074000 - 0x1820ce5e7 libprotobuf.dylib arm64 <991ed98608833f95990c0d8e51f4aec0> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libprotobuf.dylib + 0x1820cf000 - 0x1820e08cf libprotobuf-lite.dylib arm64 <55e763046f0c34d4bf931375658f8d29> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libprotobuf-lite.dylib + 0x1820e1000 - 0x18237800b libicucore.A.dylib arm64 <4d469ab560b7304cb3fcfa97344d6c8c> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libicucore.A.dylib + 0x182379000 - 0x1823a8113 CoreServicesInternal arm64 <0202b827fc4f3c28b26de9dbaca54155> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/CoreServicesInternal.framework/CoreServicesInternal + 0x1823a9000 - 0x1823e403f WirelessDiagnostics arm64 <543efd2f9ff039c2ba3646787872865e> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/WirelessDiagnostics.framework/WirelessDiagnostics + 0x1823e5000 - 0x1824157b7 libAWDSupport.dylib arm64 /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libAWDSupport.dylib + 0x182416000 - 0x18282649f CoreAudio arm64 <52498879022c3b1f90ab296710191a77> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreAudio.framework/CoreAudio + 0x182827000 - 0x182bb0e9f CoreImage arm64 <585bedb6c5ce36dca76ddb4ee06386fd> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreImage.framework/CoreImage + 0x182e48000 - 0x182fc2edf libsqlite3.dylib arm64 /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libsqlite3.dylib + 0x182fc3000 - 0x182fcf51e libsystem_notify.dylib arm64 <239dd2c6bd8c3cfd9500a63b808d4b7f> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_notify.dylib + 0x183499000 - 0x1834da47f AppSupport arm64 <75cb542596413012957045d95cbf4148> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/AppSupport.framework/AppSupport + 0x1834db000 - 0x1834db387 libnetwork.dylib arm64 <60305c56f5f7381fa84bd6a416bfb3c7> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libnetwork.dylib + 0x1834dc000 - 0x1835ec9df ManagedConfiguration arm64 /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/ManagedConfiguration.framework/ManagedConfiguration + 0x1835ed000 - 0x183624ebf CoreServicesStore arm64 <6bb5163cec18358596d353506709a991> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/CoreServicesStore.framework/CoreServicesStore + 0x183625000 - 0x183641e7f UserManagement arm64 /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UserManagement.framework/UserManagement + 0x183b23000 - 0x183b3b6ff ProtocolBuffer arm64 <887ce4ece3d23e8681706f52b6e3f504> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/ProtocolBuffer.framework/ProtocolBuffer + 0x183b3c000 - 0x183b4f9bf CommonUtilities arm64 /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/CommonUtilities.framework/CommonUtilities + 0x183b50000 - 0x183ba9eff RunningBoardServices arm64 /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/RunningBoardServices.framework/RunningBoardServices + 0x183baa000 - 0x183c7795f BaseBoard arm64 <3299412bf1c13fc28f2f885df7dfee05> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/BaseBoard.framework/BaseBoard + 0x1845a8000 - 0x1847fbdff CoreLocation arm64 /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreLocation.framework/CoreLocation + 0x184805000 - 0x1848774df Accounts arm64 /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Accounts.framework/Accounts + 0x184899000 - 0x184c1a83f CFNetwork arm64 <4642e7e4b83d3225a892a22fdca4c077> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CFNetwork.framework/CFNetwork + 0x184c1b000 - 0x184d7105f UIFoundation arm64 /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIFoundation.framework/UIFoundation + 0x184d72000 - 0x186adb8df UIKitCore arm64 /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore + 0x186adc000 - 0x186ae89bf AssertionServices arm64 /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/AssertionServices.framework/AssertionServices + 0x186ae9000 - 0x186ce9e3f CoreTelephony arm64 <3324ab32d1f43ad1950c444cd71ec436> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreTelephony.framework/CoreTelephony + 0x186cea000 - 0x186ceaf9f AggregateDictionary arm64 <86115f236ca130a98b3949a8e0f4938d> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/AggregateDictionary.framework/AggregateDictionary + 0x186ceb000 - 0x186d01c0b libsystem_asl.dylib arm64 /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_asl.dylib + 0x186d02000 - 0x186dc783f CloudDocs arm64 <9c28961eeb07396ab773714e63201a91> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/CloudDocs.framework/CloudDocs + 0x186dc8000 - 0x1871a7edf CoreData arm64 <7bf1e626f000323eb3a6f9faae15b48a> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreData.framework/CoreData + 0x1876ba000 - 0x18771d6df BoardServices arm64 <5c560e9f2a9f3c55a2064168a4009432> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/BoardServices.framework/BoardServices + 0x18771e000 - 0x1877e44ff libboringssl.dylib arm64 <0463a94630f33854b4ae368a9287e4a0> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libboringssl.dylib + 0x1877e5000 - 0x18781269f CoreAnalytics arm64 <69494a450b2d3d82bdc99860d46f2699> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/CoreAnalytics.framework/CoreAnalytics + 0x187813000 - 0x187b4bf9f CloudKit arm64 /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/Ru<> diff --git a/enrichments/logs/internal/mobile/testdata/swift/thread-8-crash.txt b/enrichments/logs/internal/mobile/testdata/swift/thread-8-crash.txt index 1bb388a..ed4da5b 100644 --- a/enrichments/logs/internal/mobile/testdata/swift/thread-8-crash.txt +++ b/enrichments/logs/internal/mobile/testdata/swift/thread-8-crash.txt @@ -1,259 +1,259 @@ -Incident Identifier: F8222EAC-3E63-48A3-8C40-CF22FEA7D952 -Hardware Model:            arm64 -Process:                  opbeans-swift [11220] -Path:                        /Users/brycebuchanan/Library/Developer/CoreSimulator/Devices/5F5E45F7-760E-4589-9F48-B7264D35395A/data/Containers/Bundle/Application/06BCE84E-9AB0-42C0-8D74-72B8945645BC/opbeans-swift.app/opbeans-swift -Identifier:            co.elastic.opbeans-swift -Version:                  4.0.0 (01042024) -Code Type:              ARM-64 -Parent Process:    launchd_sim [63657] +Incident Identifier: F8222EAC-3E63-48A3-8C40-CF22FEA7D952 +Hardware Model: arm64 +Process: opbeans-swift [11220] +Path: /Users/brycebuchanan/Library/Developer/CoreSimulator/Devices/5F5E45F7-760E-4589-9F48-B7264D35395A/data/Containers/Bundle/Application/06BCE84E-9AB0-42C0-8D74-72B8945645BC/opbeans-swift.app/opbeans-swift +Identifier: co.elastic.opbeans-swift +Version: 4.0.0 (01042024) +Code Type: ARM-64 +Parent Process: launchd_sim [63657] -Date/Time:              2025-06-05 15:46:48 +0000 -OS Version:            Mac OS X 18.4 (24F74) -Report Version:    104 +Date/Time: 2025-06-05 15:46:48 +0000 +OS Version: Mac OS X 18.4 (24F74) +Report Version: 104 -Exception Type:    SIGTRAP +Exception Type: SIGTRAP Exception Codes: TRAP_BRKPT at 0x195712d2c -Crashed Thread:    8 +Crashed Thread: 8 Thread 0: -0      libsystem_kernel.dylib                            0x00000001047b0b70 0x1047b0000 + 2928 -1      libsystem_kernel.dylib                            0x00000001047b8c28 0x1047b0000 + 35880 -2      libsystem_kernel.dylib                            0x00000001047b0ed8 0x1047b0000 + 3800 -3      CoreFoundation                                            0x0000000180427d14 0x180395000 + 601364 -4      CoreFoundation                                            0x00000001804226f4 0x180395000 + 579316 -5      CoreFoundation                                            0x0000000180421e3c 0x180395000 + 577084 -6      GraphicsServices                                        0x0000000190f62d00 0x190f60000 + 11520 -7      UIKitCore                                                      0x0000000185bcec98 0x184d72000 + 15060120 -8      UIKitCore                                                      0x0000000185bd3064 0x184d72000 + 15077476 -9      SwiftUI                                                          0x00000001d3953aa8 0x1d30fe000 + 8739496 -10    SwiftUI                                                          0x00000001d39537d0 0x1d30fe000 + 8738768 -11    SwiftUI                                                          0x00000001d36e09e0 0x1d30fe000 + 6171104 -12    opbeans-swift.debug.dylib                      0x000000010707bb5c 0x107050000 + 179036 -13    opbeans-swift.debug.dylib                      0x000000010707bc08 0x107050000 + 179208 -14    ???                                                                  0x00000001046f93d8 0x0 + 0 -15    ???                                                                  0x00000001045ceb98 0x0 + 0 +0 libsystem_kernel.dylib 0x00000001047b0b70 0x1047b0000 + 2928 +1 libsystem_kernel.dylib 0x00000001047b8c28 0x1047b0000 + 35880 +2 libsystem_kernel.dylib 0x00000001047b0ed8 0x1047b0000 + 3800 +3 CoreFoundation 0x0000000180427d14 0x180395000 + 601364 +4 CoreFoundation 0x00000001804226f4 0x180395000 + 579316 +5 CoreFoundation 0x0000000180421e3c 0x180395000 + 577084 +6 GraphicsServices 0x0000000190f62d00 0x190f60000 + 11520 +7 UIKitCore 0x0000000185bcec98 0x184d72000 + 15060120 +8 UIKitCore 0x0000000185bd3064 0x184d72000 + 15077476 +9 SwiftUI 0x00000001d3953aa8 0x1d30fe000 + 8739496 +10 SwiftUI 0x00000001d39537d0 0x1d30fe000 + 8738768 +11 SwiftUI 0x00000001d36e09e0 0x1d30fe000 + 6171104 +12 opbeans-swift.debug.dylib 0x000000010707bb5c 0x107050000 + 179036 +13 opbeans-swift.debug.dylib 0x000000010707bc08 0x107050000 + 179208 +14 ??? 0x00000001046f93d8 0x0 + 0 +15 ??? 0x00000001045ceb98 0x0 + 0 Thread 1: -0      libsystem_kernel.dylib                            0x00000001047b2680 0x1047b0000 + 9856 -1      libsystem_pthread.dylib                          0x00000001043dd98c 0x1043dc000 + 6540 +0 libsystem_kernel.dylib 0x00000001047b2680 0x1047b0000 + 9856 +1 libsystem_pthread.dylib 0x00000001043dd98c 0x1043dc000 + 6540 Thread 2: -0      libsystem_kernel.dylib                            0x00000001047b2680 0x1047b0000 + 9856 -1      libsystem_pthread.dylib                          0x00000001043dd98c 0x1043dc000 + 6540 +0 libsystem_kernel.dylib 0x00000001047b2680 0x1047b0000 + 9856 +1 libsystem_pthread.dylib 0x00000001043dd98c 0x1043dc000 + 6540 Thread 3: -0      libsystem_kernel.dylib                            0x00000001047b2680 0x1047b0000 + 9856 -1      libsystem_pthread.dylib                          0x00000001043dd98c 0x1043dc000 + 6540 +0 libsystem_kernel.dylib 0x00000001047b2680 0x1047b0000 + 9856 +1 libsystem_pthread.dylib 0x00000001043dd98c 0x1043dc000 + 6540 Thread 4: -0      libsystem_kernel.dylib                            0x00000001047b0b70 0x1047b0000 + 2928 -1      libsystem_kernel.dylib                            0x00000001047b8c28 0x1047b0000 + 35880 -2      libsystem_kernel.dylib                            0x00000001047b0ed8 0x1047b0000 + 3800 -3      CoreFoundation                                            0x0000000180427d14 0x180395000 + 601364 -4      CoreFoundation                                            0x00000001804226f4 0x180395000 + 579316 -5      CoreFoundation                                            0x0000000180421e3c 0x180395000 + 577084 -6      Foundation                                                    0x0000000180f22ddc 0x18082c000 + 7302620 -7      Foundation                                                    0x0000000180f22ffc 0x18082c000 + 7303164 -8      UIKitCore                                                      0x0000000185c7c724 0x184d72000 + 15771428 -9      Foundation                                                    0x0000000180f49b98 0x18082c000 + 7461784 -10    libsystem_pthread.dylib                          0x00000001043e25f0 0x1043dc000 + 26096 -11    libsystem_pthread.dylib                          0x00000001043dd998 0x1043dc000 + 6552 +0 libsystem_kernel.dylib 0x00000001047b0b70 0x1047b0000 + 2928 +1 libsystem_kernel.dylib 0x00000001047b8c28 0x1047b0000 + 35880 +2 libsystem_kernel.dylib 0x00000001047b0ed8 0x1047b0000 + 3800 +3 CoreFoundation 0x0000000180427d14 0x180395000 + 601364 +4 CoreFoundation 0x00000001804226f4 0x180395000 + 579316 +5 CoreFoundation 0x0000000180421e3c 0x180395000 + 577084 +6 Foundation 0x0000000180f22ddc 0x18082c000 + 7302620 +7 Foundation 0x0000000180f22ffc 0x18082c000 + 7303164 +8 UIKitCore 0x0000000185c7c724 0x184d72000 + 15771428 +9 Foundation 0x0000000180f49b98 0x18082c000 + 7461784 +10 libsystem_pthread.dylib 0x00000001043e25f0 0x1043dc000 + 26096 +11 libsystem_pthread.dylib 0x00000001043dd998 0x1043dc000 + 6552 Thread 5: -0      libsystem_kernel.dylib                            0x00000001047b2680 0x1047b0000 + 9856 -1      libsystem_pthread.dylib                          0x00000001043dd98c 0x1043dc000 + 6540 +0 libsystem_kernel.dylib 0x00000001047b2680 0x1047b0000 + 9856 +1 libsystem_pthread.dylib 0x00000001043dd98c 0x1043dc000 + 6540 Thread 6: -0      libsystem_kernel.dylib                            0x00000001047b3e44 0x1047b0000 + 15940 -1      libsystem_c.dylib                                      0x000000018016ed28 0x1800fe000 + 462120 -2      opbeans-swift.debug.dylib                      0x0000000107079e30 0x107050000 + 171568 -3      opbeans-swift.debug.dylib                      0x0000000107072814 0x107050000 + 141332 -4      libdispatch.dylib                                      0x000000018017c788 0x18017b000 + 6024 -5      libdispatch.dylib                                      0x0000000180197278 0x18017b000 + 115320 -6      libdispatch.dylib                                      0x00000001801b2350 0x18017b000 + 226128 -7      libdispatch.dylib                                      0x000000018018fc10 0x18017b000 + 85008 -8      libdispatch.dylib                                      0x00000001801903b4 0x18017b000 + 86964 -9      libsystem_pthread.dylib                          0x00000001043deb90 0x1043dc000 + 11152 -10    libsystem_pthread.dylib                          0x00000001043dd98c 0x1043dc000 + 6540 +0 libsystem_kernel.dylib 0x00000001047b3e44 0x1047b0000 + 15940 +1 libsystem_c.dylib 0x000000018016ed28 0x1800fe000 + 462120 +2 opbeans-swift.debug.dylib 0x0000000107079e30 0x107050000 + 171568 +3 opbeans-swift.debug.dylib 0x0000000107072814 0x107050000 + 141332 +4 libdispatch.dylib 0x000000018017c788 0x18017b000 + 6024 +5 libdispatch.dylib 0x0000000180197278 0x18017b000 + 115320 +6 libdispatch.dylib 0x00000001801b2350 0x18017b000 + 226128 +7 libdispatch.dylib 0x000000018018fc10 0x18017b000 + 85008 +8 libdispatch.dylib 0x00000001801903b4 0x18017b000 + 86964 +9 libsystem_pthread.dylib 0x00000001043deb90 0x1043dc000 + 11152 +10 libsystem_pthread.dylib 0x00000001043dd98c 0x1043dc000 + 6540 Thread 7: -0      libsystem_kernel.dylib                            0x00000001047b2680 0x1047b0000 + 9856 -1      libsystem_pthread.dylib                          0x00000001043dd98c 0x1043dc000 + 6540 +0 libsystem_kernel.dylib 0x00000001047b2680 0x1047b0000 + 9856 +1 libsystem_pthread.dylib 0x00000001043dd98c 0x1043dc000 + 6540 Thread 8 Crashed: -0      libswiftCore.dylib                                    0x0000000195712d2c 0x1956e8000 + 175404 -1      opbeans-swift.debug.dylib                      0x0000000107077048 0x107050000 + 159816 -2      opbeans-swift.debug.dylib                      0x0000000107072814 0x107050000 + 141332 -3      libdispatch.dylib                                      0x000000018017c788 0x18017b000 + 6024 -4      libdispatch.dylib                                      0x0000000180197278 0x18017b000 + 115320 -5      libdispatch.dylib                                      0x00000001801b2350 0x18017b000 + 226128 -6      libdispatch.dylib                                      0x000000018018fc10 0x18017b000 + 85008 -7      libdispatch.dylib                                      0x00000001801903b4 0x18017b000 + 86964 -8      libsystem_pthread.dylib                          0x00000001043deb90 0x1043dc000 + 11152 -9      libsystem_pthread.dylib                          0x00000001043dd98c 0x1043dc000 + 6540 +0 libswiftCore.dylib 0x0000000195712d2c 0x1956e8000 + 175404 +1 opbeans-swift.debug.dylib 0x0000000107077048 0x107050000 + 159816 +2 opbeans-swift.debug.dylib 0x0000000107072814 0x107050000 + 141332 +3 libdispatch.dylib 0x000000018017c788 0x18017b000 + 6024 +4 libdispatch.dylib 0x0000000180197278 0x18017b000 + 115320 +5 libdispatch.dylib 0x00000001801b2350 0x18017b000 + 226128 +6 libdispatch.dylib 0x000000018018fc10 0x18017b000 + 85008 +7 libdispatch.dylib 0x00000001801903b4 0x18017b000 + 86964 +8 libsystem_pthread.dylib 0x00000001043deb90 0x1043dc000 + 11152 +9 libsystem_pthread.dylib 0x00000001043dd98c 0x1043dc000 + 6540 Thread 9: -0      libsystem_kernel.dylib                            0x00000001047b2680 0x1047b0000 + 9856 -1      libsystem_pthread.dylib                          0x00000001043dd98c 0x1043dc000 + 6540 +0 libsystem_kernel.dylib 0x00000001047b2680 0x1047b0000 + 9856 +1 libsystem_pthread.dylib 0x00000001043dd98c 0x1043dc000 + 6540 Thread 10: -0      libsystem_kernel.dylib                            0x00000001047b6670 0x1047b0000 + 26224 -1      opbeans-swift.debug.dylib                      0x0000000107970b18 0x107050000 + 9571096 -2      opbeans-swift.debug.dylib                      0x0000000107970b60 0x107050000 + 9571168 -3      opbeans-swift.debug.dylib                      0x00000001079694e8 0x107050000 + 9540840 -4      opbeans-swift.debug.dylib                      0x0000000107970a38 0x107050000 + 9570872 -5      opbeans-swift.debug.dylib                      0x0000000107952df8 0x107050000 + 9448952 -6      opbeans-swift.debug.dylib                      0x00000001079540c8 0x107050000 + 9453768 -7      opbeans-swift.debug.dylib                      0x0000000107948d70 0x107050000 + 9407856 -8      opbeans-swift.debug.dylib                      0x0000000107951e8c 0x107050000 + 9445004 -9      opbeans-swift.debug.dylib                      0x000000010794cca8 0x107050000 + 9424040 -10    opbeans-swift.debug.dylib                      0x000000010794122c 0x107050000 + 9376300 -11    opbeans-swift.debug.dylib                      0x0000000107942284 0x107050000 + 9380484 -12    opbeans-swift.debug.dylib                      0x0000000107946178 0x107050000 + 9396600 -13    opbeans-swift.debug.dylib                      0x000000010793a6f0 0x107050000 + 9348848 -14    opbeans-swift.debug.dylib                      0x00000001079455e8 0x107050000 + 9393640 -15    opbeans-swift.debug.dylib                      0x000000010793a7b8 0x107050000 + 9349048 -16    opbeans-swift.debug.dylib                      0x000000010793a688 0x107050000 + 9348744 -17    opbeans-swift.debug.dylib                      0x0000000107941638 0x107050000 + 9377336 -18    opbeans-swift.debug.dylib                      0x00000001078f2294 0x107050000 + 9052820 -19    opbeans-swift.debug.dylib                      0x00000001078f2888 0x107050000 + 9054344 -20    opbeans-swift.debug.dylib                      0x00000001078f706c 0x107050000 + 9072748 -21    opbeans-swift.debug.dylib                      0x0000000107971adc 0x107050000 + 9575132 -22    opbeans-swift.debug.dylib                      0x00000001079741d4 0x107050000 + 9585108 -23    opbeans-swift.debug.dylib                      0x000000010797428c 0x107050000 + 9585292 -24    libsystem_pthread.dylib                          0x00000001043e25f0 0x1043dc000 + 26096 -25    libsystem_pthread.dylib                          0x00000001043dd998 0x1043dc000 + 6552 +0 libsystem_kernel.dylib 0x00000001047b6670 0x1047b0000 + 26224 +1 opbeans-swift.debug.dylib 0x0000000107970b18 0x107050000 + 9571096 +2 opbeans-swift.debug.dylib 0x0000000107970b60 0x107050000 + 9571168 +3 opbeans-swift.debug.dylib 0x00000001079694e8 0x107050000 + 9540840 +4 opbeans-swift.debug.dylib 0x0000000107970a38 0x107050000 + 9570872 +5 opbeans-swift.debug.dylib 0x0000000107952df8 0x107050000 + 9448952 +6 opbeans-swift.debug.dylib 0x00000001079540c8 0x107050000 + 9453768 +7 opbeans-swift.debug.dylib 0x0000000107948d70 0x107050000 + 9407856 +8 opbeans-swift.debug.dylib 0x0000000107951e8c 0x107050000 + 9445004 +9 opbeans-swift.debug.dylib 0x000000010794cca8 0x107050000 + 9424040 +10 opbeans-swift.debug.dylib 0x000000010794122c 0x107050000 + 9376300 +11 opbeans-swift.debug.dylib 0x0000000107942284 0x107050000 + 9380484 +12 opbeans-swift.debug.dylib 0x0000000107946178 0x107050000 + 9396600 +13 opbeans-swift.debug.dylib 0x000000010793a6f0 0x107050000 + 9348848 +14 opbeans-swift.debug.dylib 0x00000001079455e8 0x107050000 + 9393640 +15 opbeans-swift.debug.dylib 0x000000010793a7b8 0x107050000 + 9349048 +16 opbeans-swift.debug.dylib 0x000000010793a688 0x107050000 + 9348744 +17 opbeans-swift.debug.dylib 0x0000000107941638 0x107050000 + 9377336 +18 opbeans-swift.debug.dylib 0x00000001078f2294 0x107050000 + 9052820 +19 opbeans-swift.debug.dylib 0x00000001078f2888 0x107050000 + 9054344 +20 opbeans-swift.debug.dylib 0x00000001078f706c 0x107050000 + 9072748 +21 opbeans-swift.debug.dylib 0x0000000107971adc 0x107050000 + 9575132 +22 opbeans-swift.debug.dylib 0x00000001079741d4 0x107050000 + 9585108 +23 opbeans-swift.debug.dylib 0x000000010797428c 0x107050000 + 9585292 +24 libsystem_pthread.dylib 0x00000001043e25f0 0x1043dc000 + 26096 +25 libsystem_pthread.dylib 0x00000001043dd998 0x1043dc000 + 6552 Thread 11: -0      libsystem_kernel.dylib                            0x00000001047b4014 0x1047b0000 + 16404 -1      Foundation                                                    0x0000000180ecb4ec 0x18082c000 + 6943980 -2      opbeans-swift.debug.dylib                      0x00000001072151b8 0x107050000 + 1855928 -3      opbeans-swift.debug.dylib                      0x0000000107215b5c 0x107050000 + 1858396 -4      opbeans-swift.debug.dylib                      0x00000001071440c0 0x107050000 + 999616 -5      opbeans-swift.debug.dylib                      0x0000000107214f84 0x107050000 + 1855364 -6      opbeans-swift.debug.dylib                      0x0000000107215458 0x107050000 + 1856600 -7      Foundation                                                    0x0000000180f49b98 0x18082c000 + 7461784 -8      libsystem_pthread.dylib                          0x00000001043e25f0 0x1043dc000 + 26096 -9      libsystem_pthread.dylib                          0x00000001043dd998 0x1043dc000 + 6552 +0 libsystem_kernel.dylib 0x00000001047b4014 0x1047b0000 + 16404 +1 Foundation 0x0000000180ecb4ec 0x18082c000 + 6943980 +2 opbeans-swift.debug.dylib 0x00000001072151b8 0x107050000 + 1855928 +3 opbeans-swift.debug.dylib 0x0000000107215b5c 0x107050000 + 1858396 +4 opbeans-swift.debug.dylib 0x00000001071440c0 0x107050000 + 999616 +5 opbeans-swift.debug.dylib 0x0000000107214f84 0x107050000 + 1855364 +6 opbeans-swift.debug.dylib 0x0000000107215458 0x107050000 + 1856600 +7 Foundation 0x0000000180f49b98 0x18082c000 + 7461784 +8 libsystem_pthread.dylib 0x00000001043e25f0 0x1043dc000 + 26096 +9 libsystem_pthread.dylib 0x00000001043dd998 0x1043dc000 + 6552 Thread 12: -0      libsystem_kernel.dylib                            0x00000001047b4014 0x1047b0000 + 16404 -1      Foundation                                                    0x0000000180ecb4ec 0x18082c000 + 6943980 -2      opbeans-swift.debug.dylib                      0x0000000107143dc8 0x107050000 + 998856 -3      opbeans-swift.debug.dylib                      0x0000000107144530 0x107050000 + 1000752 -4      opbeans-swift.debug.dylib                      0x00000001071440c0 0x107050000 + 999616 -5      opbeans-swift.debug.dylib                      0x0000000107143b90 0x107050000 + 998288 -6      opbeans-swift.debug.dylib                      0x000000010714414c 0x107050000 + 999756 -7      Foundation                                                    0x0000000180f49b98 0x18082c000 + 7461784 -8      libsystem_pthread.dylib                          0x00000001043e25f0 0x1043dc000 + 26096 -9      libsystem_pthread.dylib                          0x00000001043dd998 0x1043dc000 + 6552 +0 libsystem_kernel.dylib 0x00000001047b4014 0x1047b0000 + 16404 +1 Foundation 0x0000000180ecb4ec 0x18082c000 + 6943980 +2 opbeans-swift.debug.dylib 0x0000000107143dc8 0x107050000 + 998856 +3 opbeans-swift.debug.dylib 0x0000000107144530 0x107050000 + 1000752 +4 opbeans-swift.debug.dylib 0x00000001071440c0 0x107050000 + 999616 +5 opbeans-swift.debug.dylib 0x0000000107143b90 0x107050000 + 998288 +6 opbeans-swift.debug.dylib 0x000000010714414c 0x107050000 + 999756 +7 Foundation 0x0000000180f49b98 0x18082c000 + 7461784 +8 libsystem_pthread.dylib 0x00000001043e25f0 0x1043dc000 + 26096 +9 libsystem_pthread.dylib 0x00000001043dd998 0x1043dc000 + 6552 Thread 13: -0      libsystem_kernel.dylib                            0x00000001047b4014 0x1047b0000 + 16404 -1      Foundation                                                    0x0000000180ecb4ec 0x18082c000 + 6943980 -2      opbeans-swift.debug.dylib                      0x0000000107143dc8 0x107050000 + 998856 -3      opbeans-swift.debug.dylib                      0x0000000107144530 0x107050000 + 1000752 -4      opbeans-swift.debug.dylib                      0x00000001071440c0 0x107050000 + 999616 -5      opbeans-swift.debug.dylib                      0x0000000107143b90 0x107050000 + 998288 -6      opbeans-swift.debug.dylib                      0x000000010714414c 0x107050000 + 999756 -7      Foundation                                                    0x0000000180f49b98 0x18082c000 + 7461784 -8      libsystem_pthread.dylib                          0x00000001043e25f0 0x1043dc000 + 26096 -9      libsystem_pthread.dylib                          0x00000001043dd998 0x1043dc000 + 6552 +0 libsystem_kernel.dylib 0x00000001047b4014 0x1047b0000 + 16404 +1 Foundation 0x0000000180ecb4ec 0x18082c000 + 6943980 +2 opbeans-swift.debug.dylib 0x0000000107143dc8 0x107050000 + 998856 +3 opbeans-swift.debug.dylib 0x0000000107144530 0x107050000 + 1000752 +4 opbeans-swift.debug.dylib 0x00000001071440c0 0x107050000 + 999616 +5 opbeans-swift.debug.dylib 0x0000000107143b90 0x107050000 + 998288 +6 opbeans-swift.debug.dylib 0x000000010714414c 0x107050000 + 999756 +7 Foundation 0x0000000180f49b98 0x18082c000 + 7461784 +8 libsystem_pthread.dylib 0x00000001043e25f0 0x1043dc000 + 26096 +9 libsystem_pthread.dylib 0x00000001043dd998 0x1043dc000 + 6552 Thread 14: -0      opbeans-swift.debug.dylib                      0x0000000107ebe9b0 0x107050000 + 15133104 -1      opbeans-swift.debug.dylib                      0x0000000107eb4414 0x107050000 + 15090708 -2      libsystem_pthread.dylib                          0x00000001043e25f0 0x1043dc000 + 26096 -3      libsystem_pthread.dylib                          0x00000001043dd998 0x1043dc000 + 6552 +0 opbeans-swift.debug.dylib 0x0000000107ebe9b0 0x107050000 + 15133104 +1 opbeans-swift.debug.dylib 0x0000000107eb4414 0x107050000 + 15090708 +2 libsystem_pthread.dylib 0x00000001043e25f0 0x1043dc000 + 26096 +3 libsystem_pthread.dylib 0x00000001043dd998 0x1043dc000 + 6552 Thread 15: -0      libsystem_kernel.dylib                            0x00000001047baf98 0x1047b0000 + 44952 -1      libsystem_pthread.dylib                          0x00000001043e25f0 0x1043dc000 + 26096 -2      libsystem_pthread.dylib                          0x00000001043dd998 0x1043dc000 + 6552 +0 libsystem_kernel.dylib 0x00000001047baf98 0x1047b0000 + 44952 +1 libsystem_pthread.dylib 0x00000001043e25f0 0x1043dc000 + 26096 +2 libsystem_pthread.dylib 0x00000001043dd998 0x1043dc000 + 6552 Thread 16: -0      ???                                                                  0x0000000000000000 0x0 + 0 +0 ??? 0x0000000000000000 0x0 + 0 Thread 8 crashed with ARM-64 Thread State: -        pc: 0x0000000195712d2c          fp: 0x000000016c0c6e00          sp: 0x000000016c0c6d80          x0: 0xe800000000000000 -        x1: 0x0000000000000000          x2: 0x0000000000000000          x3: 0x00006000003d9f80          x4: 0x0000000000000008 -        x5: 0x000000016c0c6c60          x6: 0x2168736172432041          x7: 0x0000000000000000          x8: 0x0000000000000200 -        x9: 0x00000000c8a8709c        x10: 0x00000000000001ff        x11: 0x0000000000001f60        x12: 0x00000000000007fb -      x13: 0x00000000000007fd        x14: 0x00000000c8c878fc        x15: 0x00000000c8a8709c        x16: 0x00000000c8c00000 -      x17: 0x00000000000000fc        x18: 0x0000000000000000        x19: 0x0000600000c253e0        x20: 0x0000000000000000 -      x21: 0xffffffffffffffff        x22: 0x0000000000000000        x23: 0x00000000fff0ffff        x24: 0x0000600001720d00 -      x25: 0x0000000000000000        x26: 0x0000000000000114        x27: 0x0000000000000004        x28: 0x0000000000000000 -        lr: 0x0000000195712d2c      cpsr: 0x0000000060001000 + pc: 0x0000000195712d2c fp: 0x000000016c0c6e00 sp: 0x000000016c0c6d80 x0: 0xe800000000000000 + x1: 0x0000000000000000 x2: 0x0000000000000000 x3: 0x00006000003d9f80 x4: 0x0000000000000008 + x5: 0x000000016c0c6c60 x6: 0x2168736172432041 x7: 0x0000000000000000 x8: 0x0000000000000200 + x9: 0x00000000c8a8709c x10: 0x00000000000001ff x11: 0x0000000000001f60 x12: 0x00000000000007fb + x13: 0x00000000000007fd x14: 0x00000000c8c878fc x15: 0x00000000c8a8709c x16: 0x00000000c8c00000 + x17: 0x00000000000000fc x18: 0x0000000000000000 x19: 0x0000600000c253e0 x20: 0x0000000000000000 + x21: 0xffffffffffffffff x22: 0x0000000000000000 x23: 0x00000000fff0ffff x24: 0x0000600001720d00 + x25: 0x0000000000000000 x26: 0x0000000000000114 x27: 0x0000000000000004 x28: 0x0000000000000000 + lr: 0x0000000195712d2c cpsr: 0x0000000060001000 Binary Images: -              0x1043c4000 -                0x1043c7fff +opbeans-swift arm64    /Users/brycebuchanan/Library/Developer/CoreSimulator/Devices/5F5E45F7-760E-4589-9F48-B7264D35395A/data/Containers/Bundle/Application/06BCE84E-9AB0-42C0-8D74-72B8945645BC/opbeans-swift.app/opbeans-swift -              0x1043dc000 -                0x1043ebfff    libsystem_pthread.dylib arm64    /usr/lib/system/libsystem_pthread.dylib -              0x10443c000 -                0x104443fff    libsystem_platform.dylib arm64    <93afc0a9eec93f50933909c7757aa50a> /usr/lib/system/libsystem_platform.dylib -              0x1047b0000 -                0x1047ebfff    libsystem_kernel.dylib arm64    <4068b2eea54f397e882dc5e3a40b789a> /usr/lib/system/libsystem_kernel.dylib -              0x104848000 -                0x104853fff    libobjc-trampolines.dylib arm64    <22dfc62173863de387b29ed27c8be84d> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libobjc-trampolines.dylib -              0x107050000 -                0x1080a7fff    opbeans-swift.debug.dylib arm64    /Users/brycebuchanan/Library/Developer/CoreSimulator/Devices/5F5E45F7-760E-4589-9F48-B7264D35395A/data/Containers/Bundle/Application/06BCE84E-9AB0-42C0-8D74-72B8945645BC/opbeans-swift.app/opbeans-swift.debug.dylib -              0x180068000 -                0x1800a491f    libobjc.A.dylib arm64    <3286911c7f923620b8f718ac6061e9d9> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libobjc.A.dylib -              0x1800a5000 -                0x1800be21f    libsystem_trace.dylib arm64    <6faa12e4083d35cc8347750f34ffd1ec> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_trace.dylib -              0x1800bf000 -                0x1800faa9f    libxpc.dylib arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libxpc.dylib -              0x1800fb000 -                0x1800fdda8    libsystem_blocks.dylib arm64    <301e8d00828631bea19935b6d8cf38bf> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_blocks.dylib -              0x1800fe000 -                0x18017a79b    libsystem_c.dylib arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_c.dylib -              0x18017b000 -                0x1801bfb5f    libdispatch.dylib arm64    <7bee27fdf519330daebed6ace467df22> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libdispatch.dylib -              0x1801c0000 -                0x1801ffef7    libsystem_malloc.dylib arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_malloc.dylib -              0x180200000 -                0x18029a64f    libcorecrypto.dylib arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libcorecrypto.dylib -              0x18029b000 -                0x1802b6fff    libc++abi.dylib arm64    <3a16c8a1792d38cf967a72505dfb87e4> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libc++abi.dylib -              0x1802b7000 -                0x1802e1fe2    libdyld.dylib arm64    <4056bff4af5930e787914708c49cffe0> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libdyld.dylib -              0x1802e2000 -                0x1802ea673    libsystem_darwin.dylib arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_darwin.dylib -              0x1802eb000 -                0x18036fffb    libc++.1.dylib arm64    <494bdb39105636e6910ccaf9ec5f81ec> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libc++.1.dylib -              0x180370000 -                0x18039471f    libsystem_info.dylib arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_info.dylib -              0x180395000 -                0x1807acfff    CoreFoundation arm64    <3d4aa1d503aa3365b767944509b9bbfd> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation -              0x1807ad000 -                0x18082b8f3    SystemConfiguration arm64    <99a4dd2c4d163a949d01598c00290588> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration -              0x18082c000 -                0x1813f18df    Foundation arm64    <6ec60314780a318f8bdb5d173b13970e> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Foundation.framework/Foundation -              0x1813f2000 -                0x18141fc77    libCRFSuite.dylib arm64    <1f512f0900fa39c4989738225a6aa14f> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libCRFSuite.dylib -              0x181420000 -                0x181638c9f    CoreServices arm64    <1b198a214877379c85f072a271ec1b01> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreServices.framework/CoreServices -              0x181639000 -                0x1816970f7    libSparse.dylib arm64    <0a4389578a323fe8b05ea13f01072a89> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libSparse.dylib -              0x181698000 -                0x181bf90df    ImageIO arm64    <4674256467fc3ecb915fd8002783c749> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/ImageIO.framework/ImageIO -              0x181bfe000 -                0x181de1b7f    CoreText arm64    <880e3304e1373f38abf0567290c4381f> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreText.framework/CoreText -              0x181de2000 -                0x181f95b9f    Security arm64    <19a0b76e287e33cbb59c0724e7d2b0a8> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Security.framework/Security -              0x181f96000 -                0x18203359f    IOKit arm64    <0771439acb1338c0a90c213036acacbd> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit -              0x182034000 -                0x1820738ff    libMobileGestalt.dylib arm64    <1bffa8a238ce35ab843550706f48ef22> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libMobileGestalt.dylib -              0x182074000 -                0x1820ce5e7    libprotobuf.dylib arm64    <991ed98608833f95990c0d8e51f4aec0> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libprotobuf.dylib -              0x1820cf000 -                0x1820e08cf    libprotobuf-lite.dylib arm64    <55e763046f0c34d4bf931375658f8d29> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libprotobuf-lite.dylib -              0x1820e1000 -                0x18237800b    libicucore.A.dylib arm64    <4d469ab560b7304cb3fcfa97344d6c8c> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libicucore.A.dylib -              0x182379000 -                0x1823a8113    CoreServicesInternal arm64    <0202b827fc4f3c28b26de9dbaca54155> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/CoreServicesInternal.framework/CoreServicesInternal -              0x1823a9000 -                0x1823e403f    WirelessDiagnostics arm64    <543efd2f9ff039c2ba3646787872865e> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/WirelessDiagnostics.framework/WirelessDiagnostics -              0x1823e5000 -                0x1824157b7    libAWDSupport.dylib arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libAWDSupport.dylib -              0x182416000 -                0x18282649f    CoreAudio arm64    <52498879022c3b1f90ab296710191a77> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreAudio.framework/CoreAudio -              0x182827000 -                0x182bb0e9f    CoreImage arm64    <585bedb6c5ce36dca76ddb4ee06386fd> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreImage.framework/CoreImage -              0x182e48000 -                0x182fc2edf    libsqlite3.dylib arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libsqlite3.dylib -              0x182fc3000 -                0x182fcf51e    libsystem_notify.dylib arm64    <239dd2c6bd8c3cfd9500a63b808d4b7f> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_notify.dylib -              0x183499000 -                0x1834da47f    AppSupport arm64    <75cb542596413012957045d95cbf4148> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/AppSupport.framework/AppSupport -              0x1834db000 -                0x1834db387    libnetwork.dylib arm64    <60305c56f5f7381fa84bd6a416bfb3c7> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libnetwork.dylib -              0x1834dc000 -                0x1835ec9df    ManagedConfiguration arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/ManagedConfiguration.framework/ManagedConfiguration -              0x1835ed000 -                0x183624ebf    CoreServicesStore arm64    <6bb5163cec18358596d353506709a991> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/CoreServicesStore.framework/CoreServicesStore -              0x183625000 -                0x183641e7f    UserManagement arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UserManagement.framework/UserManagement -              0x183b23000 -                0x183b3b6ff    ProtocolBuffer arm64    <887ce4ece3d23e8681706f52b6e3f504> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/ProtocolBuffer.framework/ProtocolBuffer -              0x183b3c000 -                0x183b4f9bf    CommonUtilities arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/CommonUtilities.framework/CommonUtilities -              0x183b50000 -                0x183ba9eff    RunningBoardServices arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/RunningBoardServices.framework/RunningBoardServices -              0x183baa000 -                0x183c7795f    BaseBoard arm64    <3299412bf1c13fc28f2f885df7dfee05> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/BaseBoard.framework/BaseBoard -              0x1845a8000 -                0x1847fbdff    CoreLocation arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreLocation.framework/CoreLocation -              0x184805000 -                0x1848774df    Accounts arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Accounts.framework/Accounts -              0x184899000 -                0x184c1a83f    CFNetwork arm64    <4642e7e4b83d3225a892a22fdca4c077> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CFNetwork.framework/CFNetwork -              0x184c1b000 -                0x184d7105f    UIFoundation arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIFoundation.framework/UIFoundation -              0x184d72000 -                0x186adb8df    UIKitCore arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore -              0x186adc000 -                0x186ae89bf    AssertionServices arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/AssertionServices.framework/AssertionServices -              0x186ae9000 -                0x186ce9e3f    CoreTelephony arm64    <3324ab32d1f43ad1950c444cd71ec436> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreTelephony.framework/CoreTelephony -              0x186cea000 -                0x186ceaf9f    AggregateDictionary arm64    <86115f236ca130a98b3949a8e0f4938d> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/AggregateDictionary.framework/AggregateDictionary -              0x186ceb000 -                0x186d01c0b    libsystem_asl.dylib arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_asl.dylib -              0x186d02000 -                0x186dc783f    CloudDocs arm64    <9c28961eeb07396ab773714e63201a91> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/CloudDocs.framework/CloudDocs -              0x186dc8000 -                0x1871a7edf    CoreData arm64    <7bf1e626f000323eb3a6f9faae15b48a> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreData.framework/CoreData -              0x1876ba000 -                0x18771d6df    BoardServices arm64    <5c560e9f2a9f3c55a2064168a4009432> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/BoardServices.framework/BoardServices -              0x18771e000 -                0x1877e44ff    libboringssl.dylib arm64    <0463a94630f33854b4ae368a9287e4a0> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libboringssl.dylib -              0x1877e5000 -                0x18781269f    CoreAnalytics arm64    <69494a450b2d3d82bdc99860d46f2699> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/CoreAnalytics.framework/CoreAnalytics -              0x187813000 -                0x187b4bf9f    CloudKit arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CloudKit.framework/CloudKit -              0x187b4c000 -                0x187bebc3f    SpringBoardServices arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/SpringBoardServices.framework/SpringBoardServices -              0x187bec000 -                0x187cab3df    FrontBoardServices arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices -              0x187cac000 -                0x188b2cf5f    Network arm64    <70ba19ba63ce3b4c9464c95a607990bd> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Network.framework/Network -              0x188b2d000 -                0x188b994a3    libusrtcp.dylib arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libusrtcp.dylib -              0x188b9a000 -                0x18a6026ff    GeoServices arm64    /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/GeoServices.framework/GeoServices -              0x18a603000 -                0x18a618e33    TCC arm64    <00c5cd7d98443e978c555918455a3a97> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/TCC.framework/TCC -              0x18a619000 -                0x18a67e5bf    IMFoundation arm64    <2e1611cba49a33959d60584f62766efb> /Library/Developer/Co<…> + 0x1043c4000 - 0x1043c7fff +opbeans-swift arm64 /Users/brycebuchanan/Library/Developer/CoreSimulator/Devices/5F5E45F7-760E-4589-9F48-B7264D35395A/data/Containers/Bundle/Application/06BCE84E-9AB0-42C0-8D74-72B8945645BC/opbeans-swift.app/opbeans-swift + 0x1043dc000 - 0x1043ebfff libsystem_pthread.dylib arm64 /usr/lib/system/libsystem_pthread.dylib + 0x10443c000 - 0x104443fff libsystem_platform.dylib arm64 <93afc0a9eec93f50933909c7757aa50a> /usr/lib/system/libsystem_platform.dylib + 0x1047b0000 - 0x1047ebfff libsystem_kernel.dylib arm64 <4068b2eea54f397e882dc5e3a40b789a> /usr/lib/system/libsystem_kernel.dylib + 0x104848000 - 0x104853fff libobjc-trampolines.dylib arm64 <22dfc62173863de387b29ed27c8be84d> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libobjc-trampolines.dylib + 0x107050000 - 0x1080a7fff opbeans-swift.debug.dylib arm64 /Users/brycebuchanan/Library/Developer/CoreSimulator/Devices/5F5E45F7-760E-4589-9F48-B7264D35395A/data/Containers/Bundle/Application/06BCE84E-9AB0-42C0-8D74-72B8945645BC/opbeans-swift.app/opbeans-swift.debug.dylib + 0x180068000 - 0x1800a491f libobjc.A.dylib arm64 <3286911c7f923620b8f718ac6061e9d9> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libobjc.A.dylib + 0x1800a5000 - 0x1800be21f libsystem_trace.dylib arm64 <6faa12e4083d35cc8347750f34ffd1ec> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_trace.dylib + 0x1800bf000 - 0x1800faa9f libxpc.dylib arm64 /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libxpc.dylib + 0x1800fb000 - 0x1800fdda8 libsystem_blocks.dylib arm64 <301e8d00828631bea19935b6d8cf38bf> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_blocks.dylib + 0x1800fe000 - 0x18017a79b libsystem_c.dylib arm64 /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_c.dylib + 0x18017b000 - 0x1801bfb5f libdispatch.dylib arm64 <7bee27fdf519330daebed6ace467df22> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libdispatch.dylib + 0x1801c0000 - 0x1801ffef7 libsystem_malloc.dylib arm64 /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_malloc.dylib + 0x180200000 - 0x18029a64f libcorecrypto.dylib arm64 /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libcorecrypto.dylib + 0x18029b000 - 0x1802b6fff libc++abi.dylib arm64 <3a16c8a1792d38cf967a72505dfb87e4> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libc++abi.dylib + 0x1802b7000 - 0x1802e1fe2 libdyld.dylib arm64 <4056bff4af5930e787914708c49cffe0> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libdyld.dylib + 0x1802e2000 - 0x1802ea673 libsystem_darwin.dylib arm64 /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_darwin.dylib + 0x1802eb000 - 0x18036fffb libc++.1.dylib arm64 <494bdb39105636e6910ccaf9ec5f81ec> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libc++.1.dylib + 0x180370000 - 0x18039471f libsystem_info.dylib arm64 /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_info.dylib + 0x180395000 - 0x1807acfff CoreFoundation arm64 <3d4aa1d503aa3365b767944509b9bbfd> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation + 0x1807ad000 - 0x18082b8f3 SystemConfiguration arm64 <99a4dd2c4d163a949d01598c00290588> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration + 0x18082c000 - 0x1813f18df Foundation arm64 <6ec60314780a318f8bdb5d173b13970e> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Foundation.framework/Foundation + 0x1813f2000 - 0x18141fc77 libCRFSuite.dylib arm64 <1f512f0900fa39c4989738225a6aa14f> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libCRFSuite.dylib + 0x181420000 - 0x181638c9f CoreServices arm64 <1b198a214877379c85f072a271ec1b01> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreServices.framework/CoreServices + 0x181639000 - 0x1816970f7 libSparse.dylib arm64 <0a4389578a323fe8b05ea13f01072a89> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libSparse.dylib + 0x181698000 - 0x181bf90df ImageIO arm64 <4674256467fc3ecb915fd8002783c749> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/ImageIO.framework/ImageIO + 0x181bfe000 - 0x181de1b7f CoreText arm64 <880e3304e1373f38abf0567290c4381f> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreText.framework/CoreText + 0x181de2000 - 0x181f95b9f Security arm64 <19a0b76e287e33cbb59c0724e7d2b0a8> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Security.framework/Security + 0x181f96000 - 0x18203359f IOKit arm64 <0771439acb1338c0a90c213036acacbd> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit + 0x182034000 - 0x1820738ff libMobileGestalt.dylib arm64 <1bffa8a238ce35ab843550706f48ef22> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libMobileGestalt.dylib + 0x182074000 - 0x1820ce5e7 libprotobuf.dylib arm64 <991ed98608833f95990c0d8e51f4aec0> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libprotobuf.dylib + 0x1820cf000 - 0x1820e08cf libprotobuf-lite.dylib arm64 <55e763046f0c34d4bf931375658f8d29> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libprotobuf-lite.dylib + 0x1820e1000 - 0x18237800b libicucore.A.dylib arm64 <4d469ab560b7304cb3fcfa97344d6c8c> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libicucore.A.dylib + 0x182379000 - 0x1823a8113 CoreServicesInternal arm64 <0202b827fc4f3c28b26de9dbaca54155> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/CoreServicesInternal.framework/CoreServicesInternal + 0x1823a9000 - 0x1823e403f WirelessDiagnostics arm64 <543efd2f9ff039c2ba3646787872865e> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/WirelessDiagnostics.framework/WirelessDiagnostics + 0x1823e5000 - 0x1824157b7 libAWDSupport.dylib arm64 /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libAWDSupport.dylib + 0x182416000 - 0x18282649f CoreAudio arm64 <52498879022c3b1f90ab296710191a77> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreAudio.framework/CoreAudio + 0x182827000 - 0x182bb0e9f CoreImage arm64 <585bedb6c5ce36dca76ddb4ee06386fd> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreImage.framework/CoreImage + 0x182e48000 - 0x182fc2edf libsqlite3.dylib arm64 /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libsqlite3.dylib + 0x182fc3000 - 0x182fcf51e libsystem_notify.dylib arm64 <239dd2c6bd8c3cfd9500a63b808d4b7f> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_notify.dylib + 0x183499000 - 0x1834da47f AppSupport arm64 <75cb542596413012957045d95cbf4148> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/AppSupport.framework/AppSupport + 0x1834db000 - 0x1834db387 libnetwork.dylib arm64 <60305c56f5f7381fa84bd6a416bfb3c7> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libnetwork.dylib + 0x1834dc000 - 0x1835ec9df ManagedConfiguration arm64 /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/ManagedConfiguration.framework/ManagedConfiguration + 0x1835ed000 - 0x183624ebf CoreServicesStore arm64 <6bb5163cec18358596d353506709a991> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/CoreServicesStore.framework/CoreServicesStore + 0x183625000 - 0x183641e7f UserManagement arm64 /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UserManagement.framework/UserManagement + 0x183b23000 - 0x183b3b6ff ProtocolBuffer arm64 <887ce4ece3d23e8681706f52b6e3f504> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/ProtocolBuffer.framework/ProtocolBuffer + 0x183b3c000 - 0x183b4f9bf CommonUtilities arm64 /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/CommonUtilities.framework/CommonUtilities + 0x183b50000 - 0x183ba9eff RunningBoardServices arm64 /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/RunningBoardServices.framework/RunningBoardServices + 0x183baa000 - 0x183c7795f BaseBoard arm64 <3299412bf1c13fc28f2f885df7dfee05> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/BaseBoard.framework/BaseBoard + 0x1845a8000 - 0x1847fbdff CoreLocation arm64 /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreLocation.framework/CoreLocation + 0x184805000 - 0x1848774df Accounts arm64 /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Accounts.framework/Accounts + 0x184899000 - 0x184c1a83f CFNetwork arm64 <4642e7e4b83d3225a892a22fdca4c077> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CFNetwork.framework/CFNetwork + 0x184c1b000 - 0x184d7105f UIFoundation arm64 /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIFoundation.framework/UIFoundation + 0x184d72000 - 0x186adb8df UIKitCore arm64 /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore + 0x186adc000 - 0x186ae89bf AssertionServices arm64 /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/AssertionServices.framework/AssertionServices + 0x186ae9000 - 0x186ce9e3f CoreTelephony arm64 <3324ab32d1f43ad1950c444cd71ec436> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreTelephony.framework/CoreTelephony + 0x186cea000 - 0x186ceaf9f AggregateDictionary arm64 <86115f236ca130a98b3949a8e0f4938d> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/AggregateDictionary.framework/AggregateDictionary + 0x186ceb000 - 0x186d01c0b libsystem_asl.dylib arm64 /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_asl.dylib + 0x186d02000 - 0x186dc783f CloudDocs arm64 <9c28961eeb07396ab773714e63201a91> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/CloudDocs.framework/CloudDocs + 0x186dc8000 - 0x1871a7edf CoreData arm64 <7bf1e626f000323eb3a6f9faae15b48a> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreData.framework/CoreData + 0x1876ba000 - 0x18771d6df BoardServices arm64 <5c560e9f2a9f3c55a2064168a4009432> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/BoardServices.framework/BoardServices + 0x18771e000 - 0x1877e44ff libboringssl.dylib arm64 <0463a94630f33854b4ae368a9287e4a0> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libboringssl.dylib + 0x1877e5000 - 0x18781269f CoreAnalytics arm64 <69494a450b2d3d82bdc99860d46f2699> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/CoreAnalytics.framework/CoreAnalytics + 0x187813000 - 0x187b4bf9f CloudKit arm64 /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CloudKit.framework/CloudKit + 0x187b4c000 - 0x187bebc3f SpringBoardServices arm64 /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/SpringBoardServices.framework/SpringBoardServices + 0x187bec000 - 0x187cab3df FrontBoardServices arm64 /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices + 0x187cac000 - 0x188b2cf5f Network arm64 <70ba19ba63ce3b4c9464c95a607990bd> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Network.framework/Network + 0x188b2d000 - 0x188b994a3 libusrtcp.dylib arm64 /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libusrtcp.dylib + 0x188b9a000 - 0x18a6026ff GeoServices arm64 /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/GeoServices.framework/GeoServices + 0x18a603000 - 0x18a618e33 TCC arm64 <00c5cd7d98443e978c555918455a3a97> /Library/Developer/CoreSimulator/Volumes/iOS_22E238/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/TCC.framework/TCC + 0x18a619000 - 0x18a67e5bf IMFoundation arm64 <2e1611cba49a33959d60584f62766efb> /Library/Developer/Co<> From 865ad561223c6117abe27fd769c96686ca21feac Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Wed, 11 Jun 2025 16:59:39 +0200 Subject: [PATCH 57/67] removing unicode chars --- .../internal/mobile/testdata/swift/curated-thread-8-crash.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/enrichments/logs/internal/mobile/testdata/swift/curated-thread-8-crash.txt b/enrichments/logs/internal/mobile/testdata/swift/curated-thread-8-crash.txt index b93b6fb..9f94325 100644 --- a/enrichments/logs/internal/mobile/testdata/swift/curated-thread-8-crash.txt +++ b/enrichments/logs/internal/mobile/testdata/swift/curated-thread-8-crash.txt @@ -1 +1 @@ -Thread8Crashed:0libswiftCore.dylib0x0000000195712d2c0x1956e8000+1754041opbeans-swift.debug.dylib0x00000001070770480x107050000+1598162opbeans-swift.debug.dylib0x00000001070728140x107050000+1413323libdispatch.dylib0x000000018017c7880x18017b000+60244libdispatch.dylib0x00000001801972780x18017b000+1153205libdispatch.dylib0x00000001801b23500x18017b000+2261286libdispatch.dylib0x000000018018fc100x18017b000+850087libdispatch.dylib0x00000001801903b40x18017b000+869648libsystem_pthread.dylib0x00000001043deb900x1043dc000+111529libsystem_pthread.dylib0x00000001043dd98c0x1043dc000+6540 \ No newline at end of file +Thread8Crashed:0libswiftCore.dylib0x0000000195712d2c0x1956e8000+1754041opbeans-swift.debug.dylib0x00000001070770480x107050000+1598162opbeans-swift.debug.dylib0x00000001070728140x107050000+1413323libdispatch.dylib0x000000018017c7880x18017b000+60244libdispatch.dylib0x00000001801972780x18017b000+1153205libdispatch.dylib0x00000001801b23500x18017b000+2261286libdispatch.dylib0x000000018018fc100x18017b000+850087libdispatch.dylib0x00000001801903b40x18017b000+869648libsystem_pthread.dylib0x00000001043deb900x1043dc000+111529libsystem_pthread.dylib0x00000001043dd98c0x1043dc000+6540 \ No newline at end of file From 3b68636e97541787b920de854584edff9a38cea0 Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Wed, 11 Jun 2025 17:03:33 +0200 Subject: [PATCH 58/67] Creating swift stacktrace groupingkey --- .../logs/internal/mobile/groupingkey.go | 73 +++++-------------- .../logs/internal/mobile/groupingkey_test.go | 33 ++++++++- 2 files changed, 47 insertions(+), 59 deletions(-) diff --git a/enrichments/logs/internal/mobile/groupingkey.go b/enrichments/logs/internal/mobile/groupingkey.go index 0b525f9..2d65a50 100644 --- a/enrichments/logs/internal/mobile/groupingkey.go +++ b/enrichments/logs/internal/mobile/groupingkey.go @@ -18,6 +18,7 @@ package mobile import ( + "errors" "fmt" "regexp" "strings" @@ -29,12 +30,13 @@ var ( // Regex patterns for java stack trace processing errorOrCausePattern = regexp.MustCompile(`^((?:Caused\sby:\s[^:]+)|(?:[^\s][^:]+))(:\s.+)?$`) callSitePattern = regexp.MustCompile(`^\s+at\s.+(:\d+)\)$`) - unwantedPattern = regexp.MustCompile(`\s+`) allLinesPattern = regexp.MustCompile(`(m?).+`) // Regex patterns for swift stack trace processing - iosCrashedThreadPattern = regexp.MustCompile(`^Thread\s+(\d+)\s+Crashed:$`) - iosThreadPattern = regexp.MustCompile(`^Thread\s+(\d+):$`) + swiftCrashedThreadPattern = regexp.MustCompile(`\nThread \d+ Crashed:.*\n(.+\n)+\n`) + + // Common patterns + unwantedPattern = regexp.MustCompile(`\s+`) ) func CreateJavaStacktraceGroupingKey(stacktrace string) string { @@ -56,64 +58,23 @@ func curateJavaStacktrace(stacktrace string) string { return unwantedPattern.ReplaceAllString(curatedLines, "") } -func CreateSwiftStacktraceGroupingKey(stacktrace string) string { - // Extract the crashed thread block - crashThreadContent := extractCrashedThread(stacktrace) +func CreateSwiftStacktraceGroupingKey(stacktrace string) (string, error) { + crashThreadContent, err := curateSwiftStacktrace(stacktrace) + + if err != nil { + return "", err + } - // Hash the crashed thread content using xxhash hash := xxhash.Sum64String(crashThreadContent) - return fmt.Sprintf("%016x", hash) + return fmt.Sprintf("%016x", hash), nil } -func extractCrashedThread(stacktrace string) string { - lines := strings.Split(stacktrace, "\n") - - var crashedThreadLines []string - var inCrashedThread bool - - for i, line := range lines { - // Check if this line indicates the start of the crashed thread - if iosCrashedThreadPattern.MatchString(line) { - inCrashedThread = true - crashThreadMatch := iosCrashedThreadPattern.FindStringSubmatch(line) - crashThreadNum := crashThreadMatch[1] - crashThreadHeader := fmt.Sprintf("Thread %s Crashed:", crashThreadNum) - crashThreadVerbatim := fmt.Sprintf("Thread%sCrashed", crashThreadNum) - crashThreadFormatted := unwantedPattern.ReplaceAllString(crashThreadVerbatim, "") - crashThreadHeader = unwantedPattern.ReplaceAllString(crashThreadHeader, "") +func curateSwiftStacktrace(stacktrace string) (string, error) { + match := swiftCrashedThreadPattern.FindString(stacktrace) - // Start capturing the crashed thread, beginning with the header - crashGrepKey := fmt.Sprintf("%s:", crashThreadFormatted) - crashedThreadLines = append(crashedThreadLines, crashGrepKey) - continue - } - - // Check if we've found the end of the crashed thread section - // End is marked by either a new thread section or an empty line followed by another section - if inCrashedThread && (iosThreadPattern.MatchString(line) || - (len(strings.TrimSpace(line)) == 0 && i+1 < len(lines) && len(strings.TrimSpace(lines[i+1])) > 0 && - !strings.HasPrefix(strings.TrimSpace(lines[i+1]), "0"))) { - break - } - - // Add line to the crashed thread content if we're in the crashed thread section - if inCrashedThread && len(strings.TrimSpace(line)) > 0 { - // Format the line to remove unnecessary whitespace - formattedLine := unwantedPattern.ReplaceAllString(line, "") - crashLines := unwantedPattern.ReplaceAllString(formattedLine, "") - crashLines = strings.ReplaceAll(crashLines, ":", "") - crashLines = strings.ReplaceAll(crashLines, "+", "") - crashLines = strings.ReplaceAll(crashLines, "0x", "") - crashLines = strings.Join(strings.Fields(crashLines), "") - crashLines = strings.Trim(crashLines, "0123456789") - - // Add the formatted line to our result - if len(crashLines) > 0 { - crashedThreadLines = append(crashedThreadLines, crashLines) - } - } + if match == "" { + return "", errors.New("no swift crashed thread found") } - // Join all lines with a separator to create the final string for hashing - return strings.Join(crashedThreadLines, "") + return unwantedPattern.ReplaceAllString(match, ""), nil } diff --git a/enrichments/logs/internal/mobile/groupingkey_test.go b/enrichments/logs/internal/mobile/groupingkey_test.go index 549643b..cdf14c9 100644 --- a/enrichments/logs/internal/mobile/groupingkey_test.go +++ b/enrichments/logs/internal/mobile/groupingkey_test.go @@ -76,6 +76,32 @@ func TestCreateJavaStacktraceGroupingKey(t *testing.T) { } } +func TestCurateSwiftStacktrace(t *testing.T) { + for _, tc := range []struct { + name string + crashFile string + expectedValue string + }{ + { + name: "thread_0_crash", + crashFile: "thread-0-crash.txt", + expectedValue: readSwiftStacktraceFile(t, "curated-thread-0-crash.txt"), + }, + { + name: "thread_8_crash", + crashFile: "thread-8-crash.txt", + expectedValue: readSwiftStacktraceFile(t, "curated-thread-8-crash.txt"), + }, + } { + t.Run(tc.name, func(t *testing.T) { + crashReport := readSwiftStacktraceFile(t, tc.crashFile) + curatedValue, err := curateSwiftStacktrace(crashReport) + assert.NoError(t, err) + assert.Equal(t, tc.expectedValue, curatedValue) + }) + } +} + func TestCreateSwiftStacktraceGroupingKey(t *testing.T) { for _, tc := range []struct { name string @@ -85,17 +111,18 @@ func TestCreateSwiftStacktraceGroupingKey(t *testing.T) { { name: "thread_0_crash", crashFile: "thread-0-crash.txt", - expectedId: "b032e62a8ac17471", + expectedId: "d61515e9ce80cace", }, { name: "thread_8_crash", crashFile: "thread-8-crash.txt", - expectedId: "11af41fb7f4bc7ac", + expectedId: "e81038d076b964b1", }, } { t.Run(tc.name, func(t *testing.T) { crashReport := readSwiftStacktraceFile(t, tc.crashFile) - actualId := CreateSwiftStacktraceGroupingKey(crashReport) + actualId, err := CreateSwiftStacktraceGroupingKey(crashReport) + assert.NoError(t, err) assert.Equal(t, tc.expectedId, actualId) }) } From 684ecd08ccef1951e07e9a5ce0a0cdaec131167b Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Wed, 11 Jun 2025 17:12:39 +0200 Subject: [PATCH 59/67] Add Swift error grouping key support to enrichCrashEvent function --- enrichments/logs/internal/mobile/event.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/enrichments/logs/internal/mobile/event.go b/enrichments/logs/internal/mobile/event.go index 39dd575..2126be6 100644 --- a/enrichments/logs/internal/mobile/event.go +++ b/enrichments/logs/internal/mobile/event.go @@ -53,8 +53,15 @@ func enrichCrashEvent(logRecord plog.LogRecord, resourceAttrs map[string]any) { stacktrace, ok := logRecord.Attributes().Get("exception.stacktrace") if ok { language, hasLanguage := resourceAttrs["telemetry.sdk.language"] - if hasLanguage && language == "java" { - logRecord.Attributes().PutStr(elasticattr.ErrorGroupingKey, CreateJavaStacktraceGroupingKey(stacktrace.AsString())) + if hasLanguage { + switch language { + case "java": + logRecord.Attributes().PutStr(elasticattr.ErrorGroupingKey, CreateJavaStacktraceGroupingKey(stacktrace.AsString())) + case "swift": + if key, err := CreateSwiftStacktraceGroupingKey(stacktrace.AsString()); err == nil { + logRecord.Attributes().PutStr(elasticattr.ErrorGroupingKey, key) + } + } } } logRecord.Attributes().PutStr(elasticattr.ErrorType, "crash") From b3b8145ae92330a261ba8adfa4b3f358a3f37be0 Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Wed, 11 Jun 2025 17:12:47 +0200 Subject: [PATCH 60/67] Renaming function --- enrichments/logs/internal/mobile/groupingkey.go | 4 ++-- enrichments/logs/internal/mobile/groupingkey_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/enrichments/logs/internal/mobile/groupingkey.go b/enrichments/logs/internal/mobile/groupingkey.go index 2d65a50..eb6ba23 100644 --- a/enrichments/logs/internal/mobile/groupingkey.go +++ b/enrichments/logs/internal/mobile/groupingkey.go @@ -59,7 +59,7 @@ func curateJavaStacktrace(stacktrace string) string { } func CreateSwiftStacktraceGroupingKey(stacktrace string) (string, error) { - crashThreadContent, err := curateSwiftStacktrace(stacktrace) + crashThreadContent, err := findAndCurateSwiftStacktrace(stacktrace) if err != nil { return "", err @@ -69,7 +69,7 @@ func CreateSwiftStacktraceGroupingKey(stacktrace string) (string, error) { return fmt.Sprintf("%016x", hash), nil } -func curateSwiftStacktrace(stacktrace string) (string, error) { +func findAndCurateSwiftStacktrace(stacktrace string) (string, error) { match := swiftCrashedThreadPattern.FindString(stacktrace) if match == "" { diff --git a/enrichments/logs/internal/mobile/groupingkey_test.go b/enrichments/logs/internal/mobile/groupingkey_test.go index cdf14c9..57f3623 100644 --- a/enrichments/logs/internal/mobile/groupingkey_test.go +++ b/enrichments/logs/internal/mobile/groupingkey_test.go @@ -95,7 +95,7 @@ func TestCurateSwiftStacktrace(t *testing.T) { } { t.Run(tc.name, func(t *testing.T) { crashReport := readSwiftStacktraceFile(t, tc.crashFile) - curatedValue, err := curateSwiftStacktrace(crashReport) + curatedValue, err := findAndCurateSwiftStacktrace(crashReport) assert.NoError(t, err) assert.Equal(t, tc.expectedValue, curatedValue) }) From 8d90190bbe377dc48c21301ec859e8134acc5426 Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Wed, 11 Jun 2025 18:58:41 +0200 Subject: [PATCH 61/67] Add test case for Swift error grouping key support --- .../logs/internal/mobile/event_test.go | 39 +++++++++++++++---- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/enrichments/logs/internal/mobile/event_test.go b/enrichments/logs/internal/mobile/event_test.go index 2808683..93e7f27 100644 --- a/enrichments/logs/internal/mobile/event_test.go +++ b/enrichments/logs/internal/mobile/event_test.go @@ -32,8 +32,11 @@ import ( func TestEnrichEvents(t *testing.T) { now := time.Unix(3600, 0) timestamp := pcommon.NewTimestampFromTime(now) - stacktrace := "Exception in thread \"main\" java.lang.RuntimeException: Test exception\n at com.example.GenerateTrace.methodB(GenerateTrace.java:13)\n at com.example.GenerateTrace.methodA(GenerateTrace.java:9)\n at com.example.GenerateTrace.main(GenerateTrace.java:5)" - stacktraceHash := "e25c4196dc720d91" + javaStacktrace := "Exception in thread \"main\" java.lang.RuntimeException: Test exception\n at com.example.GenerateTrace.methodB(GenerateTrace.java:13)\n at com.example.GenerateTrace.methodA(GenerateTrace.java:9)\n at com.example.GenerateTrace.main(GenerateTrace.java:5)" + javaStacktraceHash := "e25c4196dc720d91" + + swiftStacktrace := readSwiftStacktraceFile(t, "thread-8-crash.txt") + swiftStacktraceHash := "e81038d076b964b1" for _, tc := range []struct { name string @@ -54,13 +57,13 @@ func TestEnrichEvents(t *testing.T) { logRecord.Attributes().PutStr("event.name", "device.crash") logRecord.Attributes().PutStr("exception.message", "Exception message") logRecord.Attributes().PutStr("exception.type", "java.lang.RuntimeException") - logRecord.Attributes().PutStr("exception.stacktrace", stacktrace) + logRecord.Attributes().PutStr("exception.stacktrace", javaStacktrace) return logRecord }, expectedAttributes: map[string]any{ "processor.event": "error", "timestamp.us": timestamp.AsTime().UnixMicro(), - "error.grouping_key": stacktraceHash, + "error.grouping_key": javaStacktraceHash, "error.type": "crash", "event.kind": "event", }, @@ -77,13 +80,13 @@ func TestEnrichEvents(t *testing.T) { logRecord.Attributes().PutStr("event.name", "device.crash") logRecord.Attributes().PutStr("exception.message", "Exception message") logRecord.Attributes().PutStr("exception.type", "java.lang.RuntimeException") - logRecord.Attributes().PutStr("exception.stacktrace", stacktrace) + logRecord.Attributes().PutStr("exception.stacktrace", javaStacktrace) return logRecord }, expectedAttributes: map[string]any{ "processor.event": "error", "timestamp.us": timestamp.AsTime().UnixMicro(), - "error.grouping_key": stacktraceHash, + "error.grouping_key": javaStacktraceHash, "error.type": "crash", "event.kind": "event", }, @@ -100,7 +103,7 @@ func TestEnrichEvents(t *testing.T) { logRecord.Attributes().PutStr("event.name", "device.crash") logRecord.Attributes().PutStr("exception.message", "Exception message") logRecord.Attributes().PutStr("exception.type", "go.error") - logRecord.Attributes().PutStr("exception.stacktrace", stacktrace) + logRecord.Attributes().PutStr("exception.stacktrace", javaStacktrace) return logRecord }, expectedAttributes: map[string]any{ @@ -123,6 +126,28 @@ func TestEnrichEvents(t *testing.T) { "event.kind": "event", }, }, + { + name: "crash_event_swift", + eventName: "device.crash", + resourceAttrs: map[string]any{ + "telemetry.sdk.language": "swift", + }, + input: func() plog.LogRecord { + logRecord := plog.NewLogRecord() + logRecord.SetTimestamp(timestamp) + logRecord.Attributes().PutStr("event.name", "device.crash") + logRecord.Attributes().PutStr("exception.type", "SIGTRAP") + logRecord.Attributes().PutStr("exception.stacktrace", swiftStacktrace) + return logRecord + }, + expectedAttributes: map[string]any{ + "processor.event": "error", + "timestamp.us": timestamp.AsTime().UnixMicro(), + "error.grouping_key": swiftStacktraceHash, + "error.type": "crash", + "event.kind": "event", + }, + }, } { t.Run(tc.name, func(t *testing.T) { inputLogRecord := tc.input() From 641a02ecd43c9ecc54ffa6d408fdf9042c0a01c3 Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Wed, 18 Jun 2025 06:14:36 +0200 Subject: [PATCH 62/67] Ensuring swift grouping keys don't contain the thread number --- enrichments/logs/internal/mobile/event_test.go | 2 +- enrichments/logs/internal/mobile/groupingkey.go | 8 ++++---- enrichments/logs/internal/mobile/groupingkey_test.go | 4 ++-- .../mobile/testdata/swift/curated-thread-0-crash.txt | 2 +- .../mobile/testdata/swift/curated-thread-8-crash.txt | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/enrichments/logs/internal/mobile/event_test.go b/enrichments/logs/internal/mobile/event_test.go index 93e7f27..5ef3e25 100644 --- a/enrichments/logs/internal/mobile/event_test.go +++ b/enrichments/logs/internal/mobile/event_test.go @@ -36,7 +36,7 @@ func TestEnrichEvents(t *testing.T) { javaStacktraceHash := "e25c4196dc720d91" swiftStacktrace := readSwiftStacktraceFile(t, "thread-8-crash.txt") - swiftStacktraceHash := "e81038d076b964b1" + swiftStacktraceHash := "873a0b5211c5aece" for _, tc := range []struct { name string diff --git a/enrichments/logs/internal/mobile/groupingkey.go b/enrichments/logs/internal/mobile/groupingkey.go index eb6ba23..18156b9 100644 --- a/enrichments/logs/internal/mobile/groupingkey.go +++ b/enrichments/logs/internal/mobile/groupingkey.go @@ -33,7 +33,7 @@ var ( allLinesPattern = regexp.MustCompile(`(m?).+`) // Regex patterns for swift stack trace processing - swiftCrashedThreadPattern = regexp.MustCompile(`\nThread \d+ Crashed:.*\n(.+\n)+\n`) + swiftCrashedThreadPattern = regexp.MustCompile(`\nThread \d+ Crashed:.*\n((?:.+\n)+)\n`) // Common patterns unwantedPattern = regexp.MustCompile(`\s+`) @@ -70,11 +70,11 @@ func CreateSwiftStacktraceGroupingKey(stacktrace string) (string, error) { } func findAndCurateSwiftStacktrace(stacktrace string) (string, error) { - match := swiftCrashedThreadPattern.FindString(stacktrace) + match := swiftCrashedThreadPattern.FindStringSubmatch(stacktrace) - if match == "" { + if match == nil { return "", errors.New("no swift crashed thread found") } - return unwantedPattern.ReplaceAllString(match, ""), nil + return unwantedPattern.ReplaceAllString(match[1], ""), nil } diff --git a/enrichments/logs/internal/mobile/groupingkey_test.go b/enrichments/logs/internal/mobile/groupingkey_test.go index 57f3623..9c74f1d 100644 --- a/enrichments/logs/internal/mobile/groupingkey_test.go +++ b/enrichments/logs/internal/mobile/groupingkey_test.go @@ -111,12 +111,12 @@ func TestCreateSwiftStacktraceGroupingKey(t *testing.T) { { name: "thread_0_crash", crashFile: "thread-0-crash.txt", - expectedId: "d61515e9ce80cace", + expectedId: "75cd46a9f1d832a8", }, { name: "thread_8_crash", crashFile: "thread-8-crash.txt", - expectedId: "e81038d076b964b1", + expectedId: "873a0b5211c5aece", }, } { t.Run(tc.name, func(t *testing.T) { diff --git a/enrichments/logs/internal/mobile/testdata/swift/curated-thread-0-crash.txt b/enrichments/logs/internal/mobile/testdata/swift/curated-thread-0-crash.txt index c741f12..51d1b4f 100644 --- a/enrichments/logs/internal/mobile/testdata/swift/curated-thread-0-crash.txt +++ b/enrichments/logs/internal/mobile/testdata/swift/curated-thread-0-crash.txt @@ -1 +1 @@ -Thread0Crashed:0libswiftCore.dylib0x0000000195712d2c0x1956e8000+1754041opbeans-swift.debug.dylib0x0000000104d46e7c0x104d20000+1593562SwiftUICore0x00000001d43501380x1d42a0000+7212083SwiftUICore0x00000001d45017100x1d42a0000+24962724SwiftUICore0x00000001d435953c0x1d42a0000+7591005SwiftUICore0x00000001d435953c0x1d42a0000+7591006SwiftUI0x00000001d3443c380x1d30fe000+34314807SwiftUI0x00000001d36e38800x1d30fe000+61830408SwiftUICore0x00000001d43501380x1d42a0000+7212089SwiftUICore0x00000001d466e0280x1d42a0000+398954410SwiftUICore0x00000001d466d6200x1d42a0000+398697611SwiftUI0x00000001d3ad5ac80x1d30fe000+1032058412SwiftUI0x00000001d3ad5b400x1d30fe000+1032070413UIKitCore0x00000001856f33940x184d72000+996648414UIKitCore0x00000001856fab0c0x184d72000+999706815UIKitCore0x00000001856f83180x184d72000+998684016UIKitCore0x00000001856f807c0x184d72000+998617217UIKitCore0x00000001856ed9300x184d72000+994334418UIKitCore0x00000001856ecc2c0x184d72000+994001219UIKitCore0x00000001856ec9780x184d72000+993932020UIKitCore0x0000000185c0921c0x184d72000+1529910021UIKitCore0x0000000185be8bfc0x184d72000+1516646022UIKitCore0x0000000185c731bc0x184d72000+1573318023UIKitCore0x0000000185c75e600x184d72000+1574460824UIKitCore0x0000000185c6e4740x184d72000+1571339625UIKitCore0x0000000185133f040x184d72000+394010026UIKitCore0x0000000185afd9b80x184d72000+1420332027UIKitCore0x0000000185afcdd40x184d72000+1420027628CoreFoundation0x00000001804284b80x180395000+60332029CoreFoundation0x00000001804284000x180395000+60313630CoreFoundation0x0000000180427b880x180395000+60096831CoreFoundation0x00000001804225840x180395000+57894832CoreFoundation0x0000000180421e3c0x180395000+57708433GraphicsServices0x0000000190f62d000x190f60000+1152034UIKitCore0x0000000185bcec980x184d72000+1506012035UIKitCore0x0000000185bd30640x184d72000+1507747636SwiftUI0x00000001d3953aa80x1d30fe000+873949637SwiftUI0x00000001d39537d00x1d30fe000+873876838SwiftUI0x00000001d36e09e00x1d30fe000+617110439opbeans-swift.debug.dylib0x0000000104d4b9340x104d20000+17848440opbeans-swift.debug.dylib0x0000000104d4b9e00x104d20000+17865641???0x000000010227d3d80x0+042???0x000000010235ab980x0+0 \ No newline at end of file +0libswiftCore.dylib0x0000000195712d2c0x1956e8000+1754041opbeans-swift.debug.dylib0x0000000104d46e7c0x104d20000+1593562SwiftUICore0x00000001d43501380x1d42a0000+7212083SwiftUICore0x00000001d45017100x1d42a0000+24962724SwiftUICore0x00000001d435953c0x1d42a0000+7591005SwiftUICore0x00000001d435953c0x1d42a0000+7591006SwiftUI0x00000001d3443c380x1d30fe000+34314807SwiftUI0x00000001d36e38800x1d30fe000+61830408SwiftUICore0x00000001d43501380x1d42a0000+7212089SwiftUICore0x00000001d466e0280x1d42a0000+398954410SwiftUICore0x00000001d466d6200x1d42a0000+398697611SwiftUI0x00000001d3ad5ac80x1d30fe000+1032058412SwiftUI0x00000001d3ad5b400x1d30fe000+1032070413UIKitCore0x00000001856f33940x184d72000+996648414UIKitCore0x00000001856fab0c0x184d72000+999706815UIKitCore0x00000001856f83180x184d72000+998684016UIKitCore0x00000001856f807c0x184d72000+998617217UIKitCore0x00000001856ed9300x184d72000+994334418UIKitCore0x00000001856ecc2c0x184d72000+994001219UIKitCore0x00000001856ec9780x184d72000+993932020UIKitCore0x0000000185c0921c0x184d72000+1529910021UIKitCore0x0000000185be8bfc0x184d72000+1516646022UIKitCore0x0000000185c731bc0x184d72000+1573318023UIKitCore0x0000000185c75e600x184d72000+1574460824UIKitCore0x0000000185c6e4740x184d72000+1571339625UIKitCore0x0000000185133f040x184d72000+394010026UIKitCore0x0000000185afd9b80x184d72000+1420332027UIKitCore0x0000000185afcdd40x184d72000+1420027628CoreFoundation0x00000001804284b80x180395000+60332029CoreFoundation0x00000001804284000x180395000+60313630CoreFoundation0x0000000180427b880x180395000+60096831CoreFoundation0x00000001804225840x180395000+57894832CoreFoundation0x0000000180421e3c0x180395000+57708433GraphicsServices0x0000000190f62d000x190f60000+1152034UIKitCore0x0000000185bcec980x184d72000+1506012035UIKitCore0x0000000185bd30640x184d72000+1507747636SwiftUI0x00000001d3953aa80x1d30fe000+873949637SwiftUI0x00000001d39537d00x1d30fe000+873876838SwiftUI0x00000001d36e09e00x1d30fe000+617110439opbeans-swift.debug.dylib0x0000000104d4b9340x104d20000+17848440opbeans-swift.debug.dylib0x0000000104d4b9e00x104d20000+17865641???0x000000010227d3d80x0+042???0x000000010235ab980x0+0 \ No newline at end of file diff --git a/enrichments/logs/internal/mobile/testdata/swift/curated-thread-8-crash.txt b/enrichments/logs/internal/mobile/testdata/swift/curated-thread-8-crash.txt index 9f94325..86957d6 100644 --- a/enrichments/logs/internal/mobile/testdata/swift/curated-thread-8-crash.txt +++ b/enrichments/logs/internal/mobile/testdata/swift/curated-thread-8-crash.txt @@ -1 +1 @@ -Thread8Crashed:0libswiftCore.dylib0x0000000195712d2c0x1956e8000+1754041opbeans-swift.debug.dylib0x00000001070770480x107050000+1598162opbeans-swift.debug.dylib0x00000001070728140x107050000+1413323libdispatch.dylib0x000000018017c7880x18017b000+60244libdispatch.dylib0x00000001801972780x18017b000+1153205libdispatch.dylib0x00000001801b23500x18017b000+2261286libdispatch.dylib0x000000018018fc100x18017b000+850087libdispatch.dylib0x00000001801903b40x18017b000+869648libsystem_pthread.dylib0x00000001043deb900x1043dc000+111529libsystem_pthread.dylib0x00000001043dd98c0x1043dc000+6540 \ No newline at end of file +0libswiftCore.dylib0x0000000195712d2c0x1956e8000+1754041opbeans-swift.debug.dylib0x00000001070770480x107050000+1598162opbeans-swift.debug.dylib0x00000001070728140x107050000+1413323libdispatch.dylib0x000000018017c7880x18017b000+60244libdispatch.dylib0x00000001801972780x18017b000+1153205libdispatch.dylib0x00000001801b23500x18017b000+2261286libdispatch.dylib0x000000018018fc100x18017b000+850087libdispatch.dylib0x00000001801903b40x18017b000+869648libsystem_pthread.dylib0x00000001043deb900x1043dc000+111529libsystem_pthread.dylib0x00000001043dd98c0x1043dc000+6540 \ No newline at end of file From 1948e4ccd25acd6a1d25eead4be77f0aea05769c Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Thu, 19 Jun 2025 06:11:11 +0200 Subject: [PATCH 63/67] Updating swift curated stacktrace test files --- .../internal/mobile/testdata/swift/curated-thread-0-crash.txt | 2 +- .../internal/mobile/testdata/swift/curated-thread-8-crash.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/enrichments/logs/internal/mobile/testdata/swift/curated-thread-0-crash.txt b/enrichments/logs/internal/mobile/testdata/swift/curated-thread-0-crash.txt index 51d1b4f..5121a82 100644 --- a/enrichments/logs/internal/mobile/testdata/swift/curated-thread-0-crash.txt +++ b/enrichments/logs/internal/mobile/testdata/swift/curated-thread-0-crash.txt @@ -1 +1 @@ -0libswiftCore.dylib0x0000000195712d2c0x1956e8000+1754041opbeans-swift.debug.dylib0x0000000104d46e7c0x104d20000+1593562SwiftUICore0x00000001d43501380x1d42a0000+7212083SwiftUICore0x00000001d45017100x1d42a0000+24962724SwiftUICore0x00000001d435953c0x1d42a0000+7591005SwiftUICore0x00000001d435953c0x1d42a0000+7591006SwiftUI0x00000001d3443c380x1d30fe000+34314807SwiftUI0x00000001d36e38800x1d30fe000+61830408SwiftUICore0x00000001d43501380x1d42a0000+7212089SwiftUICore0x00000001d466e0280x1d42a0000+398954410SwiftUICore0x00000001d466d6200x1d42a0000+398697611SwiftUI0x00000001d3ad5ac80x1d30fe000+1032058412SwiftUI0x00000001d3ad5b400x1d30fe000+1032070413UIKitCore0x00000001856f33940x184d72000+996648414UIKitCore0x00000001856fab0c0x184d72000+999706815UIKitCore0x00000001856f83180x184d72000+998684016UIKitCore0x00000001856f807c0x184d72000+998617217UIKitCore0x00000001856ed9300x184d72000+994334418UIKitCore0x00000001856ecc2c0x184d72000+994001219UIKitCore0x00000001856ec9780x184d72000+993932020UIKitCore0x0000000185c0921c0x184d72000+1529910021UIKitCore0x0000000185be8bfc0x184d72000+1516646022UIKitCore0x0000000185c731bc0x184d72000+1573318023UIKitCore0x0000000185c75e600x184d72000+1574460824UIKitCore0x0000000185c6e4740x184d72000+1571339625UIKitCore0x0000000185133f040x184d72000+394010026UIKitCore0x0000000185afd9b80x184d72000+1420332027UIKitCore0x0000000185afcdd40x184d72000+1420027628CoreFoundation0x00000001804284b80x180395000+60332029CoreFoundation0x00000001804284000x180395000+60313630CoreFoundation0x0000000180427b880x180395000+60096831CoreFoundation0x00000001804225840x180395000+57894832CoreFoundation0x0000000180421e3c0x180395000+57708433GraphicsServices0x0000000190f62d000x190f60000+1152034UIKitCore0x0000000185bcec980x184d72000+1506012035UIKitCore0x0000000185bd30640x184d72000+1507747636SwiftUI0x00000001d3953aa80x1d30fe000+873949637SwiftUI0x00000001d39537d00x1d30fe000+873876838SwiftUI0x00000001d36e09e00x1d30fe000+617110439opbeans-swift.debug.dylib0x0000000104d4b9340x104d20000+17848440opbeans-swift.debug.dylib0x0000000104d4b9e00x104d20000+17865641???0x000000010227d3d80x0+042???0x000000010235ab980x0+0 \ No newline at end of file +0libswiftCore.dylib1754041opbeans-swift.debug.dylib1593562SwiftUICore7212083SwiftUICore24962724SwiftUICore7591005SwiftUICore7591006SwiftUI34314807SwiftUI61830408SwiftUICore7212089SwiftUICore398954410SwiftUICore398697611SwiftUI1032058412SwiftUI1032070413UIKitCore996648414UIKitCore999706815UIKitCore998684016UIKitCore998617217UIKitCore994334418UIKitCore994001219UIKitCore993932020UIKitCore1529910021UIKitCore1516646022UIKitCore1573318023UIKitCore1574460824UIKitCore1571339625UIKitCore394010026UIKitCore1420332027UIKitCore1420027628CoreFoundation60332029CoreFoundation60313630CoreFoundation60096831CoreFoundation57894832CoreFoundation57708433GraphicsServices1152034UIKitCore1506012035UIKitCore1507747636SwiftUI873949637SwiftUI873876838SwiftUI617110439opbeans-swift.debug.dylib17848440opbeans-swift.debug.dylib17865641???042???0 \ No newline at end of file diff --git a/enrichments/logs/internal/mobile/testdata/swift/curated-thread-8-crash.txt b/enrichments/logs/internal/mobile/testdata/swift/curated-thread-8-crash.txt index 86957d6..a29690f 100644 --- a/enrichments/logs/internal/mobile/testdata/swift/curated-thread-8-crash.txt +++ b/enrichments/logs/internal/mobile/testdata/swift/curated-thread-8-crash.txt @@ -1 +1 @@ -0libswiftCore.dylib0x0000000195712d2c0x1956e8000+1754041opbeans-swift.debug.dylib0x00000001070770480x107050000+1598162opbeans-swift.debug.dylib0x00000001070728140x107050000+1413323libdispatch.dylib0x000000018017c7880x18017b000+60244libdispatch.dylib0x00000001801972780x18017b000+1153205libdispatch.dylib0x00000001801b23500x18017b000+2261286libdispatch.dylib0x000000018018fc100x18017b000+850087libdispatch.dylib0x00000001801903b40x18017b000+869648libsystem_pthread.dylib0x00000001043deb900x1043dc000+111529libsystem_pthread.dylib0x00000001043dd98c0x1043dc000+6540 \ No newline at end of file +0libswiftCore.dylib1754041opbeans-swift.debug.dylib1598162opbeans-swift.debug.dylib1413323libdispatch.dylib60244libdispatch.dylib1153205libdispatch.dylib2261286libdispatch.dylib850087libdispatch.dylib869648libsystem_pthread.dylib111529libsystem_pthread.dylib6540 \ No newline at end of file From 9c63da1441b0e23fcf49e67001d1f16e5a063a3a Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Thu, 19 Jun 2025 06:35:05 +0200 Subject: [PATCH 64/67] Removing frame and image load addresses from swift stacktraces --- enrichments/logs/internal/mobile/event_test.go | 2 +- enrichments/logs/internal/mobile/groupingkey.go | 12 ++++++++++-- enrichments/logs/internal/mobile/groupingkey_test.go | 4 ++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/enrichments/logs/internal/mobile/event_test.go b/enrichments/logs/internal/mobile/event_test.go index 5ef3e25..90da99e 100644 --- a/enrichments/logs/internal/mobile/event_test.go +++ b/enrichments/logs/internal/mobile/event_test.go @@ -36,7 +36,7 @@ func TestEnrichEvents(t *testing.T) { javaStacktraceHash := "e25c4196dc720d91" swiftStacktrace := readSwiftStacktraceFile(t, "thread-8-crash.txt") - swiftStacktraceHash := "873a0b5211c5aece" + swiftStacktraceHash := "e737b0da1c8f9d5a" for _, tc := range []struct { name string diff --git a/enrichments/logs/internal/mobile/groupingkey.go b/enrichments/logs/internal/mobile/groupingkey.go index 18156b9..456fa47 100644 --- a/enrichments/logs/internal/mobile/groupingkey.go +++ b/enrichments/logs/internal/mobile/groupingkey.go @@ -30,12 +30,13 @@ var ( // Regex patterns for java stack trace processing errorOrCausePattern = regexp.MustCompile(`^((?:Caused\sby:\s[^:]+)|(?:[^\s][^:]+))(:\s.+)?$`) callSitePattern = regexp.MustCompile(`^\s+at\s.+(:\d+)\)$`) - allLinesPattern = regexp.MustCompile(`(m?).+`) // Regex patterns for swift stack trace processing swiftCrashedThreadPattern = regexp.MustCompile(`\nThread \d+ Crashed:.*\n((?:.+\n)+)\n`) + swiftCrashLinePattern = regexp.MustCompile(`^\d+\s+[^\s]+\s+([^\s]+\s[^\s]+\s+\+)\s+[^\s]+$`) // Common patterns + allLinesPattern = regexp.MustCompile(`(m?).+`) unwantedPattern = regexp.MustCompile(`\s+`) ) @@ -76,5 +77,12 @@ func findAndCurateSwiftStacktrace(stacktrace string) (string, error) { return "", errors.New("no swift crashed thread found") } - return unwantedPattern.ReplaceAllString(match[1], ""), nil + curatedLines := allLinesPattern.ReplaceAllStringFunc(match[1], func(s string) string { + if swiftCrashLinePattern.MatchString(s) { + return strings.Replace(s, swiftCrashLinePattern.FindStringSubmatch(s)[1], "", 1) + } + return s + }) + + return unwantedPattern.ReplaceAllString(curatedLines, ""), nil } diff --git a/enrichments/logs/internal/mobile/groupingkey_test.go b/enrichments/logs/internal/mobile/groupingkey_test.go index 9c74f1d..4e8748c 100644 --- a/enrichments/logs/internal/mobile/groupingkey_test.go +++ b/enrichments/logs/internal/mobile/groupingkey_test.go @@ -111,12 +111,12 @@ func TestCreateSwiftStacktraceGroupingKey(t *testing.T) { { name: "thread_0_crash", crashFile: "thread-0-crash.txt", - expectedId: "75cd46a9f1d832a8", + expectedId: "e73b3795d98d4c79", }, { name: "thread_8_crash", crashFile: "thread-8-crash.txt", - expectedId: "873a0b5211c5aece", + expectedId: "e737b0da1c8f9d5a", }, } { t.Run(tc.name, func(t *testing.T) { From edd08ab4bb5fa17876a4071f1296df03bce4ff0d Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Tue, 1 Jul 2025 11:56:12 +0200 Subject: [PATCH 65/67] Moving mobile enrichments to enricher --- enrichments/enricher.go | 6 +++-- enrichments/internal/elastic/log.go | 24 ++++++++++++++++++- .../elastic}/mobile/event.go | 0 .../elastic}/mobile/event_test.go | 0 .../elastic}/mobile/groupingkey.go | 0 .../elastic}/mobile/groupingkey_test.go | 0 .../testdata/java/curated_stacktrace1.txt | 0 .../testdata/java/curated_stacktrace2.txt | 0 .../mobile/testdata/java/stacktrace1_a.txt | 0 .../mobile/testdata/java/stacktrace1_b.txt | 0 .../mobile/testdata/java/stacktrace1_c.txt | 0 .../mobile/testdata/java/stacktrace2_a.txt | 0 .../mobile/testdata/java/stacktrace2_b.txt | 0 .../mobile/testdata/java/stacktrace2_c.txt | 0 .../testdata/swift/curated-thread-0-crash.txt | 0 .../testdata/swift/curated-thread-8-crash.txt | 0 .../mobile/testdata/swift/thread-0-crash.txt | 0 .../mobile/testdata/swift/thread-8-crash.txt | 0 enrichments/{logs => internal}/logs_test.go | 9 ++++--- .../{logs => internal}/testdata/logs.yaml | 0 20 files changed, 33 insertions(+), 6 deletions(-) rename enrichments/{logs/internal => internal/elastic}/mobile/event.go (100%) rename enrichments/{logs/internal => internal/elastic}/mobile/event_test.go (100%) rename enrichments/{logs/internal => internal/elastic}/mobile/groupingkey.go (100%) rename enrichments/{logs/internal => internal/elastic}/mobile/groupingkey_test.go (100%) rename enrichments/{logs/internal => internal/elastic}/mobile/testdata/java/curated_stacktrace1.txt (100%) rename enrichments/{logs/internal => internal/elastic}/mobile/testdata/java/curated_stacktrace2.txt (100%) rename enrichments/{logs/internal => internal/elastic}/mobile/testdata/java/stacktrace1_a.txt (100%) rename enrichments/{logs/internal => internal/elastic}/mobile/testdata/java/stacktrace1_b.txt (100%) rename enrichments/{logs/internal => internal/elastic}/mobile/testdata/java/stacktrace1_c.txt (100%) rename enrichments/{logs/internal => internal/elastic}/mobile/testdata/java/stacktrace2_a.txt (100%) rename enrichments/{logs/internal => internal/elastic}/mobile/testdata/java/stacktrace2_b.txt (100%) rename enrichments/{logs/internal => internal/elastic}/mobile/testdata/java/stacktrace2_c.txt (100%) rename enrichments/{logs/internal => internal/elastic}/mobile/testdata/swift/curated-thread-0-crash.txt (100%) rename enrichments/{logs/internal => internal/elastic}/mobile/testdata/swift/curated-thread-8-crash.txt (100%) rename enrichments/{logs/internal => internal/elastic}/mobile/testdata/swift/thread-0-crash.txt (100%) rename enrichments/{logs/internal => internal/elastic}/mobile/testdata/swift/thread-8-crash.txt (100%) rename enrichments/{logs => internal}/logs_test.go (90%) rename enrichments/{logs => internal}/testdata/logs.yaml (100%) diff --git a/enrichments/enricher.go b/enrichments/enricher.go index 2942473..6dc43b8 100644 --- a/enrichments/enricher.go +++ b/enrichments/enricher.go @@ -63,14 +63,16 @@ func (e *Enricher) EnrichLogs(pl plog.Logs) { resLogs := pl.ResourceLogs() for i := 0; i < resLogs.Len(); i++ { resLog := resLogs.At(i) - elastic.EnrichResource(resLog.Resource(), e.Config.Resource) + resource := resLog.Resource() + elastic.EnrichResource(resource, e.Config.Resource) + resourceAttrs := resource.Attributes().AsRaw() scopeLogs := resLog.ScopeLogs() for j := 0; j < scopeLogs.Len(); j++ { scopeSpan := scopeLogs.At(j) elastic.EnrichScope(scopeSpan.Scope(), e.Config) logRecords := scopeSpan.LogRecords() for k := 0; k < logRecords.Len(); k++ { - elastic.EnrichLog(logRecords.At(k), e.Config) + elastic.EnrichLog(resourceAttrs, logRecords.At(k), e.Config) } } } diff --git a/enrichments/internal/elastic/log.go b/enrichments/internal/elastic/log.go index 54f807b..5a22836 100644 --- a/enrichments/internal/elastic/log.go +++ b/enrichments/internal/elastic/log.go @@ -20,13 +20,35 @@ package elastic import ( "github.com/elastic/opentelemetry-lib/elasticattr" "github.com/elastic/opentelemetry-lib/enrichments/config" + "github.com/elastic/opentelemetry-lib/enrichments/internal/elastic/mobile" "go.opentelemetry.io/collector/pdata/plog" ) -func EnrichLog(log plog.LogRecord, cfg config.Config) { +func EnrichLog(resourceAttrs map[string]any, log plog.LogRecord, cfg config.Config) { if cfg.Log.ProcessorEvent.Enabled { if _, exists := log.Attributes().Get(elasticattr.ProcessorEvent); !exists { log.Attributes().PutStr(elasticattr.ProcessorEvent, "log") } } + eventName, ok := getEventName(log) + if ok { + ctx := mobile.EventContext{ + ResourceAttributes: resourceAttrs, + EventName: eventName, + } + mobile.EnrichLogEvent(ctx, log) + } +} + +// getEventName returns the event name from the log record. +// If the event name is not set, it returns an empty string. +func getEventName(logRecord plog.LogRecord) (string, bool) { + if logRecord.EventName() != "" { + return logRecord.EventName(), true + } + attributeValue, ok := logRecord.Attributes().Get("event.name") + if ok { + return attributeValue.AsString(), true + } + return "", false } diff --git a/enrichments/logs/internal/mobile/event.go b/enrichments/internal/elastic/mobile/event.go similarity index 100% rename from enrichments/logs/internal/mobile/event.go rename to enrichments/internal/elastic/mobile/event.go diff --git a/enrichments/logs/internal/mobile/event_test.go b/enrichments/internal/elastic/mobile/event_test.go similarity index 100% rename from enrichments/logs/internal/mobile/event_test.go rename to enrichments/internal/elastic/mobile/event_test.go diff --git a/enrichments/logs/internal/mobile/groupingkey.go b/enrichments/internal/elastic/mobile/groupingkey.go similarity index 100% rename from enrichments/logs/internal/mobile/groupingkey.go rename to enrichments/internal/elastic/mobile/groupingkey.go diff --git a/enrichments/logs/internal/mobile/groupingkey_test.go b/enrichments/internal/elastic/mobile/groupingkey_test.go similarity index 100% rename from enrichments/logs/internal/mobile/groupingkey_test.go rename to enrichments/internal/elastic/mobile/groupingkey_test.go diff --git a/enrichments/logs/internal/mobile/testdata/java/curated_stacktrace1.txt b/enrichments/internal/elastic/mobile/testdata/java/curated_stacktrace1.txt similarity index 100% rename from enrichments/logs/internal/mobile/testdata/java/curated_stacktrace1.txt rename to enrichments/internal/elastic/mobile/testdata/java/curated_stacktrace1.txt diff --git a/enrichments/logs/internal/mobile/testdata/java/curated_stacktrace2.txt b/enrichments/internal/elastic/mobile/testdata/java/curated_stacktrace2.txt similarity index 100% rename from enrichments/logs/internal/mobile/testdata/java/curated_stacktrace2.txt rename to enrichments/internal/elastic/mobile/testdata/java/curated_stacktrace2.txt diff --git a/enrichments/logs/internal/mobile/testdata/java/stacktrace1_a.txt b/enrichments/internal/elastic/mobile/testdata/java/stacktrace1_a.txt similarity index 100% rename from enrichments/logs/internal/mobile/testdata/java/stacktrace1_a.txt rename to enrichments/internal/elastic/mobile/testdata/java/stacktrace1_a.txt diff --git a/enrichments/logs/internal/mobile/testdata/java/stacktrace1_b.txt b/enrichments/internal/elastic/mobile/testdata/java/stacktrace1_b.txt similarity index 100% rename from enrichments/logs/internal/mobile/testdata/java/stacktrace1_b.txt rename to enrichments/internal/elastic/mobile/testdata/java/stacktrace1_b.txt diff --git a/enrichments/logs/internal/mobile/testdata/java/stacktrace1_c.txt b/enrichments/internal/elastic/mobile/testdata/java/stacktrace1_c.txt similarity index 100% rename from enrichments/logs/internal/mobile/testdata/java/stacktrace1_c.txt rename to enrichments/internal/elastic/mobile/testdata/java/stacktrace1_c.txt diff --git a/enrichments/logs/internal/mobile/testdata/java/stacktrace2_a.txt b/enrichments/internal/elastic/mobile/testdata/java/stacktrace2_a.txt similarity index 100% rename from enrichments/logs/internal/mobile/testdata/java/stacktrace2_a.txt rename to enrichments/internal/elastic/mobile/testdata/java/stacktrace2_a.txt diff --git a/enrichments/logs/internal/mobile/testdata/java/stacktrace2_b.txt b/enrichments/internal/elastic/mobile/testdata/java/stacktrace2_b.txt similarity index 100% rename from enrichments/logs/internal/mobile/testdata/java/stacktrace2_b.txt rename to enrichments/internal/elastic/mobile/testdata/java/stacktrace2_b.txt diff --git a/enrichments/logs/internal/mobile/testdata/java/stacktrace2_c.txt b/enrichments/internal/elastic/mobile/testdata/java/stacktrace2_c.txt similarity index 100% rename from enrichments/logs/internal/mobile/testdata/java/stacktrace2_c.txt rename to enrichments/internal/elastic/mobile/testdata/java/stacktrace2_c.txt diff --git a/enrichments/logs/internal/mobile/testdata/swift/curated-thread-0-crash.txt b/enrichments/internal/elastic/mobile/testdata/swift/curated-thread-0-crash.txt similarity index 100% rename from enrichments/logs/internal/mobile/testdata/swift/curated-thread-0-crash.txt rename to enrichments/internal/elastic/mobile/testdata/swift/curated-thread-0-crash.txt diff --git a/enrichments/logs/internal/mobile/testdata/swift/curated-thread-8-crash.txt b/enrichments/internal/elastic/mobile/testdata/swift/curated-thread-8-crash.txt similarity index 100% rename from enrichments/logs/internal/mobile/testdata/swift/curated-thread-8-crash.txt rename to enrichments/internal/elastic/mobile/testdata/swift/curated-thread-8-crash.txt diff --git a/enrichments/logs/internal/mobile/testdata/swift/thread-0-crash.txt b/enrichments/internal/elastic/mobile/testdata/swift/thread-0-crash.txt similarity index 100% rename from enrichments/logs/internal/mobile/testdata/swift/thread-0-crash.txt rename to enrichments/internal/elastic/mobile/testdata/swift/thread-0-crash.txt diff --git a/enrichments/logs/internal/mobile/testdata/swift/thread-8-crash.txt b/enrichments/internal/elastic/mobile/testdata/swift/thread-8-crash.txt similarity index 100% rename from enrichments/logs/internal/mobile/testdata/swift/thread-8-crash.txt rename to enrichments/internal/elastic/mobile/testdata/swift/thread-8-crash.txt diff --git a/enrichments/logs/logs_test.go b/enrichments/internal/logs_test.go similarity index 90% rename from enrichments/logs/logs_test.go rename to enrichments/internal/logs_test.go index 40aa104..d55e6f0 100644 --- a/enrichments/logs/logs_test.go +++ b/enrichments/internal/logs_test.go @@ -15,12 +15,14 @@ // specific language governing permissions and limitations // under the License. -package logs +package elastic import ( "path/filepath" "testing" + "github.com/elastic/opentelemetry-lib/enrichments" + "github.com/elastic/opentelemetry-lib/enrichments/config" "github.com/google/go-cmp/cmp" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden" "github.com/stretchr/testify/assert" @@ -37,14 +39,15 @@ func TestEnrichResourceLog(t *testing.T) { // This is needed because the yaml unmarshalling is not yet aware of this new field logRecords.At(2).SetEventName("field.name") - enricher := NewEnricher() - enricher.Enrich(logs) + enricher := enrichments.NewEnricher(config.Enabled()) + enricher.EnrichLogs(logs) t.Run("resource_enrichment", func(t *testing.T) { resourceAttributes := resourceLogs.Resource().Attributes() expectedResourceAttributes := map[string]any{ "service.name": "my.service", "agent.name": "android/java", + "agent.version": "unknown", "telemetry.sdk.name": "android", "telemetry.sdk.language": "java", } diff --git a/enrichments/logs/testdata/logs.yaml b/enrichments/internal/testdata/logs.yaml similarity index 100% rename from enrichments/logs/testdata/logs.yaml rename to enrichments/internal/testdata/logs.yaml From df8526d8496f925f13834e6f1f3c257a7667a41e Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Tue, 1 Jul 2025 11:57:14 +0200 Subject: [PATCH 66/67] Clean up --- enrichments/logs/logs.go | 74 ---------------------------------------- 1 file changed, 74 deletions(-) delete mode 100644 enrichments/logs/logs.go diff --git a/enrichments/logs/logs.go b/enrichments/logs/logs.go deleted file mode 100644 index daf477a..0000000 --- a/enrichments/logs/logs.go +++ /dev/null @@ -1,74 +0,0 @@ -// Licensed to Elasticsearch B.V. under one or more contributor -// license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright -// ownership. Elasticsearch B.V. licenses this file to you under -// the Apache License, Version 2.0 (the "License"); you may -// not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -package logs - -import ( - "github.com/elastic/opentelemetry-lib/enrichments/config" - "github.com/elastic/opentelemetry-lib/enrichments/internal/elastic" - "github.com/elastic/opentelemetry-lib/enrichments/logs/internal/mobile" - "go.opentelemetry.io/collector/pdata/plog" -) - -type Enricher struct { -} - -func NewEnricher() *Enricher { - return &Enricher{} -} - -func (e *Enricher) Enrich(logs plog.Logs) { - resourceLogs := logs.ResourceLogs() - resourceConfig := config.ResourceConfig{ - AgentName: config.AttributeConfig{ - Enabled: true, - }, - } - - for i := 0; i < resourceLogs.Len(); i++ { - resourceLog := resourceLogs.At(i) - logsResource := resourceLog.Resource() - elastic.EnrichResource(logsResource, resourceConfig) - resourceAttrs := logsResource.Attributes().AsRaw() - scopeLogs := resourceLog.ScopeLogs() - for j := 0; j < scopeLogs.Len(); j++ { - logRecords := scopeLogs.At(j).LogRecords() - for k := 0; k < logRecords.Len(); k++ { - logRecord := logRecords.At(k) - eventName, ok := getEventName(logRecord) - if ok { - ctx := mobile.EventContext{ - ResourceAttributes: resourceAttrs, - EventName: eventName, - } - mobile.EnrichLogEvent(ctx, logRecord) - } - } - } - } -} - -func getEventName(logRecord plog.LogRecord) (string, bool) { - if logRecord.EventName() != "" { - return logRecord.EventName(), true - } - attributeValue, ok := logRecord.Attributes().Get("event.name") - if ok { - return attributeValue.AsString(), true - } - return "", false -} From 6202e295be777c1695857830b87fa6cb80dbfb7c Mon Sep 17 00:00:00 2001 From: Cesar Munoz <56847527+LikeTheSalad@users.noreply.github.com> Date: Tue, 1 Jul 2025 17:38:03 +0200 Subject: [PATCH 67/67] Moving GetTimestampUs out of elasticattr --- elasticattr/attributes.go | 6 ------ enrichments/internal/elastic/mobile/event.go | 7 ++++++- enrichments/internal/elastic/span.go | 10 +++++++--- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/elasticattr/attributes.go b/elasticattr/attributes.go index 25445b8..58fb63a 100644 --- a/elasticattr/attributes.go +++ b/elasticattr/attributes.go @@ -17,8 +17,6 @@ package elasticattr -import "go.opentelemetry.io/collector/pdata/pcommon" - const ( // resource s AgentName = "agent.name" @@ -60,7 +58,3 @@ const ( ErrorGroupingName = "error.grouping_name" ErrorType = "error.type" ) - -func GetTimestampUs(ts pcommon.Timestamp) int64 { - return int64(ts) / 1000 -} diff --git a/enrichments/internal/elastic/mobile/event.go b/enrichments/internal/elastic/mobile/event.go index 2126be6..023445c 100644 --- a/enrichments/internal/elastic/mobile/event.go +++ b/enrichments/internal/elastic/mobile/event.go @@ -23,6 +23,7 @@ import ( "io" "github.com/elastic/opentelemetry-lib/elasticattr" + "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" ) @@ -46,7 +47,7 @@ func enrichCrashEvent(logRecord plog.LogRecord, resourceAttrs map[string]any) { timestamp = logRecord.ObservedTimestamp() } logRecord.Attributes().PutStr(elasticattr.ProcessorEvent, "error") - logRecord.Attributes().PutInt(elasticattr.TimestampUs, elasticattr.GetTimestampUs(timestamp)) + logRecord.Attributes().PutInt(elasticattr.TimestampUs, getTimestampUs(timestamp)) if id, err := newUniqueID(); err == nil { logRecord.Attributes().PutStr(elasticattr.ErrorID, id) } @@ -79,3 +80,7 @@ func newUniqueID() (string, error) { return string(buf), nil } + +func getTimestampUs(ts pcommon.Timestamp) int64 { + return int64(ts) / 1000 +} diff --git a/enrichments/internal/elastic/span.go b/enrichments/internal/elastic/span.go index 1252c70..5c677d7 100644 --- a/enrichments/internal/elastic/span.go +++ b/enrichments/internal/elastic/span.go @@ -238,7 +238,7 @@ func (s *spanEnrichmentContext) enrichTransaction( cfg config.ElasticTransactionConfig, ) { if cfg.TimestampUs.Enabled { - span.Attributes().PutInt(elasticattr.TimestampUs, elasticattr.GetTimestampUs(span.StartTimestamp())) + span.Attributes().PutInt(elasticattr.TimestampUs, getTimestampUs(span.StartTimestamp())) } if cfg.Sampled.Enabled { span.Attributes().PutBool(elasticattr.TransactionSampled, s.getSampled()) @@ -288,7 +288,7 @@ func (s *spanEnrichmentContext) enrichSpan( var spanType, spanSubtype string if cfg.TimestampUs.Enabled { - span.Attributes().PutInt(elasticattr.TimestampUs, elasticattr.GetTimestampUs(span.StartTimestamp())) + span.Attributes().PutInt(elasticattr.TimestampUs, getTimestampUs(span.StartTimestamp())) } if cfg.Name.Enabled { span.Attributes().PutStr(elasticattr.SpanName, span.Name()) @@ -604,7 +604,7 @@ func (s *spanEventEnrichmentContext) enrich( // Enrich span event attributes. if cfg.TimestampUs.Enabled { - se.Attributes().PutInt(elasticattr.TimestampUs, elasticattr.GetTimestampUs(se.Timestamp())) + se.Attributes().PutInt(elasticattr.TimestampUs, getTimestampUs(se.Timestamp())) } if cfg.ProcessorEvent.Enabled && s.exception { se.Attributes().PutStr(elasticattr.ProcessorEvent, "error") @@ -769,3 +769,7 @@ func newUniqueID() (string, error) { return string(buf), nil } + +func getTimestampUs(ts pcommon.Timestamp) int64 { + return int64(ts) / 1000 +}