Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Metrics] Expose more parameters to before_emit_metric #2956

Closed
cleptric opened this issue Apr 9, 2024 · 0 comments · Fixed by #2958
Closed

[Metrics] Expose more parameters to before_emit_metric #2956

cleptric opened this issue Apr 9, 2024 · 0 comments · Fixed by #2958
Assignees

Comments

@cleptric
Copy link
Member

cleptric commented Apr 9, 2024

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,
    }
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants