Skip to content

flush() doesn't clear properties #35

Open
@benkehoe

Description

@benkehoe

According the README, flush() "[f]lushes the current MetricsContext to the configured sink and resets all properties, dimensions and metric values. The namespace and default dimensions will be preserved across flushes."

However, in MetricContext.create_copy_with_context(), which is used by MetricsLogger.flush() to reset the context, copies the old properties. This means in my Lambda function, if I have conditional properties in my logging object, once I've set one in one invocation, it remains present in the context in future invocations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions