Commit 8e05f967 authored by Ryan Cobb's avatar Ryan Cobb Committed by Adam Hegyi

Add dashboard_path to PrometheusMetric

Adds dashboard_path to PrometheusMetric to support importing custom
metrics
parent b9da26c8
---
title: Add dashboard_path to PrometheusMetric
merge_request: 38237
author:
type: added
# frozen_string_literal: true
class AddDashboardPathToPrometheusMetrics < ActiveRecord::Migration[6.0]
DOWNTIME = false
def up
# Text limit is added in 20200730210506_add_text_limit_to_dashboard_path
add_column :prometheus_metrics, :dashboard_path, :text # rubocop:disable Migration/AddLimitToTextColumns
end
def down
remove_column :prometheus_metrics, :dashboard_path
end
end
# frozen_string_literal: true
class AddTextLimitToDashboardPath < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
add_text_limit(:prometheus_metrics, :dashboard_path, 2048)
end
def down
remove_text_limit(:prometheus_metrics, :dashboard_path)
end
end
5f841d2032b55f01e944c50070a6bb102883c2e4da7ba155fdcf2e90f3b68707
\ No newline at end of file
85eb0a510cdb4b315aef1665f05ad3b93d5d39f4ddfe11ed5ddde63aa732f874
\ No newline at end of file
...@@ -14657,7 +14657,9 @@ CREATE TABLE public.prometheus_metrics ( ...@@ -14657,7 +14657,9 @@ CREATE TABLE public.prometheus_metrics (
created_at timestamp with time zone NOT NULL, created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL,
common boolean DEFAULT false NOT NULL, common boolean DEFAULT false NOT NULL,
identifier character varying identifier character varying,
dashboard_path text,
CONSTRAINT check_0ad9f01463 CHECK ((char_length(dashboard_path) <= 2048))
); );
CREATE SEQUENCE public.prometheus_metrics_id_seq CREATE SEQUENCE public.prometheus_metrics_id_seq
......
...@@ -659,6 +659,7 @@ PrometheusMetric: ...@@ -659,6 +659,7 @@ PrometheusMetric:
- group - group
- common - common
- identifier - identifier
- dashboard_path
PrometheusAlert: PrometheusAlert:
- threshold - threshold
- operator - operator
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment