source_file
comment "// Copyright The Prometheus Authors"
comment "// Licensed under the Apache License, Version 2.0 (the \"Lice"...
comment "// you may not use this file except in compliance with the L"...
comment "// You may obtain a copy of the License at"
comment "//"
comment "// http://www.apache.org/licenses/LICENSE-2.0"
comment "//"
comment "// Unless required by applicable law or agreed to in writing"...
comment "// distributed under the License is distributed on an \"AS IS"...
comment "// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either expr"...
comment "// See the License for the specific language governing permi"...
comment "// limitations under the License."
package_clause
package "package"
package_identifier "main"
import_declaration (+224 nodes collapsed)
var_declaration
var "var"
var_spec_list
( "("
var_spec
identifier "promqlEnableDelayedNameRemoval"
= "="
expression_list
false "false"
var_spec
identifier "promtoolParserOpts"
qualified_type
package_identifier "parser"
. "."
type_identifier "Options"
) ")"
function_declaration (+24 nodes collapsed)
const_declaration (+68 nodes collapsed)
var_declaration (+54 nodes collapsed)
const_declaration
const "const"
const_spec
identifier "httpConfigFileDescription"
= "="
expression_list
interpreted_string_literal
" "\""
interpreted_string_literal_content "HTTP client configuration file, see details at https://prome"...
" "\""
function_declaration (+6852 nodes collapsed)
function_declaration (+50 nodes collapsed)
var_declaration
var "var"
var_spec
identifier "errLint"
= "="
expression_list
call_expression
selector_expression
identifier "errors"
. "."
field_identifier "New"
argument_list
( "("
interpreted_string_literal
" "\""
interpreted_string_literal_content "lint error"
" "\""
) ")"
type_declaration (+27 nodes collapsed)
function_declaration (+163 nodes collapsed)
method_declaration (+30 nodes collapsed)
type_declaration
type "type"
type_spec
type_identifier "configLintConfig"
struct_type
struct "struct"
field_declaration_list
{ "{"
field_declaration
type_identifier "rulesLintConfig"
field_declaration
field_identifier "lookbackDelta"
qualified_type
package_identifier "model"
. "."
type_identifier "Duration"
} "}"
function_declaration (+234 nodes collapsed)
comment "// CheckServerStatus - healthy & ready."
function_declaration
func "func"
identifier "CheckServerStatus"
parameter_list (+22 nodes collapsed)
type_identifier "error"
block
{ "{"
statement_list
if_statement (+27 nodes collapsed)
short_var_declaration (+37 nodes collapsed)
comment "// Create new client."
short_var_declaration
expression_list
identifier "c"
, ","
identifier "err"
:= ":="
expression_list
call_expression
selector_expression
identifier "api"
. "."
field_identifier "NewClient"
argument_list
( "("
identifier "config"
) ")"
if_statement (+34 nodes collapsed)
short_var_declaration
expression_list
identifier "request"
, ","
identifier "err"
:= ":="
expression_list
call_expression
selector_expression
identifier "http"
. "."
field_identifier "NewRequest"
argument_list
( "("
selector_expression
identifier "http"
. "."
field_identifier "MethodGet"
, ","
selector_expression
identifier "config"
. "."
field_identifier "Address"
, ","
nil "nil"
) ")"
if_statement
if "if"
binary_expression
identifier "err"
!= "!="
nil "nil"
block
{ "{"
statement_list
return_statement
return "return"
expression_list
identifier "err"
} "}"
short_var_declaration (+31 nodes collapsed)
defer_statement
defer "defer"
call_expression
identifier "cancel"
argument_list
( "("
) ")"
short_var_declaration
expression_list
identifier "response"
, ","
identifier "dataBytes"
, ","
identifier "err"
:= ":="
expression_list
call_expression
selector_expression
identifier "c"
. "."
field_identifier "Do"
argument_list
( "("
identifier "ctx"
, ","
identifier "request"
) ")"
if_statement
if "if"
binary_expression
identifier "err"
!= "!="
nil "nil"
block
{ "{"
statement_list
return_statement
return "return"
expression_list
identifier "err"
} "}"
if_statement (+38 nodes collapsed)
expression_statement (+25 nodes collapsed)
return_statement
return "return"
expression_list
nil "nil"
} "}"
comment "// CheckConfig validates configuration files."
function_declaration (+289 nodes collapsed)
comment "// CheckWebConfig validates web configuration files."
function_declaration (+125 nodes collapsed)
function_declaration (+51 nodes collapsed)
function_declaration (+1160 nodes collapsed)
function_declaration (+234 nodes collapsed)
function_declaration (+309 nodes collapsed)
comment "// CheckRules validates rule files."
function_declaration (+125 nodes collapsed)
comment "// checkRulesFromStdin validates rule from stdin."
function_declaration (+397 nodes collapsed)
comment "// checkRules validates rule files."
function_declaration (+361 nodes collapsed)
function_declaration (+297 nodes collapsed)
function_declaration (+102 nodes collapsed)
type_declaration
type "type"
type_spec
type_identifier "compareRuleType"
struct_type
struct "struct"
field_declaration_list
{ "{"
field_declaration
field_identifier "metric"
type_identifier "string"
field_declaration
field_identifier "label"
qualified_type
package_identifier "labels"
. "."
type_identifier "Labels"
} "}"
type_declaration
type "type"
type_spec
type_identifier "compareRuleTypes"
slice_type
[ "["
] "]"
type_identifier "compareRuleType"
method_declaration (+26 nodes collapsed)
method_declaration (+47 nodes collapsed)
method_declaration (+44 nodes collapsed)
function_declaration (+73 nodes collapsed)
function_declaration (+278 nodes collapsed)
function_declaration (+46 nodes collapsed)
var_declaration
var "var"
var_spec
identifier "checkMetricsUsage"
= "="
expression_list
call_expression
selector_expression
identifier "strings"
. "."
field_identifier "TrimSpace"
argument_list
( "("
raw_string_literal
` "`"
raw_string_literal_content "\nPass Prometheus metrics over stdin to lint them for consist"...
` "`"
) ")"
comment "// CheckMetrics performs a linting pass on input metrics."
function_declaration (+476 nodes collapsed)
type_declaration
type "type"
type_spec
type_identifier "metricStat"
struct_type
struct "struct"
field_declaration_list
{ "{"
field_declaration
field_identifier "name"
type_identifier "string"
field_declaration
field_identifier "cardinality"
type_identifier "int"
field_declaration
field_identifier "percentage"
type_identifier "float64"
} "}"
function_declaration (+464 nodes collapsed)
type_declaration (+41 nodes collapsed)
var_declaration (+349 nodes collapsed)
function_declaration (+92 nodes collapsed)
function_declaration (+92 nodes collapsed)
function_declaration (+92 nodes collapsed)
type_declaration (+44 nodes collapsed)
type_declaration
type "type"
type_spec
type_identifier "promqlPrinter"
struct_type
struct "struct"
field_declaration_list
{ "{"
} "}"
method_declaration (+33 nodes collapsed)
method_declaration (+50 nodes collapsed)
method_declaration (+47 nodes collapsed)
type_declaration
type "type"
type_spec
type_identifier "jsonPrinter"
struct_type
struct "struct"
field_declaration_list
{ "{"
} "}"
method_declaration (+45 nodes collapsed)
method_declaration (+48 nodes collapsed)
method_declaration (+45 nodes collapsed)
comment "// importRules backfills recording rules from the files prov"...
comment "// at the outputDir location."
function_declaration (+515 nodes collapsed)
function_declaration (+84 nodes collapsed)
function_declaration (+142 nodes collapsed)
function_declaration (+73 nodes collapsed)
function_declaration (+443 nodes collapsed)
function_declaration (+209 nodes collapsed)