Skip to content

feat: Don't track metrics when request is made by a bot #217

Open
@Bertg

Description

Describe the feature request

It should be possible to disable metric collection at runtime, based on runtime data. This could be to ignore data collected from demo account, or feature checks triggered by bots.

Background

We monitor our website with betterstack. We are quite happy with it.
However, we have some feature flags that are validated when loading these monitored pages. This causes the metric data collected by unleash to be completely useless.

Solution suggestions

The current is_enabled?(feature, context = nil, default_value_param = false, &fallback_blk) api is starting to become hard to modify, as it is using positional arguments.

An idealised usage would look like this:

unleash_with_context = build_a_context_object # this is more ruby-ish as there is a good chance we want to re-use this in a web request (eg in rails)
# We could also explicetally set to disable the tracking on this context object, as the user agent would be unchanging and thus no need to re-evalute on each flag check
unleash_with_context.is_enabled?("flag_name", default: bool | proc(context, flag), track: bool | proc(context, flag)

Metadata

Assignees

Labels

enhancementNew feature or requestmaybe laterSomething we may choose to do at a later date but not now

Type

No type

Projects

  • Status

    Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions