Skip to content

[Metrics] Expose more parameters to before_emit_metric #2956

Closed
@cleptric

Description

@cleptric

To empower users with more flexibility in the before_emit_metric hook, we should expose all parameters of a to-be-emitted metric.

We already expose key and tags; value and unit should also be added.

def before_emit(key, value, unit, tags):
	if key == "removed-metric":
		return False
	tags["extra"] = "foo"
	del tags["release"]
	return True

sentry_sdk.init(
    ...
    _experiments={
	"before_emit_metric": before_emit,
    }
)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions