stacktraces

package
v0.0.0-...-4ba1516 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const ERROR_CONTEXT_LINES = 5
View Source
const ERROR_CONTEXT_MAX_LENGTH = 1000
View Source
const ERROR_STACK_MAX_FIELD_SIZE = 1000
View Source
const ERROR_STACK_MAX_FRAME_COUNT = 64
View Source
const SOURCE_MAP_MAX_FILE_SIZE = 128e6

Variables

View Source
var NextNodeServerlessRegex = regexp.MustCompile(`/var/task(/.*)?/(\.next|node_modules)/(.+)`)
View Source
var OSSSourceMapper = map[string]string{
	"@commerce-apps/core": "https://raw.githubusercontent.com/SalesforceCommerceCloud/commerce-sdk-core/refs/heads/main",
}

Functions

func EnhanceStackTrace

func EnhanceStackTrace(ctx context.Context, input []*publicModel.StackFrameInput, projectId int, version *string, storageClient storage.Client) ([]*privateModel.ErrorTrace, error)

* EnhanceStackTrace makes no DB changes * It loops through the stack trace, for each : * fetches the sourcemap from remote * maps the error info into slice

func FormatStructureStackTrace

func FormatStructureStackTrace(ctx context.Context, stackTrace string, opts ...StructureStackTraceOption) string

func StructureOTELStackTrace

func StructureOTELStackTrace(stackTrace string, opts ...StructureStackTraceOption) ([]*publicModel.ErrorTrace, error)

StructureOTELStackTrace processes a backend opentelemetry stacktrace into a structured ErrorTraces. The operation returns the deepest frame first (reversing the order of the incoming stacktrace).

Types

type DiskFetcher

type DiskFetcher struct{}

type Language

type Language string
const DotNET Language = "dotnet"
const Golang Language = "golang"
const Javascript Language = "js"
const JavascriptOTeL Language = "js-otel"
const Python Language = "python"
const Ruby Language = "ruby"

type NetworkFetcher

type NetworkFetcher struct {
	// contains filtered or unexported fields
}

type StructureStackTraceConfig

type StructureStackTraceConfig struct {
	FromOTeL bool
}

type StructureStackTraceOption

type StructureStackTraceOption func(cfg *StructureStackTraceConfig)

func FromOTeL

func FromOTeL() StructureStackTraceOption

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL