Documentation ¶
Index ¶
- Constants
- Variables
- func EnhanceStackTrace(ctx context.Context, input []*publicModel.StackFrameInput, projectId int, ...) ([]*privateModel.ErrorTrace, error)
- func FormatStructureStackTrace(ctx context.Context, stackTrace string, opts ...StructureStackTraceOption) string
- func StructureOTELStackTrace(stackTrace string, opts ...StructureStackTraceOption) ([]*publicModel.ErrorTrace, error)
- type DiskFetcher
- type Language
- type NetworkFetcher
- type StructureStackTraceConfig
- type StructureStackTraceOption
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
Click to show internal directories.
Click to hide internal directories.