mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Prometheus: Add support for day_of_year (#72403)
add querybuilder/code editor support for day_of_year
This commit is contained in:
parent
59bed9e156
commit
831e8acf15
@ -238,6 +238,13 @@ export const FUNCTIONS = [
|
||||
documentation:
|
||||
'Returns the day of the week for each of the given times in UTC. Returned values are from 0 to 6, where 0 means Sunday etc.',
|
||||
},
|
||||
{
|
||||
insertText: 'day_of_year',
|
||||
label: 'day_of_year',
|
||||
detail: 'day_of_year(v=vector(time()) instant-vector)',
|
||||
documentation:
|
||||
'Returns the day of the year for each of the given times in UTC. Returned values are from 1 to 365 for non-leap years, and 1 to 366 in leap years.',
|
||||
},
|
||||
{
|
||||
insertText: 'days_in_month',
|
||||
label: 'days_in_month',
|
||||
|
@ -164,6 +164,10 @@ export function getOperationDefinitions(): QueryBuilderOperationDef[] {
|
||||
id: PromOperationId.DayOfWeek,
|
||||
category: PromVisualQueryOperationCategory.Time,
|
||||
}),
|
||||
createFunction({
|
||||
id: PromOperationId.DayOfYear,
|
||||
category: PromVisualQueryOperationCategory.Time,
|
||||
}),
|
||||
createFunction({
|
||||
id: PromOperationId.DaysInMonth,
|
||||
category: PromVisualQueryOperationCategory.Time,
|
||||
|
@ -53,6 +53,7 @@ export enum PromOperationId {
|
||||
CountValues = 'count_values',
|
||||
DayOfMonth = 'day_of_month',
|
||||
DayOfWeek = 'day_of_week',
|
||||
DayOfYear = 'day_of_year',
|
||||
DaysInMonth = 'days_in_month',
|
||||
Deg = 'deg',
|
||||
Delta = 'delta',
|
||||
|
Loading…
Reference in New Issue
Block a user