Only use features for events
This commit is contained in:
parent
93c0a168ab
commit
50c9ba43f8
|
@ -73,7 +73,7 @@ module Gitlab
|
||||||
# event_name - The name of the event (e.g. "git_push").
|
# event_name - The name of the event (e.g. "git_push").
|
||||||
# tags - A set of tags to attach to the event.
|
# tags - A set of tags to attach to the event.
|
||||||
def add_event(event_name, tags = {})
|
def add_event(event_name, tags = {})
|
||||||
self.class.transaction_metric(event_name, :counter, prefix: 'event_', tags: tags).increment(tags.merge(labels))
|
self.class.transaction_metric(event_name, :counter, prefix: 'event_', use_feature_flag: true, tags: tags).increment(tags.merge(labels))
|
||||||
@metrics << Metric.new(EVENT_SERIES, { count: 1 }, tags.merge(event: event_name), :event)
|
@metrics << Metric.new(EVENT_SERIES, { count: 1 }, tags.merge(event: event_name), :event)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -150,12 +150,12 @@ module Gitlab
|
||||||
with_feature :prometheus_metrics_transaction_allocated_memory
|
with_feature :prometheus_metrics_transaction_allocated_memory
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.transaction_metric(name, type, prefix: nil, tags: {})
|
def self.transaction_metric(name, type, prefix: nil, use_feature_flag: false, tags: {})
|
||||||
metric_name = "gitlab_transaction_#{prefix}#{name}_total".to_sym
|
metric_name = "gitlab_transaction_#{prefix}#{name}_total".to_sym
|
||||||
fetch_metric(type, metric_name) do
|
fetch_metric(type, metric_name) do
|
||||||
docstring "Transaction #{prefix}#{name} #{type}"
|
docstring "Transaction #{prefix}#{name} #{type}"
|
||||||
base_labels tags.merge(BASE_LABELS)
|
base_labels tags.merge(BASE_LABELS)
|
||||||
with_feature "prometheus_transaction_#{prefix}#{name}_total".to_sym
|
with_feature "prometheus_transaction_#{prefix}#{name}_total".to_sym if use_feature_flag
|
||||||
|
|
||||||
if type == :gauge
|
if type == :gauge
|
||||||
multiprocess_mode :livesum
|
multiprocess_mode :livesum
|
||||||
|
|
Loading…
Reference in New Issue