Skip to content

Feature request: main implementation, randomization, middy middleware, correlation ID's, optional: object merging #139

Closed
@saragerion

Description

@saragerion

Description of the feature request

Problem statement

There are some areas that should be revisited or implemented.

Summary of the feature

  1. We should update the implementation of randomisation of sampling - currently implemented like this:
  private setLogsSampled(): void {
    const sampleRateValue = this.getSampleRateValue();
    // TODO: revisit Math.random() as it's not a real randomization
    this.logsSampled = sampleRateValue !== undefined && (sampleRateValue === 1 || Math.random() < sampleRateValue);
  }

Not optimal.

  1. Implementation of middy-compatible middleware logic to match the one of the decorator which is already existing.

  2. Correlation ID's propagation - see Feature request: correlation ID's propagation #129

  3. Optional: replace lodash library with in-house custom code

Code examples

Benefits for you and the wider AWS community

Describe alternatives you've considered

Additional context

Related issues, RFCs

#129

Metadata

Metadata

Assignees

Labels

completedThis item is complete and has been merged/shippedfeature-requestThis item refers to a feature request for an existing or new utilityloggerThis item relates to the Logger Utility

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions