mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	Fixed lint warnings in Grafana raised by Mixtool (#22486)
This PR introduces a few minor changes to the gitea-monitoring-mixin, specifically linting issues raised by [Mixtool](https://github.com/monitoring-mixins/mixtool): - Query selectors using `job` and `instance` have been update to allow multi-select - Added missing attributes to `job` and `instance` template As this change is very minor I haven't created an issue, but please let me know if you'd like me to do so. According to the guidelines, it seemed to only be for larger designs :)
This commit is contained in:
		@@ -29,7 +29,7 @@ local addIssueLabelsOverrides(labels) =
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  grafanaDashboards+:: {
 | 
					  grafanaDashboards+:: {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    local giteaSelector = 'job="$job", instance="$instance"',
 | 
					    local giteaSelector = 'job=~"$job", instance=~"$instance"',
 | 
				
			||||||
    local giteaStatsPanel =
 | 
					    local giteaStatsPanel =
 | 
				
			||||||
      grafana.statPanel.new(
 | 
					      grafana.statPanel.new(
 | 
				
			||||||
        'Gitea stats',
 | 
					        'Gitea stats',
 | 
				
			||||||
@@ -399,25 +399,31 @@ local addIssueLabelsOverrides(labels) =
 | 
				
			|||||||
      .addTemplate(
 | 
					      .addTemplate(
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
          hide: 0,
 | 
					          hide: 0,
 | 
				
			||||||
          label: null,
 | 
					          label: 'job',
 | 
				
			||||||
          name: 'job',
 | 
					          name: 'job',
 | 
				
			||||||
          options: [],
 | 
					          options: [],
 | 
				
			||||||
 | 
					          datasource: '$datasource',
 | 
				
			||||||
          query: 'label_values(gitea_organizations, job)',
 | 
					          query: 'label_values(gitea_organizations, job)',
 | 
				
			||||||
          refresh: 1,
 | 
					          refresh: 1,
 | 
				
			||||||
          regex: '',
 | 
					          regex: '',
 | 
				
			||||||
          type: 'query',
 | 
					          type: 'query',
 | 
				
			||||||
 | 
					          multi: true,
 | 
				
			||||||
 | 
					          allValue: '.+'
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
      )
 | 
					      )
 | 
				
			||||||
      .addTemplate(
 | 
					      .addTemplate(
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
          hide: 0,
 | 
					          hide: 0,
 | 
				
			||||||
          label: null,
 | 
					          label: 'instance',
 | 
				
			||||||
          name: 'instance',
 | 
					          name: 'instance',
 | 
				
			||||||
          options: [],
 | 
					          options: [],
 | 
				
			||||||
 | 
					          datasource: '$datasource',
 | 
				
			||||||
          query: 'label_values(gitea_organizations{job="$job"}, instance)',
 | 
					          query: 'label_values(gitea_organizations{job="$job"}, instance)',
 | 
				
			||||||
          refresh: 1,
 | 
					          refresh: 1,
 | 
				
			||||||
          regex: '',
 | 
					          regex: '',
 | 
				
			||||||
          type: 'query',
 | 
					          type: 'query',
 | 
				
			||||||
 | 
					          multi: true,
 | 
				
			||||||
 | 
					          allValue: '.+'
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
      )
 | 
					      )
 | 
				
			||||||
      .addTemplate(
 | 
					      .addTemplate(
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user