mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-06-04 11:25:52 +08:00
Merge remote-tracking branch 'upstream/develop' into feat/opamp-logparing
This commit is contained in:
commit
1c867d3b4c
@ -31,11 +31,11 @@ func (r *Repo) initDB(engine string) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *Repo) GetConfigHistory(ctx context.Context, typ ElementTypeDef) ([]ConfigVersion, error) {
|
func (r *Repo) GetConfigHistory(ctx context.Context, typ ElementTypeDef, limit int) ([]ConfigVersion, error) {
|
||||||
var c []ConfigVersion
|
var c []ConfigVersion
|
||||||
err := r.db.SelectContext(ctx, &c, `SELECT
|
err := r.db.SelectContext(ctx, &c, fmt.Sprintf(`SELECT
|
||||||
id,
|
|
||||||
version,
|
version,
|
||||||
|
id,
|
||||||
element_type,
|
element_type,
|
||||||
COALESCE(created_by, -1) as created_by,
|
COALESCE(created_by, -1) as created_by,
|
||||||
created_at,
|
created_at,
|
||||||
@ -45,9 +45,14 @@ func (r *Repo) GetConfigHistory(ctx context.Context, typ ElementTypeDef) ([]Conf
|
|||||||
is_valid,
|
is_valid,
|
||||||
disabled,
|
disabled,
|
||||||
deploy_status,
|
deploy_status,
|
||||||
deploy_result
|
deploy_result,
|
||||||
|
last_hash,
|
||||||
|
last_config
|
||||||
FROM agent_config_versions AS v
|
FROM agent_config_versions AS v
|
||||||
WHERE element_type = $1`, typ)
|
WHERE element_type = $1
|
||||||
|
ORDER BY created_at desc, version desc
|
||||||
|
limit %v`, limit),
|
||||||
|
typ)
|
||||||
|
|
||||||
return c, err
|
return c, err
|
||||||
}
|
}
|
||||||
|
@ -51,8 +51,8 @@ func GetConfigVersion(ctx context.Context, elementType ElementTypeDef, version i
|
|||||||
return m.GetConfigVersion(ctx, elementType, version)
|
return m.GetConfigVersion(ctx, elementType, version)
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetConfigHistory(ctx context.Context, typ ElementTypeDef) ([]ConfigVersion, error) {
|
func GetConfigHistory(ctx context.Context, typ ElementTypeDef, limit int) ([]ConfigVersion, error) {
|
||||||
return m.GetConfigHistory(ctx, typ)
|
return m.GetConfigHistory(ctx, typ, limit)
|
||||||
}
|
}
|
||||||
|
|
||||||
// StartNewVersion launches a new config version for given set of elements
|
// StartNewVersion launches a new config version for given set of elements
|
||||||
|
Loading…
x
Reference in New Issue
Block a user