ui: update dynatrace log processing

This commit is contained in:
nick-delirium 2024-11-13 13:13:11 +01:00
parent c88bd374e9
commit d5b182227d
No known key found for this signature in database
GPG key ID: 93ABD695DF5FDBA0
6 changed files with 66 additions and 9 deletions

View file

@ -21,11 +21,10 @@ export function processLog(log: any): UnifiedLog[] {
function isDynatraceLog(log: any): boolean {
return (
log &&
log[0].results &&
Array.isArray(log[0].results) &&
log[0].results.length > 0 &&
log[0].results[0].eventType === "LOG"
Array.isArray(log) &&
log[0].eventType === "LOG" &&
log[0].content &&
log[0].status
);
}
@ -42,14 +41,14 @@ function isSentryLog(log: any): boolean {
}
function processDynatraceLog(log: any): UnifiedLog {
const result = log.results[0];
const result = log;
const key =
result.additionalColumns?.["trace_id"]?.[0] ||
result.additionalColumns?.["span_id"]?.[0] ||
String(result.timestamp);
const timestamp = new Date(result.timestamp).toISOString();
const timestamp = result.timestamp;
let message = result.content || "";
let level = result.status?.toLowerCase() || "info";

View file

@ -0,0 +1,57 @@
#!/bin/sh
if [ "$LEFTHOOK_VERBOSE" = "1" -o "$LEFTHOOK_VERBOSE" = "true" ]; then
set -x
fi
if [ "$LEFTHOOK" = "0" ]; then
exit 0
fi
call_lefthook()
{
if test -n "$LEFTHOOK_BIN"
then
"$LEFTHOOK_BIN" "$@"
elif lefthook -h >/dev/null 2>&1
then
lefthook "$@"
else
dir="$(git rev-parse --show-toplevel)"
osArch=$(uname | tr '[:upper:]' '[:lower:]')
cpuArch=$(uname -m | sed 's/aarch64/arm64/;s/x86_64/x64/')
if test -f "$dir/node_modules/lefthook-${osArch}-${cpuArch}/bin/lefthook"
then
"$dir/node_modules/lefthook-${osArch}-${cpuArch}/bin/lefthook" "$@"
elif test -f "$dir/node_modules/@evilmartians/lefthook/bin/lefthook-${osArch}-${cpuArch}/lefthook"
then
"$dir/node_modules/@evilmartians/lefthook/bin/lefthook-${osArch}-${cpuArch}/lefthook" "$@"
elif test -f "$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook"
then
"$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook" "$@"
elif test -f "$dir/node_modules/lefthook/bin/index.js"
then
"$dir/node_modules/lefthook/bin/index.js" "$@"
elif bundle exec lefthook -h >/dev/null 2>&1
then
bundle exec lefthook "$@"
elif yarn lefthook -h >/dev/null 2>&1
then
yarn lefthook "$@"
elif pnpm lefthook -h >/dev/null 2>&1
then
pnpm lefthook "$@"
elif swift package plugin lefthook >/dev/null 2>&1
then
swift package --disable-sandbox plugin lefthook "$@"
elif command -v mint >/dev/null 2>&1
then
mint run csjones/lefthook-plugin "$@"
else
echo "Can't find lefthook in PATH"
fi
fi
}
call_lefthook run "prepare-commit-msg" "$@"

View file

@ -20,6 +20,7 @@ public class ORTrackerConnector: NSObject {
screen: optionsDict["screen"] as? Bool ?? true,
wifiOnly: optionsDict["wifiOnly"] as? Bool ?? true,
debugLogs: optionsDict["debugLogs"] as? Bool ?? false,
screenshotBatchSize: 20,
debugImages: false
)
Openreplay.shared.serverURL = projectUrl ?? "https://api.openreplay.com/ingest"

View file

@ -38,7 +38,7 @@ Pod::Spec.new do |s|
s.dependency "RCTRequired"
s.dependency "RCTTypeSafety"
s.dependency "ReactCommon/turbomodule/core"
s.dependency "Openreplay", '1.0.11'
s.dependency "Openreplay", '1.0.12'
end
end
end

View file

@ -1,6 +1,6 @@
{
"name": "@openreplay/react-native",
"version": "0.6.1",
"version": "0.6.2",
"description": "Openreplay React-native connector for iOS applications",
"main": "lib/commonjs/index",
"module": "lib/module/index",