├── .circleci └── config.yml ├── .dockerignore ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.yml │ ├── config.yml │ └── feature_request.yml ├── PULL_REQUEST_TEMPLATE.md ├── dependabot.yml └── workflows │ ├── automerge-dependabot.yml │ ├── backport.yml │ ├── golangci-lint.yml │ ├── lock.yml │ ├── stale.yml │ └── test.yml ├── .gitignore ├── .gitpod.Dockerfile ├── .gitpod.yml ├── .golangci.yml ├── .promu.yml ├── .yamllint.yml ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── Dockerfile ├── LICENSE ├── MAINTAINERS.md ├── Makefile ├── Makefile.common ├── NOTICE ├── README.md ├── RELEASE.md ├── SECURITY-INSIGHTS.yml ├── SECURITY.md ├── VERSION ├── cmd ├── compact │ └── main.go ├── prometheus │ ├── main.go │ ├── main_test.go │ ├── main_unix_test.go │ ├── query_log_test.go │ ├── reload_test.go │ ├── scrape_failure_log_test.go │ └── testdata │ │ ├── consoles │ │ └── test.html │ │ └── rules │ │ └── test.yml └── promtool │ ├── analyze.go │ ├── analyze_test.go │ ├── archive.go │ ├── backfill.go │ ├── backfill_test.go │ ├── debug.go │ ├── main.go │ ├── main_test.go │ ├── metrics.go │ ├── query.go │ ├── rules.go │ ├── rules_test.go │ ├── sd.go │ ├── sd_test.go │ ├── testdata │ ├── at-modifier-test.yml │ ├── at-modifier.yml │ ├── authorization_credentials_file.bad.yml │ ├── authorization_credentials_file.good.yml │ ├── bad-input-series.yml │ ├── bad-promql.yml │ ├── bad-rules-error-test.yml │ ├── bad-rules-error.yml │ ├── bad-rules-syntax-test.yml │ ├── bad-rules-syntax.yml │ ├── bad-sd-file-extension.nonexistent │ ├── bad-sd-file-format.yml │ ├── config_with_rule_files.yml │ ├── config_with_service_discovery_files.yml │ ├── config_with_tls_files.yml │ ├── dump-openmetrics-roundtrip-test.prom │ ├── dump-openmetrics-test.prom │ ├── dump-test-1.prom │ ├── dump-test-2.prom │ ├── dump-test-3.prom │ ├── failing.yml │ ├── features.yml │ ├── good-sd-file.json │ ├── good-sd-file.yaml │ ├── good-sd-file.yml │ ├── long-period.yml │ ├── metrics-test.prom │ ├── negative-offset-test.yml │ ├── negative-offset.yml │ ├── no-test-group-interval.yml │ ├── prometheus-config.bad.yml │ ├── prometheus-config.good.yml │ ├── prometheus-config.lint.too_long_scrape_interval.yml │ ├── prometheus-config.lint.yml │ ├── prometheus-rules.lint.yml │ ├── rules-bad.yml │ ├── rules.yml │ ├── rules_duplicates.yml │ ├── rules_extrafields.yml │ ├── rules_large.yml │ ├── rules_run.yml │ ├── rules_run_extrafields.yml │ ├── rules_run_fuzzy.yml │ ├── rules_run_no_fuzzy.yml │ ├── unittest.yml │ ├── url_in_alert_targetgroup_with_relabel_config.bad.yml │ ├── url_in_alert_targetgroup_with_relabel_config.good.yml │ ├── url_in_scrape_targetgroup_with_relabel_config.bad.yml │ └── url_in_scrape_targetgroup_with_relabel_config.good.yml │ ├── tsdb.go │ ├── tsdb_posix_test.go │ ├── tsdb_test.go │ ├── unittest.go │ └── unittest_test.go ├── config ├── config.go ├── config_default_test.go ├── config_test.go ├── config_windows_test.go ├── reload.go ├── reload_test.go └── testdata │ ├── agent_mode.good.yml │ ├── agent_mode.with_alert_manager.yml │ ├── agent_mode.with_alert_relabels.yml │ ├── agent_mode.with_remote_reads.yml │ ├── agent_mode.with_rule_files.yml │ ├── agent_mode.without_remote_writes.yml │ ├── azure_authentication_method.bad.yml │ ├── azure_bearertoken_basicauth.bad.yml │ ├── azure_client_id_missing.bad.yml │ ├── azure_client_secret_missing.bad.yml │ ├── azure_subscription_id_missing.bad.yml │ ├── azure_tenant_id_missing.bad.yml │ ├── bearertoken.bad.yml │ ├── bearertoken_basicauth.bad.yml │ ├── conf.good.yml │ ├── config_with_deprecated_am_api_config.yml │ ├── dropequal.bad.yml │ ├── dropequal1.bad.yml │ ├── ec2_filters_empty_values.bad.yml │ ├── ec2_token_file.bad.yml │ ├── empty_alert_relabel_config.bad.yml │ ├── empty_alertmanager_relabel_config.bad.yml │ ├── empty_metric_relabel_config.bad.yml │ ├── empty_rr_config.bad.yml │ ├── empty_rw_config.bad.yml │ ├── empty_rw_relabel_config.bad.yml │ ├── empty_scrape_config.bad.yml │ ├── empty_scrape_config_action.bad.yml │ ├── empty_static_config.bad.yml │ ├── empty_target_relabel_config.bad.yml │ ├── eureka_invalid_server.bad.yml │ ├── eureka_no_server.bad.yml │ ├── external_labels.good.yml │ ├── first.rules │ ├── global_convert_classic_hist_to_nhcb.good.yml │ ├── global_disable_always_scrape_classic_hist.good.yml │ ├── global_enable_always_scrape_classic_hist.good.yml │ ├── global_timeout.good.yml │ ├── hetzner_role.bad.yml │ ├── http_token_file.bad.yml │ ├── http_url_bad_scheme.bad.yml │ ├── http_url_no_host.bad.yml │ ├── http_url_no_scheme.bad.yml │ ├── ionos_datacenter.bad.yml │ ├── jobname.bad.yml │ ├── jobname_dup.bad.yml │ ├── keepequal.bad.yml │ ├── keepequal1.bad.yml │ ├── kubernetes_api_server_with_own_namespace.bad.yml │ ├── kubernetes_authorization_basicauth.bad.yml │ ├── kubernetes_bearertoken.bad.yml │ ├── kubernetes_bearertoken_basicauth.bad.yml │ ├── kubernetes_empty_apiserver.good.yml │ ├── kubernetes_http_config_without_api_server.bad.yml │ ├── kubernetes_kubeconfig_with_apiserver.bad.yml │ ├── kubernetes_kubeconfig_with_http_config.bad.yml │ ├── kubernetes_kubeconfig_with_own_namespace.bad.yml │ ├── kubernetes_kubeconfig_without_apiserver.good.yml │ ├── kubernetes_namespace_discovery.bad.yml │ ├── kubernetes_role.bad.yml │ ├── kubernetes_selectors_duplicated_role.bad.yml │ ├── kubernetes_selectors_endpoints.bad.yml │ ├── kubernetes_selectors_endpoints.good.yml │ ├── kubernetes_selectors_incorrect_selector.bad.yml │ ├── kubernetes_selectors_ingress.bad.yml │ ├── kubernetes_selectors_ingress.good.yml │ ├── kubernetes_selectors_node.bad.yml │ ├── kubernetes_selectors_node.good.yml │ ├── kubernetes_selectors_pod.bad.yml │ ├── kubernetes_selectors_pod.good.yml │ ├── kubernetes_selectors_service.bad.yml │ ├── kubernetes_selectors_service.good.yml │ ├── labeldrop.bad.yml │ ├── labeldrop2.bad.yml │ ├── labeldrop3.bad.yml │ ├── labeldrop4.bad.yml │ ├── labeldrop5.bad.yml │ ├── labelkeep.bad.yml │ ├── labelkeep2.bad.yml │ ├── labelkeep3.bad.yml │ ├── labelkeep4.bad.yml │ ├── labelkeep5.bad.yml │ ├── labelmap.bad.yml │ ├── labelname.bad.yml │ ├── labelvalue.bad.yml │ ├── lightsail_token_file.bad.yml │ ├── local_convert_classic_hist_to_nhcb.good.yml │ ├── local_disable_always_scrape_classic_hist.good.yml │ ├── local_disable_convert_classic_hist_to_nhcb.good.yml │ ├── local_enable_always_scrape_classic_hist.good.yml │ ├── lowercase.bad.yml │ ├── lowercase3.bad.yml │ ├── marathon_authtoken_authorization.bad.yml │ ├── marathon_authtoken_authtokenfile.bad.yml │ ├── marathon_authtoken_basicauth.bad.yml │ ├── marathon_authtoken_bearertoken.bad.yml │ ├── marathon_no_servers.bad.yml │ ├── modulus_missing.bad.yml │ ├── openstack_availability.bad.yml │ ├── openstack_role.bad.yml │ ├── otlp_allow_keep_identifying_resource_attributes.good.yml │ ├── otlp_allow_utf8.bad.yml │ ├── otlp_allow_utf8.good.yml │ ├── otlp_allow_utf8.incompatible.yml │ ├── otlp_convert_histograms_to_nhcb.good.yml │ ├── otlp_ignore_resource_attributes_without_promote_all.bad.yml │ ├── otlp_no_translation.good.yml │ ├── otlp_no_translation.incompatible.yml │ ├── otlp_promote_all_resource_attributes.bad.yml │ ├── otlp_sanitize_default_resource_attributes.good.yml │ ├── otlp_sanitize_ignore_resource_attributes.bad.yml │ ├── otlp_sanitize_ignore_resource_attributes.good.yml │ ├── otlp_sanitize_promote_resource_attributes.bad.yml │ ├── otlp_sanitize_promote_resource_attributes.good.yml │ ├── otlp_sanitize_resource_attributes_promote_all.good.yml │ ├── ovhcloud_bad_service.bad.yml │ ├── ovhcloud_no_secret.bad.yml │ ├── puppetdb_bad_url.bad.yml │ ├── puppetdb_no_query.bad.yml │ ├── puppetdb_no_scheme.bad.yml │ ├── puppetdb_no_url.bad.yml │ ├── puppetdb_token_file.bad.yml │ ├── regex.bad.yml │ ├── remote_read_dup.bad.yml │ ├── remote_read_header.bad.yml │ ├── remote_read_url_missing.bad.yml │ ├── remote_write_authorization_header.bad.yml │ ├── remote_write_dup.bad.yml │ ├── remote_write_header.bad.yml │ ├── remote_write_retry_on_rate_limit.good.yml │ ├── remote_write_url_missing.bad.yml │ ├── remote_write_wrong_msg.bad.yml │ ├── roundtrip.good.yml │ ├── rules.bad.yml │ ├── rules_abs_path.good.yml │ ├── rules_abs_path_windows.good.yml │ ├── scaleway_no_secret.bad.yml │ ├── scaleway_role.bad.yml │ ├── scaleway_two_secrets.bad.yml │ ├── scrape_body_size_limit.bad.yml │ ├── scrape_config_default_validation_mode.yml │ ├── scrape_config_disable_compression.good.yml │ ├── scrape_config_files.bad.yml │ ├── scrape_config_files.good.yml │ ├── scrape_config_files2.good.yml │ ├── scrape_config_files_combined.good.yml │ ├── scrape_config_files_double_import.bad.yml │ ├── scrape_config_files_duplicate.bad.yml │ ├── scrape_config_files_fallback_scrape_protocol1.bad.yml │ ├── scrape_config_files_fallback_scrape_protocol2.bad.yml │ ├── scrape_config_files_glob.bad.yml │ ├── scrape_config_files_glob.good.yml │ ├── scrape_config_files_global.bad.yml │ ├── scrape_config_files_global_duplicate.bad.yml │ ├── scrape_config_files_only.good.yml │ ├── scrape_config_files_scrape_protocols.bad.yml │ ├── scrape_config_files_scrape_protocols2.bad.yml │ ├── scrape_config_global_validation_mode.yml │ ├── scrape_config_local_global_validation_mode.yml │ ├── scrape_config_local_validation_mode.yml │ ├── scrape_config_utf8_conflicting.bad.yml │ ├── scrape_configs │ ├── scrape_config_files1.good.yml │ └── scrape_config_files2.good.yml │ ├── scrape_interval.bad.yml │ ├── scrape_interval_larger.good.yml │ ├── section_key_dup.bad.yml │ ├── static_config.bad.yml │ ├── target_label_hashmod_missing.bad.yml │ ├── target_label_missing.bad.yml │ ├── tracing_invalid_authorization_header.bad.yml │ ├── tracing_invalid_compression.bad.yml │ ├── tracing_invalid_header.bad.yml │ ├── tracing_missing_endpoint.bad.yml │ ├── unknown_attr.bad.yml │ ├── unknown_global_attr.bad.yml │ ├── uppercase.bad.yml │ ├── uppercase3.bad.yml │ ├── url_in_targetgroup.bad.yml │ ├── uyuni_no_server.bad.yml │ └── uyuni_token_file.bad.yml ├── discovery ├── README.md ├── aws │ ├── ec2.go │ ├── ec2_test.go │ ├── lightsail.go │ ├── metrics_ec2.go │ └── metrics_lightsail.go ├── azure │ ├── azure.go │ ├── azure_test.go │ └── metrics.go ├── consul │ ├── consul.go │ ├── consul_test.go │ └── metrics.go ├── digitalocean │ ├── digitalocean.go │ ├── digitalocean_test.go │ ├── metrics.go │ └── mock_test.go ├── discoverer_metrics_noop.go ├── discovery.go ├── discovery_test.go ├── dns │ ├── dns.go │ ├── dns_test.go │ └── metrics.go ├── eureka │ ├── client.go │ ├── client_test.go │ ├── eureka.go │ ├── eureka_test.go │ └── metrics.go ├── file │ ├── file.go │ ├── file_test.go │ ├── fixtures │ │ ├── invalid_nil.json │ │ ├── invalid_nil.yml │ │ ├── valid.json │ │ ├── valid.yml │ │ ├── valid2.yml │ │ └── valid3.yml │ └── metrics.go ├── gce │ ├── gce.go │ └── metrics.go ├── hetzner │ ├── hcloud.go │ ├── hcloud_test.go │ ├── hetzner.go │ ├── metrics.go │ ├── mock_test.go │ ├── robot.go │ └── robot_test.go ├── http │ ├── fixtures │ │ └── http_sd.good.json │ ├── http.go │ ├── http_test.go │ └── metrics.go ├── install │ └── install.go ├── ionos │ ├── ionos.go │ ├── metrics.go │ ├── server.go │ ├── server_test.go │ └── testdata │ │ └── servers.json ├── kubernetes │ ├── endpoints.go │ ├── endpoints_test.go │ ├── endpointslice.go │ ├── endpointslice_test.go │ ├── ingress.go │ ├── ingress_test.go │ ├── kubernetes.go │ ├── kubernetes_test.go │ ├── metrics.go │ ├── node.go │ ├── node_test.go │ ├── pod.go │ ├── pod_test.go │ ├── service.go │ └── service_test.go ├── linode │ ├── linode.go │ ├── linode_test.go │ ├── metrics.go │ ├── mock_test.go │ └── testdata │ │ ├── ca-central │ │ └── v4 │ │ │ ├── account │ │ │ └── events.json │ │ │ ├── linode │ │ │ └── instances.json │ │ │ └── networking │ │ │ ├── ips.json │ │ │ └── ipv6 │ │ │ └── ranges.json │ │ ├── no_region_filter │ │ └── v4 │ │ │ ├── account │ │ │ └── events.json │ │ │ ├── linode │ │ │ └── instances.json │ │ │ └── networking │ │ │ ├── ips.json │ │ │ └── ipv6 │ │ │ └── ranges.json │ │ └── us-east │ │ └── v4 │ │ ├── account │ │ └── events.json │ │ ├── linode │ │ └── instances.json │ │ └── networking │ │ ├── ips.json │ │ └── ipv6 │ │ └── ranges.json ├── manager.go ├── manager_test.go ├── marathon │ ├── marathon.go │ ├── marathon_test.go │ └── metrics.go ├── metrics.go ├── metrics_k8s_client.go ├── metrics_refresh.go ├── moby │ ├── docker.go │ ├── docker_test.go │ ├── dockerswarm.go │ ├── metrics_docker.go │ ├── metrics_dockerswarm.go │ ├── mock_test.go │ ├── network.go │ ├── nodes.go │ ├── nodes_test.go │ ├── services.go │ ├── services_test.go │ ├── tasks.go │ ├── tasks_test.go │ └── testdata │ │ ├── dockerprom │ │ ├── _ping.json │ │ ├── containers │ │ │ └── json.json │ │ ├── headers.yml │ │ └── networks.json │ │ └── swarmprom │ │ ├── _ping.json │ │ ├── headers.yml │ │ ├── networks.json │ │ ├── nodes.json │ │ ├── services.json │ │ ├── services.json__wvKVCQ4HhD │ │ └── tasks.json ├── nomad │ ├── metrics.go │ ├── nomad.go │ └── nomad_test.go ├── openstack │ ├── hypervisor.go │ ├── hypervisor_test.go │ ├── instance.go │ ├── instance_test.go │ ├── loadbalancer.go │ ├── loadbalancer_test.go │ ├── metrics.go │ ├── mock_test.go │ └── openstack.go ├── ovhcloud │ ├── dedicated_server.go │ ├── dedicated_server_test.go │ ├── metrics.go │ ├── ovhcloud.go │ ├── ovhcloud_test.go │ ├── testdata │ │ ├── dedicated_server │ │ │ ├── dedicated_servers.json │ │ │ ├── dedicated_servers_abcde_ips.json │ │ │ └── dedicated_servers_details.json │ │ └── vps │ │ │ ├── vps.json │ │ │ ├── vps_abc_ips.json │ │ │ └── vps_details.json │ ├── vps.go │ └── vps_test.go ├── puppetdb │ ├── fixtures │ │ └── vhosts.json │ ├── metrics.go │ ├── puppetdb.go │ ├── puppetdb_test.go │ └── resources.go ├── refresh │ ├── refresh.go │ └── refresh_test.go ├── registry.go ├── scaleway │ ├── baremetal.go │ ├── instance.go │ ├── instance_test.go │ ├── metrics.go │ ├── scaleway.go │ └── testdata │ │ ├── instance.json │ │ └── secret_key ├── targetgroup │ ├── targetgroup.go │ └── targetgroup_test.go ├── triton │ ├── metrics.go │ ├── triton.go │ └── triton_test.go ├── util.go ├── uyuni │ ├── metrics.go │ ├── uyuni.go │ └── uyuni_test.go ├── vultr │ ├── metrics.go │ ├── mock_test.go │ ├── vultr.go │ └── vultr_test.go ├── xds │ ├── client.go │ ├── client_test.go │ ├── kuma.go │ ├── kuma_mads.pb.go │ ├── kuma_test.go │ ├── metrics.go │ ├── xds.go │ └── xds_test.go └── zookeeper │ ├── zookeeper.go │ └── zookeeper_test.go ├── docs ├── command-line │ ├── index.md │ ├── prometheus.md │ └── promtool.md ├── configuration │ ├── alerting_rules.md │ ├── configuration.md │ ├── https.md │ ├── index.md │ ├── recording_rules.md │ ├── template_examples.md │ ├── template_reference.md │ └── unit_testing_rules.md ├── feature_flags.md ├── federation.md ├── getting_started.md ├── http_sd.md ├── images │ └── remote_integrations.png ├── index.md ├── installation.md ├── management_api.md ├── migration.md ├── querying │ ├── api.md │ ├── basics.md │ ├── examples.md │ ├── functions.md │ ├── index.md │ ├── operators.md │ └── remote_read_api.md ├── stability.md └── storage.md ├── documentation ├── examples │ ├── Makefile │ ├── custom-sd │ │ ├── README.md │ │ ├── adapter-usage │ │ │ └── main.go │ │ └── adapter │ │ │ ├── adapter.go │ │ │ └── adapter_test.go │ ├── kubernetes-rabbitmq │ │ ├── README.md │ │ ├── rc.yml │ │ └── svc.yml │ ├── prometheus-agent.yml │ ├── prometheus-digitalocean.yml │ ├── prometheus-docker.yml │ ├── prometheus-dockerswarm.yml │ ├── prometheus-eureka.yml │ ├── prometheus-hetzner.yml │ ├── prometheus-ionos.yml │ ├── prometheus-kubernetes.yml │ ├── prometheus-linode.yml │ ├── prometheus-marathon.yml │ ├── prometheus-nomad.yml │ ├── prometheus-otlp.yml │ ├── prometheus-ovhcloud.yml │ ├── prometheus-puppetdb.yml │ ├── prometheus-scaleway.yml │ ├── prometheus-uyuni.yml │ ├── prometheus-vultr.yml │ ├── prometheus.yml │ ├── rbac-setup.yml │ ├── remote_storage │ │ ├── Makefile │ │ ├── example_write_adapter │ │ │ ├── README.md │ │ │ └── server.go │ │ ├── go.mod │ │ ├── go.sum │ │ └── remote_storage_adapter │ │ │ ├── README.md │ │ │ ├── graphite │ │ │ ├── client.go │ │ │ ├── client_test.go │ │ │ └── escape.go │ │ │ ├── influxdb │ │ │ ├── client.go │ │ │ └── client_test.go │ │ │ ├── main.go │ │ │ └── opentsdb │ │ │ ├── client.go │ │ │ ├── client_test.go │ │ │ ├── tagvalue.go │ │ │ └── tagvalue_test.go │ └── web-config.yml ├── images │ ├── architecture.svg │ ├── architecture.xml │ ├── diagram_note.md │ ├── internal_architecture.svg │ ├── internal_architecture.xml │ └── prometheus-logo.svg ├── internal_architecture.md └── prometheus-mixin │ ├── .gitignore │ ├── Makefile │ ├── README.md │ ├── alerts.jsonnet │ ├── alerts.libsonnet │ ├── config.libsonnet │ ├── dashboards.jsonnet │ ├── dashboards.libsonnet │ ├── jsonnetfile.json │ └── mixin.libsonnet ├── go.mod ├── go.sum ├── internal └── tools │ ├── go.mod │ ├── go.sum │ └── tools.go ├── model ├── exemplar │ └── exemplar.go ├── histogram │ ├── float_histogram.go │ ├── float_histogram_test.go │ ├── generic.go │ ├── generic_test.go │ ├── histogram.go │ ├── histogram_test.go │ └── test_utils.go ├── labels │ ├── labels.go │ ├── labels_common.go │ ├── labels_dedupelabels.go │ ├── labels_dedupelabels_test.go │ ├── labels_stringlabels.go │ ├── labels_test.go │ ├── matcher.go │ ├── matcher_test.go │ ├── regexp.go │ ├── regexp_test.go │ ├── sharding.go │ ├── sharding_dedupelabels.go │ ├── sharding_stringlabels.go │ ├── sharding_test.go │ └── test_utils.go ├── metadata │ └── metadata.go ├── relabel │ ├── relabel.go │ └── relabel_test.go ├── rulefmt │ ├── rulefmt.go │ ├── rulefmt_test.go │ └── testdata │ │ ├── bad_expr.bad.yaml │ │ ├── bad_field.bad.yaml │ │ ├── duplicate_grp.bad.yaml │ │ ├── invalid_label_name.bad.yaml │ │ ├── invalid_record_name.bad.yaml │ │ ├── no_rec_alert.bad.yaml │ │ ├── noexpr.bad.yaml │ │ ├── record_and_alert.bad.yaml │ │ ├── record_and_for.bad.yaml │ │ ├── record_and_keep_firing_for.bad.yaml │ │ ├── test.yaml │ │ ├── test_aliases.yaml │ │ ├── utf-8_annotation.good.yaml │ │ └── utf-8_lname.good.yaml ├── textparse │ ├── README.md │ ├── benchmark_test.go │ ├── interface.go │ ├── interface_test.go │ ├── nhcbparse.go │ ├── nhcbparse_test.go │ ├── openmetricslex.l │ ├── openmetricslex.l.go │ ├── openmetricsparse.go │ ├── openmetricsparse_test.go │ ├── promlex.l │ ├── promlex.l.go │ ├── promparse.go │ ├── promparse_test.go │ ├── protobufparse.go │ ├── protobufparse_test.go │ └── testdata │ │ ├── 1histogram.om.txt │ │ ├── alltypes.237mfs.nometa.prom.txt │ │ ├── alltypes.237mfs.prom.txt │ │ └── alltypes.5mfs.om.txt ├── timestamp │ └── timestamp.go └── value │ └── value.go ├── notifier ├── alert.go ├── alertmanager.go ├── alertmanager_test.go ├── alertmanagerset.go ├── manager.go ├── manager_test.go ├── metric.go ├── util.go └── util_test.go ├── plugins.yml ├── plugins ├── generate.go ├── minimum.go └── plugins.go ├── prompb ├── README.md ├── buf.gen.yaml ├── buf.lock ├── buf.yaml ├── codec.go ├── custom.go ├── io │ └── prometheus │ │ ├── client │ │ ├── decoder.go │ │ ├── decoder_test.go │ │ ├── metrics.pb.go │ │ └── metrics.proto │ │ └── write │ │ └── v2 │ │ ├── codec.go │ │ ├── custom.go │ │ ├── custom_test.go │ │ ├── symbols.go │ │ ├── symbols_test.go │ │ ├── types.pb.go │ │ ├── types.proto │ │ └── types_test.go ├── remote.pb.go ├── remote.proto ├── rwcommon │ └── codec_test.go ├── types.pb.go └── types.proto ├── promql ├── bench_test.go ├── durations.go ├── durations_test.go ├── engine.go ├── engine_internal_test.go ├── engine_test.go ├── functions.go ├── functions_internal_test.go ├── functions_test.go ├── fuzz-data │ ├── ParseExpr │ │ └── corpus │ │ │ ├── from_tests_1 │ │ │ ├── from_tests_10 │ │ │ ├── from_tests_11 │ │ │ ├── from_tests_12 │ │ │ ├── from_tests_13 │ │ │ ├── from_tests_14 │ │ │ ├── from_tests_15 │ │ │ ├── from_tests_16 │ │ │ ├── from_tests_17 │ │ │ ├── from_tests_18 │ │ │ ├── from_tests_19 │ │ │ ├── from_tests_2 │ │ │ ├── from_tests_20 │ │ │ ├── from_tests_21 │ │ │ ├── from_tests_22 │ │ │ ├── from_tests_23 │ │ │ ├── from_tests_24 │ │ │ ├── from_tests_25 │ │ │ ├── from_tests_26 │ │ │ ├── from_tests_27 │ │ │ ├── from_tests_28 │ │ │ ├── from_tests_29 │ │ │ ├── from_tests_3 │ │ │ ├── from_tests_30 │ │ │ ├── from_tests_31 │ │ │ ├── from_tests_32 │ │ │ ├── from_tests_33 │ │ │ ├── from_tests_34 │ │ │ ├── from_tests_4 │ │ │ ├── from_tests_5 │ │ │ ├── from_tests_6 │ │ │ ├── from_tests_7 │ │ │ ├── from_tests_8 │ │ │ └── from_tests_9 │ └── ParseMetric │ │ └── corpus │ │ ├── 982cbe5ad899f03c630b1a21876a206707ea3dc9 │ │ ├── exposition_formats_0 │ │ ├── exposition_formats_1 │ │ ├── exposition_formats_2 │ │ ├── exposition_formats_3 │ │ ├── exposition_formats_4 │ │ ├── exposition_formats_5 │ │ ├── exposition_formats_6 │ │ └── exposition_formats_7 ├── fuzz.go ├── fuzz_test.go ├── histogram_stats_iterator.go ├── histogram_stats_iterator_test.go ├── info.go ├── info_test.go ├── parser │ ├── ast.go │ ├── functions.go │ ├── generated_parser.y │ ├── generated_parser.y.go │ ├── lex.go │ ├── lex_test.go │ ├── parse.go │ ├── parse_test.go │ ├── posrange │ │ └── posrange.go │ ├── prettier.go │ ├── prettier_rules.md │ ├── prettier_test.go │ ├── printer.go │ ├── printer_test.go │ └── value.go ├── promql_test.go ├── promqltest │ ├── README.md │ ├── test.go │ ├── test_test.go │ └── testdata │ │ ├── aggregators.test │ │ ├── at_modifier.test │ │ ├── collision.test │ │ ├── duration_expression.test │ │ ├── functions.test │ │ ├── histograms.test │ │ ├── limit.test │ │ ├── literals.test │ │ ├── name_label_dropping.test │ │ ├── native_histograms.test │ │ ├── operators.test │ │ ├── range_queries.test │ │ ├── selectors.test │ │ ├── staleness.test │ │ ├── subquery.test │ │ ├── trig_functions.test │ │ └── type_and_unit.test ├── quantile.go ├── quantile_test.go ├── query_logger.go ├── query_logger_test.go ├── value.go └── value_test.go ├── rules ├── alerting.go ├── alerting_test.go ├── fixtures │ ├── alert_rule.yaml │ ├── alert_rule1.yaml │ ├── invalid_rules.yaml │ ├── rules.yaml │ ├── rules1.yaml │ ├── rules2.yaml │ ├── rules2_copy.yaml │ ├── rules_chain.yaml │ ├── rules_dependencies.yaml │ ├── rules_indeterminates.yaml │ ├── rules_multiple.yaml │ ├── rules_multiple_dependents_on_base.yaml │ ├── rules_multiple_groups.yaml │ ├── rules_multiple_independent.yaml │ ├── rules_with_alignment.yaml │ └── rules_with_source_tenants.yaml ├── group.go ├── group_test.go ├── manager.go ├── manager_test.go ├── origin.go ├── origin_test.go ├── recording.go ├── recording_test.go └── rule.go ├── schema ├── labels.go └── labels_test.go ├── scrape ├── clientprotobuf.go ├── helpers_test.go ├── manager.go ├── manager_test.go ├── metrics.go ├── scrape.go ├── scrape_test.go ├── target.go ├── target_test.go └── testdata │ ├── bearertoken.txt │ ├── ca.cer │ ├── ca.key │ ├── client.cer │ ├── client.key │ ├── server.cer │ ├── server.key │ ├── servername.cer │ └── servername.key ├── scripts ├── check-go-mod-version.sh ├── compress_assets.sh ├── genproto.sh ├── get_module_version.sh ├── golangci-lint.yml ├── npm-deps.sh ├── package_assets.sh ├── sync_repo_files.sh └── ui_release.sh ├── storage ├── buffer.go ├── buffer_test.go ├── errors.go ├── errors_test.go ├── fanout.go ├── fanout_test.go ├── generic.go ├── interface.go ├── interface_test.go ├── labelvalues.go ├── labelvalues_test.go ├── lazy.go ├── memoized_iterator.go ├── memoized_iterator_test.go ├── merge.go ├── merge_test.go ├── noop.go ├── remote │ ├── azuread │ │ ├── README.md │ │ ├── azuread.go │ │ ├── azuread_test.go │ │ └── testdata │ │ │ ├── azuread_bad_configmissing.yaml │ │ │ ├── azuread_bad_invalidclientid.yaml │ │ │ ├── azuread_bad_invalidoauthconfig.yaml │ │ │ ├── azuread_bad_oauthsdkconfig.yaml │ │ │ ├── azuread_bad_twoconfig.yaml │ │ │ ├── azuread_good_cloudmissing.yaml │ │ │ ├── azuread_good_defaultmanagedidentity.yaml │ │ │ ├── azuread_good_oauth.yaml │ │ │ ├── azuread_good_sdk.yaml │ │ │ └── azuread_good_specificmanagedidentity.yaml │ ├── chunked.go │ ├── chunked_test.go │ ├── client.go │ ├── client_test.go │ ├── codec.go │ ├── codec_test.go │ ├── dial_context.go │ ├── dial_context_test.go │ ├── ewma.go │ ├── googleiam │ │ └── googleiam.go │ ├── intern.go │ ├── intern_test.go │ ├── max_timestamp.go │ ├── metadata_watcher.go │ ├── metadata_watcher_test.go │ ├── otlptranslator │ │ └── prometheusremotewrite │ │ │ ├── context.go │ │ │ ├── context_test.go │ │ │ ├── helper.go │ │ │ ├── helper_test.go │ │ │ ├── histograms.go │ │ │ ├── histograms_test.go │ │ │ ├── metrics_to_prw.go │ │ │ ├── metrics_to_prw_test.go │ │ │ ├── number_data_points.go │ │ │ ├── number_data_points_test.go │ │ │ ├── otlp_to_openmetrics_metadata.go │ │ │ ├── testutil_test.go │ │ │ └── timeseries.go │ ├── queue_manager.go │ ├── queue_manager_test.go │ ├── read.go │ ├── read_handler.go │ ├── read_handler_test.go │ ├── read_test.go │ ├── stats.go │ ├── storage.go │ ├── storage_test.go │ ├── write.go │ ├── write_handler.go │ ├── write_handler_test.go │ └── write_test.go ├── secondary.go ├── series.go └── series_test.go ├── template ├── template.go ├── template_amd64_test.go └── template_test.go ├── tracing ├── testdata │ └── ca.cer ├── tracing.go └── tracing_test.go ├── tsdb ├── .gitignore ├── CHANGELOG.md ├── README.md ├── addsymbol.go ├── addsymbol_stringlabels.go ├── agent │ ├── db.go │ ├── db_test.go │ ├── series.go │ └── series_test.go ├── async_block_writer.go ├── block.go ├── block_test.go ├── blockwriter.go ├── blockwriter_test.go ├── chunkenc │ ├── bstream.go │ ├── bstream_test.go │ ├── chunk.go │ ├── chunk_test.go │ ├── float_histogram.go │ ├── float_histogram_test.go │ ├── histogram.go │ ├── histogram_meta.go │ ├── histogram_meta_test.go │ ├── histogram_test.go │ ├── varbit.go │ ├── varbit_test.go │ ├── xor.go │ └── xor_test.go ├── chunks │ ├── chunk_write_queue.go │ ├── chunk_write_queue_test.go │ ├── chunks.go │ ├── chunks_test.go │ ├── head_chunks.go │ ├── head_chunks_other.go │ ├── head_chunks_test.go │ ├── head_chunks_windows.go │ ├── queue.go │ ├── queue_test.go │ └── samples.go ├── compact.go ├── compact_test.go ├── db.go ├── db_test.go ├── docs │ ├── bstream.md │ ├── format │ │ ├── README.md │ │ ├── chunks.md │ │ ├── head_chunks.md │ │ ├── index.md │ │ ├── memory_snapshot.md │ │ ├── tombstones.md │ │ └── wal.md │ ├── refs.md │ └── usage.md ├── encoding │ └── encoding.go ├── errors │ ├── errors.go │ └── errors_test.go ├── example_test.go ├── exemplar.go ├── exemplar_test.go ├── fileutil │ ├── dir.go │ ├── dir_unix.go │ ├── dir_windows.go │ ├── direct_io.go │ ├── direct_io_force.go │ ├── direct_io_linux.go │ ├── direct_io_unsupported.go │ ├── direct_io_writer.go │ ├── direct_io_writer_test.go │ ├── fileutil.go │ ├── flock.go │ ├── flock_js.go │ ├── flock_plan9.go │ ├── flock_solaris.go │ ├── flock_test.go │ ├── flock_unix.go │ ├── flock_windows.go │ ├── mmap.go │ ├── mmap_386.go │ ├── mmap_amd64.go │ ├── mmap_arm64.go │ ├── mmap_js.go │ ├── mmap_unix.go │ ├── mmap_windows.go │ ├── preallocate.go │ ├── preallocate_darwin.go │ ├── preallocate_linux.go │ ├── preallocate_other.go │ ├── sync.go │ ├── sync_darwin.go │ └── sync_linux.go ├── goversion │ ├── goversion.go │ ├── goversion_test.go │ └── init.go ├── hashcache │ ├── series_hash_cache.go │ └── series_hash_cache_test.go ├── head.go ├── head_append.go ├── head_append_test.go ├── head_bench_test.go ├── head_dedupelabels.go ├── head_other.go ├── head_read.go ├── head_read_mimir.go ├── head_read_mimir_test.go ├── head_read_test.go ├── head_test.go ├── head_wal.go ├── index │ ├── index.go │ ├── index_test.go │ ├── labelvalues.go │ ├── labelvalues_test.go │ ├── postings.go │ ├── postings_test.go │ ├── postingsstats.go │ └── postingsstats_test.go ├── isolation.go ├── isolation_test.go ├── mocks_test.go ├── ooo_head.go ├── ooo_head_read.go ├── ooo_head_read_test.go ├── ooo_head_test.go ├── ooo_isolation.go ├── ooo_isolation_test.go ├── postings_for_matchers_cache.go ├── postings_for_matchers_cache_test.go ├── querier.go ├── querier_bench_test.go ├── querier_test.go ├── record │ ├── record.go │ └── record_test.go ├── repair.go ├── repair_test.go ├── symbols_batch.go ├── symbols_batch_test.go ├── testdata │ ├── 20kseries.json │ ├── index_format_v1 │ │ ├── chunks │ │ │ └── 000001 │ │ ├── index │ │ ├── meta.json │ │ └── tombstones │ └── repair_index_version │ │ └── 01BZJ9WJQPWHGNC2W4J9TA62KC │ │ ├── index │ │ └── meta.json ├── testutil.go ├── tombstones │ ├── tombstones.go │ └── tombstones_test.go ├── tsdbblockutil.go ├── tsdbutil │ ├── dir_locker.go │ ├── dir_locker_test.go │ ├── dir_locker_testutil.go │ └── histogram.go └── wlog │ ├── checkpoint.go │ ├── checkpoint_test.go │ ├── live_reader.go │ ├── reader.go │ ├── reader_test.go │ ├── watcher.go │ ├── watcher_test.go │ ├── wlog.go │ └── wlog_test.go ├── ui-commits ├── util ├── almost │ ├── almost.go │ └── almost_test.go ├── annotations │ └── annotations.go ├── compression │ ├── buffers.go │ ├── compression.go │ └── compression_test.go ├── convertnhcb │ ├── convertnhcb.go │ └── convertnhcb_test.go ├── documentcli │ └── documentcli.go ├── fmtutil │ ├── format.go │ └── format_test.go ├── gate │ └── gate.go ├── httputil │ ├── compression.go │ ├── compression_test.go │ ├── context.go │ ├── cors.go │ └── cors_test.go ├── jsonutil │ └── marshal.go ├── junitxml │ ├── junitxml.go │ └── junitxml_test.go ├── logging │ ├── dedupe.go │ ├── dedupe_test.go │ ├── file.go │ └── file_test.go ├── netconnlimit │ ├── netconnlimit.go │ └── netconnlimit_test.go ├── notifications │ ├── notifications.go │ └── notifications_test.go ├── osutil │ └── hostname.go ├── pool │ ├── pool.go │ └── pool_test.go ├── runtime │ ├── limits_default.go │ ├── limits_windows.go │ ├── statfs.go │ ├── statfs_default.go │ ├── statfs_linux_386.go │ ├── statfs_uint32.go │ ├── uname_default.go │ ├── uname_linux.go │ ├── vmlimits_default.go │ └── vmlimits_openbsd.go ├── runutil │ └── runutil.go ├── stats │ ├── query_stats.go │ ├── stats_test.go │ └── timer.go ├── strutil │ ├── quote.go │ ├── quote_test.go │ ├── strconv.go │ └── strconv_test.go ├── teststorage │ └── storage.go ├── testutil │ ├── cmp.go │ ├── context.go │ ├── directory.go │ ├── port.go │ ├── roundtrip.go │ └── testing.go ├── treecache │ └── treecache.go └── zeropool │ ├── pool.go │ └── pool_test.go └── web ├── api └── v1 │ ├── api.go │ ├── api_test.go │ ├── codec.go │ ├── codec_test.go │ ├── errors_test.go │ ├── json_codec.go │ ├── json_codec_test.go │ └── translate_ast.go ├── federate.go ├── federate_test.go ├── ui ├── .gitignore ├── .nvmrc ├── README.md ├── assets_embed.go ├── build_ui.sh ├── embed.go.tmpl ├── mantine-ui │ ├── .gitignore │ ├── eslint.config.mjs │ ├── index.html │ ├── package.json │ ├── postcss.config.cjs │ ├── public │ │ └── favicon.svg │ ├── src │ │ ├── App.module.css │ │ ├── App.tsx │ │ ├── Badge.module.css │ │ ├── Panel.module.css │ │ ├── api │ │ │ ├── api.ts │ │ │ └── responseTypes │ │ │ │ ├── alertmanagers.ts │ │ │ │ ├── config.ts │ │ │ │ ├── labelValues.ts │ │ │ │ ├── metadata.ts │ │ │ │ ├── notifications.ts │ │ │ │ ├── query.ts │ │ │ │ ├── rules.ts │ │ │ │ ├── scrapePools.ts │ │ │ │ ├── series.ts │ │ │ │ ├── targets.ts │ │ │ │ ├── tsdbStatus.ts │ │ │ │ └── walreplay.ts │ │ ├── codemirror │ │ │ └── theme.ts │ │ ├── components │ │ │ ├── CustomInfiniteScroll.tsx │ │ │ ├── EndpointLink.tsx │ │ │ ├── ErrorBoundary.tsx │ │ │ ├── InfoPageCard.tsx │ │ │ ├── InfoPageStack.tsx │ │ │ ├── LabelBadges.tsx │ │ │ ├── NotificationsIcon.tsx │ │ │ ├── NotificationsProvider.tsx │ │ │ ├── ReadinessWrapper.tsx │ │ │ ├── RuleDefinition.module.css │ │ │ ├── RuleDefinition.tsx │ │ │ ├── SettingsMenu.tsx │ │ │ ├── StateMultiSelect.tsx │ │ │ └── ThemeSelector.tsx │ │ ├── fonts │ │ │ └── codicon.ttf │ │ ├── images │ │ │ └── prometheus-logo.svg │ │ ├── lib │ │ │ ├── escapeString.ts │ │ │ ├── formatFloatValue.ts │ │ │ ├── formatSeries.ts │ │ │ ├── formatTime.test.ts │ │ │ └── formatTime.ts │ │ ├── main.tsx │ │ ├── mantine-overrides.css │ │ ├── pages │ │ │ ├── AgentPage.tsx │ │ │ ├── AlertmanagerDiscoveryPage.tsx │ │ │ ├── AlertsPage.tsx │ │ │ ├── ConfigPage.tsx │ │ │ ├── FlagsPage.module.css │ │ │ ├── FlagsPage.tsx │ │ │ ├── RulesPage.tsx │ │ │ ├── StatusPage.tsx │ │ │ ├── TSDBStatusPage.tsx │ │ │ ├── query │ │ │ │ ├── DataTable.module.css │ │ │ │ ├── DataTable.tsx │ │ │ │ ├── ExplainViews │ │ │ │ │ ├── Aggregation.tsx │ │ │ │ │ ├── BinaryExpr │ │ │ │ │ │ ├── BinaryExpr.tsx │ │ │ │ │ │ ├── ScalarScalar.tsx │ │ │ │ │ │ ├── VectorScalar.tsx │ │ │ │ │ │ └── VectorVector.tsx │ │ │ │ │ ├── ExplainView.module.css │ │ │ │ │ ├── ExplainView.tsx │ │ │ │ │ └── Selector.tsx │ │ │ │ ├── ExpressionInput.module.css │ │ │ │ ├── ExpressionInput.tsx │ │ │ │ ├── ExpressionInput.tsx.old │ │ │ │ ├── Graph.module.css │ │ │ │ ├── Graph.tsx │ │ │ │ ├── HistogramChart.module.css │ │ │ │ ├── HistogramChart.tsx │ │ │ │ ├── HistogramHelpers.ts │ │ │ │ ├── MetricsExplorer │ │ │ │ │ ├── LabelsExplorer.module.css │ │ │ │ │ ├── LabelsExplorer.tsx │ │ │ │ │ ├── MetricsExplorer.module.css │ │ │ │ │ └── MetricsExplorer.tsx │ │ │ │ ├── QueryPage.tsx │ │ │ │ ├── QueryPanel.module.css │ │ │ │ ├── QueryPanel.tsx │ │ │ │ ├── RangeInput.tsx │ │ │ │ ├── ResolutionInput.tsx │ │ │ │ ├── SeriesName.module.css │ │ │ │ ├── SeriesName.tsx │ │ │ │ ├── TableTab.tsx │ │ │ │ ├── TimeInput.tsx │ │ │ │ ├── TreeNode.module.css │ │ │ │ ├── TreeNode.tsx │ │ │ │ ├── TreeView.tsx │ │ │ │ ├── UPlotChart.tsx │ │ │ │ ├── colorPool.ts │ │ │ │ ├── uPlotChartHelpers.ts │ │ │ │ ├── uPlotStackHelpers.ts │ │ │ │ ├── uplot.css │ │ │ │ └── urlStateEncoding.ts │ │ │ ├── service-discovery │ │ │ │ ├── ServiceDiscoveryPage.tsx │ │ │ │ └── ServiceDiscoveryPoolsList.tsx │ │ │ └── targets │ │ │ │ ├── ScrapePoolsList.tsx │ │ │ │ ├── TargetLabels.tsx │ │ │ │ └── TargetsPage.tsx │ │ ├── promql.css │ │ ├── promql │ │ │ ├── ast.ts │ │ │ ├── binOp.test.ts │ │ │ ├── binOp.ts │ │ │ ├── format.tsx │ │ │ ├── functionDocs.tsx │ │ │ ├── functionMeta.ts │ │ │ ├── functionSignatures.ts │ │ │ ├── serialize.ts │ │ │ ├── serializeAndFormat.test.ts │ │ │ ├── tools │ │ │ │ ├── gen_functions_docs │ │ │ │ │ └── main.go │ │ │ │ ├── gen_functions_list │ │ │ │ │ └── main.go │ │ │ │ ├── go.mod │ │ │ │ └── go.sum │ │ │ ├── utils.test.ts │ │ │ └── utils.ts │ │ ├── setupTests.ts │ │ ├── state │ │ │ ├── hooks.ts │ │ │ ├── initializeFromLocalStorage.ts │ │ │ ├── localStorageMiddleware.ts │ │ │ ├── queryPageSlice.ts │ │ │ ├── serviceDiscoveryPageSlice.ts │ │ │ ├── settingsSlice.ts │ │ │ ├── store.ts │ │ │ ├── targetsPageSlice.ts │ │ │ └── useNotifications.ts │ │ ├── styles.ts │ │ ├── types │ │ │ └── types.ts │ │ └── vite-env.d.ts │ ├── tsconfig.json │ ├── tsconfig.node.json │ ├── vite.config.ts │ └── vitest.config.ts ├── module │ ├── codemirror-promql │ │ ├── .gitignore │ │ ├── .npmignore │ │ ├── README.md │ │ ├── build.sh │ │ ├── eslint.config.mjs │ │ ├── jest.config.cjs │ │ ├── package.json │ │ ├── setupJest.cjs │ │ ├── src │ │ │ ├── client │ │ │ │ ├── index.ts │ │ │ │ └── prometheus.ts │ │ │ ├── complete │ │ │ │ ├── hybrid.test.ts │ │ │ │ ├── hybrid.ts │ │ │ │ ├── index.test.ts │ │ │ │ ├── index.ts │ │ │ │ └── promql.terms.ts │ │ │ ├── index.ts │ │ │ ├── lint │ │ │ │ ├── hybrid.ts │ │ │ │ └── index.ts │ │ │ ├── parser │ │ │ │ ├── index.ts │ │ │ │ ├── matcher.test.ts │ │ │ │ ├── matcher.ts │ │ │ │ ├── parser.test.ts │ │ │ │ ├── parser.ts │ │ │ │ ├── path-finder.test.ts │ │ │ │ ├── path-finder.ts │ │ │ │ ├── type.ts │ │ │ │ ├── vector.test.ts │ │ │ │ └── vector.ts │ │ │ ├── promql.ts │ │ │ ├── test │ │ │ │ ├── alertmanager_alerts_series.json │ │ │ │ ├── metadata.json │ │ │ │ ├── metric_name.json │ │ │ │ └── utils-test.ts │ │ │ └── types │ │ │ │ ├── function.ts │ │ │ │ ├── index.ts │ │ │ │ ├── matcher.ts │ │ │ │ └── vector.ts │ │ └── tsconfig.json │ └── lezer-promql │ │ ├── .gitignore │ │ ├── .npmignore │ │ ├── README.md │ │ ├── build.sh │ │ ├── generate-types.sh │ │ ├── jest.config.cjs │ │ ├── package.json │ │ ├── rollup.config.js │ │ ├── src │ │ ├── highlight.js │ │ ├── promql.grammar │ │ └── tokens.js │ │ └── test │ │ ├── expression.txt │ │ └── promql.test.js ├── package-lock.json ├── package.json ├── react-app │ ├── .env │ ├── .eslintrc.json │ ├── .gitignore │ ├── package-lock.json │ ├── package.json │ ├── public │ │ ├── favicon.ico │ │ ├── index.html │ │ └── manifest.json │ ├── src │ │ ├── App.test.tsx │ │ ├── App.tsx │ │ ├── Navbar.test.tsx │ │ ├── Navbar.tsx │ │ ├── Theme.tsx │ │ ├── components │ │ │ ├── Checkbox.test.tsx │ │ │ ├── Checkbox.tsx │ │ │ ├── CustomInfiniteScroll.tsx │ │ │ ├── SearchBar.tsx │ │ │ ├── ToggleMoreLess.test.tsx │ │ │ ├── ToggleMoreLess.tsx │ │ │ ├── withStartingIndicator.test.tsx │ │ │ ├── withStartingIndicator.tsx │ │ │ └── withStatusIndicator.tsx │ │ ├── constants │ │ │ └── constants.tsx │ │ ├── contexts │ │ │ ├── AnimateLogoContext.tsx │ │ │ ├── PathPrefixContext.tsx │ │ │ ├── ReadyContext.tsx │ │ │ ├── ThemeContext.tsx │ │ │ └── ToastContext.tsx │ │ ├── fonts │ │ │ └── codicon.ttf │ │ ├── globals.ts │ │ ├── hooks │ │ │ ├── useFetch.ts │ │ │ ├── useLocalStorage.test.tsx │ │ │ ├── useLocalStorage.tsx │ │ │ └── useMedia.ts │ │ ├── images │ │ │ └── prometheus_logo_grey.svg │ │ ├── index.tsx │ │ ├── pages │ │ │ ├── agent │ │ │ │ └── Agent.tsx │ │ │ ├── alerts │ │ │ │ ├── AlertContents.test.tsx │ │ │ │ ├── AlertContents.tsx │ │ │ │ ├── Alerts.tsx │ │ │ │ ├── CollapsibleAlertPanel.tsx │ │ │ │ └── __snapshots__ │ │ │ │ │ └── AlertContents.test.tsx.snap │ │ │ ├── config │ │ │ │ └── Config.tsx │ │ │ ├── flags │ │ │ │ ├── Flags.test.tsx │ │ │ │ ├── Flags.tsx │ │ │ │ └── __snapshots__ │ │ │ │ │ └── Flags.test.tsx.snap │ │ │ ├── graph │ │ │ │ ├── CMTheme.tsx │ │ │ │ ├── ColorPool.ts │ │ │ │ ├── DataTable.test.tsx │ │ │ │ ├── DataTable.tsx │ │ │ │ ├── ExpressionInput.test.tsx │ │ │ │ ├── ExpressionInput.tsx │ │ │ │ ├── Graph.test.tsx │ │ │ │ ├── Graph.tsx │ │ │ │ ├── GraphControls.test.tsx │ │ │ │ ├── GraphControls.tsx │ │ │ │ ├── GraphHeatmapHelpers.test.ts │ │ │ │ ├── GraphHeatmapHelpers.ts │ │ │ │ ├── GraphHelpers.test.ts │ │ │ │ ├── GraphHelpers.ts │ │ │ │ ├── GraphTabContent.test.tsx │ │ │ │ ├── GraphTabContent.tsx │ │ │ │ ├── HistogramChart.tsx │ │ │ │ ├── HistogramHelpers.ts │ │ │ │ ├── Legend.tsx │ │ │ │ ├── MetricsExplorer.test.tsx │ │ │ │ ├── MetricsExplorer.tsx │ │ │ │ ├── Panel.test.tsx │ │ │ │ ├── Panel.tsx │ │ │ │ ├── PanelList.test.tsx │ │ │ │ ├── PanelList.tsx │ │ │ │ ├── QueryStatsView.test.tsx │ │ │ │ ├── QueryStatsView.tsx │ │ │ │ ├── SeriesName.test.tsx │ │ │ │ ├── SeriesName.tsx │ │ │ │ ├── TimeInput.test.tsx │ │ │ │ └── TimeInput.tsx │ │ │ ├── index.ts │ │ │ ├── rules │ │ │ │ ├── Rules.tsx │ │ │ │ └── RulesContent.tsx │ │ │ ├── serviceDiscovery │ │ │ │ ├── LabelsTable.tsx │ │ │ │ └── Services.tsx │ │ │ ├── status │ │ │ │ ├── Status.test.tsx │ │ │ │ ├── Status.tsx │ │ │ │ └── __snapshots__ │ │ │ │ │ └── Status.test.tsx.snap │ │ │ ├── targets │ │ │ │ ├── EndpointLink.test.tsx │ │ │ │ ├── EndpointLink.tsx │ │ │ │ ├── Filter.test.tsx │ │ │ │ ├── Filter.tsx │ │ │ │ ├── ScrapePoolContent.tsx │ │ │ │ ├── ScrapePoolList.test.tsx │ │ │ │ ├── ScrapePoolList.tsx │ │ │ │ ├── ScrapePoolPanel.module.css │ │ │ │ ├── TargetLabels.test.tsx │ │ │ │ ├── TargetLabels.tsx │ │ │ │ ├── TargetScrapeDuration.tsx │ │ │ │ ├── Targets.test.tsx │ │ │ │ ├── Targets.tsx │ │ │ │ ├── __testdata__ │ │ │ │ │ └── testdata.ts │ │ │ │ ├── target.test.ts │ │ │ │ └── target.ts │ │ │ └── tsdbStatus │ │ │ │ ├── TSDBStatus.test.tsx │ │ │ │ └── TSDBStatus.tsx │ │ ├── react-app-env.d.ts │ │ ├── setupProxy.js │ │ ├── setupTests.ts │ │ ├── themes │ │ │ ├── _bootstrap_dark.scss │ │ │ ├── _bootstrap_light.scss │ │ │ ├── _shared.scss │ │ │ ├── app.scss │ │ │ ├── dark.scss │ │ │ └── light.scss │ │ ├── types │ │ │ ├── index.d.ts │ │ │ └── types.ts │ │ ├── utils │ │ │ ├── index.ts │ │ │ └── utils.test.ts │ │ └── vendor │ │ │ └── flot │ │ │ ├── jquery.flot.crosshair.js │ │ │ ├── jquery.flot.heatmap.js │ │ │ ├── jquery.flot.js │ │ │ ├── jquery.flot.selection.js │ │ │ ├── jquery.flot.stack.js │ │ │ └── jquery.flot.time.js │ └── tsconfig.json └── ui.go ├── web.go └── web_test.go /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Prometheus has switched to GitHub action. 3 | # Circle CI is not disabled repository-wise so that previous pull requests 4 | # continue working. 5 | # This file does not generate any CircleCI workflow. 6 | 7 | version: 2.1 8 | 9 | executors: 10 | golang: 11 | docker: 12 | - image: busybox 13 | 14 | jobs: 15 | noopjob: 16 | executor: golang 17 | 18 | steps: 19 | - run: 20 | command: "true" 21 | 22 | workflows: 23 | version: 2 24 | prometheus: 25 | jobs: 26 | - noopjob 27 | triggers: 28 | - schedule: 29 | cron: "0 0 30 2 *" 30 | filters: 31 | branches: 32 | only: 33 | - main 34 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | data/ 2 | .build/ 3 | .tarballs/ 4 | 5 | !.build/linux-amd64/ 6 | !.build/linux-armv7/ 7 | !.build/linux-arm64/ 8 | !.build/linux-ppc64le/ 9 | !.build/linux-s390x/ 10 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: true 2 | contact_links: 3 | - name: Prometheus Community Support 4 | url: https://prometheus.io/community/ 5 | about: If you need help or support, please request help here. 6 | - name: Commercial Support & Training 7 | url: https://prometheus.io/support-training/ 8 | about: If you want commercial support or training, vendors are listed here. 9 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | description: Suggest an idea for this project. 4 | body: 5 | - type: markdown 6 | attributes: 7 | value: >- 8 | Please do *NOT* ask support questions in Github issues. 9 | 10 | 11 | If your issue is not a feature request or bug report use 12 | our [community support](https://prometheus.io/community/). 13 | 14 | 15 | There is also [commercial 16 | support](https://prometheus.io/support-training/) available. 17 | - type: textarea 18 | attributes: 19 | label: Proposal 20 | description: Use case. Why is this important? 21 | placeholder: “Nice to have” is not a good use case. :) 22 | validations: 23 | required: true 24 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 20 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "docker" 4 | directory: "/" 5 | schedule: 6 | interval: "monthly" 7 | - package-ecosystem: "github-actions" 8 | directories: 9 | - "/" 10 | - "/scripts" 11 | schedule: 12 | interval: "monthly" 13 | - package-ecosystem: "gomod" 14 | directories: 15 | - "/" 16 | - "/documentation/examples/remote_storage" 17 | - "/internal/tools" 18 | schedule: 19 | interval: "monthly" 20 | groups: 21 | k8s.io: 22 | patterns: 23 | - "k8s.io/*" 24 | go.opentelemetry.io: 25 | patterns: 26 | - "go.opentelemetry.io/*" 27 | open-pull-requests-limit: 0 28 | -------------------------------------------------------------------------------- /.github/workflows/lock.yml: -------------------------------------------------------------------------------- 1 | name: 'Lock Threads' 2 | 3 | on: 4 | schedule: 5 | - cron: '13 23 * * *' 6 | workflow_dispatch: 7 | 8 | permissions: 9 | issues: write 10 | 11 | concurrency: 12 | group: lock 13 | 14 | jobs: 15 | action: 16 | runs-on: ubuntu-latest 17 | if: github.repository_owner == 'prometheus' 18 | steps: 19 | - uses: dessant/lock-threads@1bf7ec25051fe7c00bdd17e6a7cf3d7bfb7dc771 # v5.0.1 20 | with: 21 | process-only: 'issues' 22 | issue-inactive-days: '180' 23 | github-token: ${{ secrets.PROMBOT_LOCKTHREADS_TOKEN }} 24 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *# 2 | .#* 3 | /*.yaml 4 | /*.yml 5 | *.exe 6 | 7 | /prometheus 8 | /promtool 9 | benchmark.txt 10 | /data 11 | /data-agent 12 | /cmd/prometheus/data 13 | /cmd/prometheus/data-agent 14 | /cmd/prometheus/debug 15 | /benchout 16 | /cmd/promtool/data 17 | 18 | !/.travis.yml 19 | !/.promu.yml 20 | !/.golangci.yml 21 | /documentation/examples/remote_storage/remote_storage_adapter/remote_storage_adapter 22 | /documentation/examples/remote_storage/example_write_adapter/example_write_adapter 23 | 24 | npm_licenses.tar.bz2 25 | /web/ui/static 26 | 27 | /vendor 28 | /.build 29 | 30 | /**/node_modules 31 | 32 | # Ignore parser debug 33 | y.output 34 | -------------------------------------------------------------------------------- /.gitpod.yml: -------------------------------------------------------------------------------- 1 | image: 2 | file: .gitpod.Dockerfile 3 | tasks: 4 | - init: 5 | make build 6 | command: | 7 | gp sync-done build 8 | ./prometheus --config.file=documentation/examples/prometheus.yml 9 | - command: | 10 | cd web/ui/ 11 | gp sync-await build 12 | unset BROWSER 13 | export DANGEROUSLY_DISABLE_HOST_CHECK=true 14 | npm start 15 | openMode: split-right 16 | ports: 17 | - port: 3000 18 | onOpen: open-preview 19 | - port: 9090 20 | onOpen: ignore 21 | -------------------------------------------------------------------------------- /.yamllint.yml: -------------------------------------------------------------------------------- 1 | --- 2 | extends: default 3 | ignore: | 4 | **/node_modules 5 | 6 | rules: 7 | braces: 8 | max-spaces-inside: 1 9 | level: error 10 | brackets: 11 | max-spaces-inside: 1 12 | level: error 13 | commas: disable 14 | comments: disable 15 | comments-indentation: disable 16 | document-start: disable 17 | indentation: 18 | spaces: consistent 19 | indent-sequences: consistent 20 | key-duplicates: 21 | ignore: | 22 | config/testdata/section_key_dup.bad.yml 23 | line-length: disable 24 | truthy: 25 | check-keys: false 26 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Prometheus Community Code of Conduct 2 | 3 | Prometheus follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/main/code-of-conduct.md). 4 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Reporting a security issue 2 | 3 | The Prometheus security policy, including how to report vulnerabilities, can be 4 | found here: 5 | 6 | 7 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 3.4.0 2 | -------------------------------------------------------------------------------- /cmd/prometheus/testdata/consoles/test.html: -------------------------------------------------------------------------------- 1 | {{ query "query_in_console" }} 2 | -------------------------------------------------------------------------------- /cmd/prometheus/testdata/rules/test.yml: -------------------------------------------------------------------------------- 1 | groups: 2 | - name: querylogtest 3 | interval: 1s 4 | rules: 5 | - record: test 6 | expr: query_in_rule 7 | -------------------------------------------------------------------------------- /cmd/promtool/testdata/at-modifier-test.yml: -------------------------------------------------------------------------------- 1 | rule_files: 2 | - at-modifier.yml 3 | 4 | tests: 5 | - input_series: 6 | - series: "requests{}" 7 | values: 1 8 | -------------------------------------------------------------------------------- /cmd/promtool/testdata/at-modifier.yml: -------------------------------------------------------------------------------- 1 | # This is the rules file for at-modifier-test.yml. 2 | 3 | groups: 4 | - name: at-modifier 5 | rules: 6 | - record: x 7 | expr: "requests @ 1000" 8 | -------------------------------------------------------------------------------- /cmd/promtool/testdata/authorization_credentials_file.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: test 3 | authorization: 4 | credentials_file: "/random/file/which/does/not/exist.yml" 5 | -------------------------------------------------------------------------------- /cmd/promtool/testdata/authorization_credentials_file.good.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: test 3 | authorization: 4 | credentials_file: "." 5 | -------------------------------------------------------------------------------- /cmd/promtool/testdata/bad-input-series.yml: -------------------------------------------------------------------------------- 1 | tests: 2 | - input_series: 3 | - series: 'up{job="prometheus", instance="localhost:9090"' 4 | values: "0+0x1440" 5 | -------------------------------------------------------------------------------- /cmd/promtool/testdata/bad-promql.yml: -------------------------------------------------------------------------------- 1 | tests: 2 | - input_series: 3 | - series: 'join_1{a="1",b="2"}' 4 | values: 1 5 | - series: 'join_2{a="1",b="3"}' 6 | values: 2 7 | - series: 'join_2{a="1",b="4"}' 8 | values: 3 9 | 10 | promql_expr_test: 11 | # This PromQL generates an error. 12 | - expr: "join_1 + on(a) join_2" 13 | -------------------------------------------------------------------------------- /cmd/promtool/testdata/bad-rules-error-test.yml: -------------------------------------------------------------------------------- 1 | rule_files: 2 | - bad-rules-error.yml 3 | 4 | tests: 5 | - input_series: 6 | - series: 'join_1{a="1",b="2"}' 7 | values: 1 8 | - series: 'join_2{a="1",b="3"}' 9 | values: 2 10 | - series: 'join_2{a="1",b="4"}' 11 | values: 3 12 | 13 | # Just the existence of the data, that can't be joined, makes the recording 14 | # rules error. 15 | -------------------------------------------------------------------------------- /cmd/promtool/testdata/bad-rules-error.yml: -------------------------------------------------------------------------------- 1 | # This is the rules file for bad-rules-error-test.yml. 2 | 3 | groups: 4 | - name: bad-example 5 | rules: 6 | - record: joined 7 | expr: join_1 + on(a) join_2 8 | -------------------------------------------------------------------------------- /cmd/promtool/testdata/bad-rules-syntax-test.yml: -------------------------------------------------------------------------------- 1 | rule_files: 2 | - bad-rules-syntax.yml 3 | 4 | tests: 5 | # Need a test to ensure the recording rules actually run. 6 | - {} 7 | -------------------------------------------------------------------------------- /cmd/promtool/testdata/bad-rules-syntax.yml: -------------------------------------------------------------------------------- 1 | # This is the rules file for bad-rules-syntax-test.yml. 2 | 3 | groups: 4 | - name: bad-syntax 5 | rules: 6 | - record: x 7 | expr: 'test +' 8 | -------------------------------------------------------------------------------- /cmd/promtool/testdata/bad-sd-file-extension.nonexistent: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/mimir-prometheus/49aee40e890e160b76f81dcb65c03031cc702dc5/cmd/promtool/testdata/bad-sd-file-extension.nonexistent -------------------------------------------------------------------------------- /cmd/promtool/testdata/bad-sd-file-format.yml: -------------------------------------------------------------------------------- 1 | - targats: 2 | - localhost:9100 3 | -------------------------------------------------------------------------------- /cmd/promtool/testdata/config_with_rule_files.yml: -------------------------------------------------------------------------------- 1 | rule_files: 2 | - non-existent-file.yml 3 | - /etc/non/existent/file.yml 4 | -------------------------------------------------------------------------------- /cmd/promtool/testdata/config_with_service_discovery_files.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | file_sd_configs: 4 | - files: 5 | - nonexistent_file.yml 6 | alerting: 7 | alertmanagers: 8 | - scheme: http 9 | api_version: v2 10 | file_sd_configs: 11 | - files: 12 | - nonexistent_file.yml 13 | -------------------------------------------------------------------------------- /cmd/promtool/testdata/config_with_tls_files.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: "some job" 3 | tls_config: 4 | cert_file: nonexistent_cert_file.yml 5 | key_file: nonexistent_key_file.yml 6 | -------------------------------------------------------------------------------- /cmd/promtool/testdata/dump-openmetrics-test.prom: -------------------------------------------------------------------------------- 1 | my_counter{baz="abc",foo="bar"} 1 0.000 2 | my_counter{baz="abc",foo="bar"} 2 60.000 3 | my_counter{baz="abc",foo="bar"} 3 120.000 4 | my_counter{baz="abc",foo="bar"} 4 180.000 5 | my_counter{baz="abc",foo="bar"} 5 240.000 6 | my_gauge{abc="baz",bar="foo"} 9 0.000 7 | my_gauge{abc="baz",bar="foo"} 8 60.000 8 | my_gauge{abc="baz",bar="foo"} 0 120.000 9 | my_gauge{abc="baz",bar="foo"} 4 180.000 10 | my_gauge{abc="baz",bar="foo"} 7 240.000 11 | # EOF 12 | -------------------------------------------------------------------------------- /cmd/promtool/testdata/dump-test-1.prom: -------------------------------------------------------------------------------- 1 | {__name__="heavy_metric", foo="bar"} 5 0 2 | {__name__="heavy_metric", foo="bar"} 4 60000 3 | {__name__="heavy_metric", foo="bar"} 3 120000 4 | {__name__="heavy_metric", foo="bar"} 2 180000 5 | {__name__="heavy_metric", foo="bar"} 1 240000 6 | {__name__="heavy_metric", foo="foo"} 5 0 7 | {__name__="heavy_metric", foo="foo"} 4 60000 8 | {__name__="heavy_metric", foo="foo"} 3 120000 9 | {__name__="heavy_metric", foo="foo"} 2 180000 10 | {__name__="heavy_metric", foo="foo"} 1 240000 11 | {__name__="metric", baz="abc", foo="bar"} 1 0 12 | {__name__="metric", baz="abc", foo="bar"} 2 60000 13 | {__name__="metric", baz="abc", foo="bar"} 3 120000 14 | {__name__="metric", baz="abc", foo="bar"} 4 180000 15 | {__name__="metric", baz="abc", foo="bar"} 5 240000 16 | -------------------------------------------------------------------------------- /cmd/promtool/testdata/dump-test-2.prom: -------------------------------------------------------------------------------- 1 | {__name__="heavy_metric", foo="foo"} 5 0 2 | {__name__="heavy_metric", foo="foo"} 4 60000 3 | {__name__="heavy_metric", foo="foo"} 3 120000 4 | {__name__="heavy_metric", foo="foo"} 2 180000 5 | {__name__="heavy_metric", foo="foo"} 1 240000 6 | {__name__="metric", baz="abc", foo="bar"} 1 0 7 | {__name__="metric", baz="abc", foo="bar"} 2 60000 8 | {__name__="metric", baz="abc", foo="bar"} 3 120000 9 | {__name__="metric", baz="abc", foo="bar"} 4 180000 10 | {__name__="metric", baz="abc", foo="bar"} 5 240000 11 | -------------------------------------------------------------------------------- /cmd/promtool/testdata/dump-test-3.prom: -------------------------------------------------------------------------------- 1 | {__name__="metric", baz="abc", foo="bar"} 2 60000 2 | {__name__="metric", baz="abc", foo="bar"} 3 120000 3 | -------------------------------------------------------------------------------- /cmd/promtool/testdata/failing.yml: -------------------------------------------------------------------------------- 1 | rule_files: 2 | - rules.yml 3 | 4 | tests: 5 | # Simple failing test, depends on no rules. 6 | - interval: 1m 7 | name: "Failing test" 8 | input_series: 9 | - series: test 10 | values: '0' 11 | 12 | promql_expr_test: 13 | - expr: test 14 | eval_time: 0m 15 | exp_samples: 16 | - value: 1 17 | labels: test 18 | 19 | alert_rule_test: 20 | - eval_time: 0m 21 | alertname: Test 22 | exp_alerts: 23 | - exp_labels: {} 24 | 25 | # Alerts firing, but no alert expected by the test. 26 | - interval: 1m 27 | name: Failing alert test 28 | input_series: 29 | - series: 'up{job="test"}' 30 | values: 0x10 31 | 32 | alert_rule_test: 33 | - eval_time: 5m 34 | alertname: InstanceDown 35 | exp_alerts: [] 36 | - eval_time: 5m 37 | alertname: AlwaysFiring 38 | exp_alerts: [] 39 | -------------------------------------------------------------------------------- /cmd/promtool/testdata/features.yml: -------------------------------------------------------------------------------- 1 | groups: 2 | - name: features 3 | rules: 4 | - record: x 5 | # We don't expect anything from this, just want to check the function parses. 6 | expr: sort_by_label(up, "instance") 7 | -------------------------------------------------------------------------------- /cmd/promtool/testdata/good-sd-file.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "labels": { 4 | "job": "node" 5 | }, 6 | "targets": ["localhost:9100"] 7 | } 8 | ] 9 | -------------------------------------------------------------------------------- /cmd/promtool/testdata/good-sd-file.yaml: -------------------------------------------------------------------------------- 1 | - labels: 2 | job: node 3 | - targets: 4 | - localhost:9100 5 | -------------------------------------------------------------------------------- /cmd/promtool/testdata/good-sd-file.yml: -------------------------------------------------------------------------------- 1 | - labels: 2 | job: node 3 | - targets: 4 | - localhost:9100 5 | -------------------------------------------------------------------------------- /cmd/promtool/testdata/negative-offset-test.yml: -------------------------------------------------------------------------------- 1 | rule_files: 2 | - negative-offset.yml 3 | 4 | tests: 5 | - input_series: 6 | - series: "requests{}" 7 | values: 1 8 | -------------------------------------------------------------------------------- /cmd/promtool/testdata/negative-offset.yml: -------------------------------------------------------------------------------- 1 | # This is the rules file for negative-offset-test.yml. 2 | 3 | groups: 4 | - name: negative-offset 5 | rules: 6 | - record: x 7 | expr: "requests offset -5m" 8 | -------------------------------------------------------------------------------- /cmd/promtool/testdata/no-test-group-interval.yml: -------------------------------------------------------------------------------- 1 | tests: 2 | - input_series: 3 | - series: test 4 | values: 0 1 5 | promql_expr_test: 6 | - expr: test 7 | eval_time: 59s 8 | exp_samples: 9 | - value: 0 10 | labels: test 11 | - expr: test 12 | eval_time: 1m 13 | exp_samples: 14 | - value: 1 15 | labels: test 16 | -------------------------------------------------------------------------------- /cmd/promtool/testdata/prometheus-config.bad.yml: -------------------------------------------------------------------------------- 1 | not-prometheus: 2 | -------------------------------------------------------------------------------- /cmd/promtool/testdata/prometheus-config.good.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/mimir-prometheus/49aee40e890e160b76f81dcb65c03031cc702dc5/cmd/promtool/testdata/prometheus-config.good.yml -------------------------------------------------------------------------------- /cmd/promtool/testdata/prometheus-config.lint.too_long_scrape_interval.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: too_long_scrape_interval_test 3 | scrape_interval: 10m 4 | -------------------------------------------------------------------------------- /cmd/promtool/testdata/prometheus-config.lint.yml: -------------------------------------------------------------------------------- 1 | rule_files: 2 | - prometheus-rules.lint.yml 3 | -------------------------------------------------------------------------------- /cmd/promtool/testdata/prometheus-rules.lint.yml: -------------------------------------------------------------------------------- 1 | groups: 2 | - name: example 3 | rules: 4 | - alert: HighRequestLatency 5 | expr: job:request_latency_seconds:mean5m{job="myjob"} > 0.5 6 | for: 10m 7 | labels: 8 | severity: page 9 | annotations: 10 | summary: High request latency 11 | - alert: HighRequestLatency 12 | expr: job:request_latency_seconds:mean5m{job="myjob"} > 0.5 13 | for: 10m 14 | labels: 15 | severity: page 16 | annotations: 17 | summary: High request latency 18 | -------------------------------------------------------------------------------- /cmd/promtool/testdata/rules-bad.yml: -------------------------------------------------------------------------------- 1 | # This is the rules file. 2 | 3 | groups: 4 | - name: alerts 5 | rules: 6 | - alert: InstanceDown 7 | expr: up == 0 8 | for: 5m 9 | labels: 10 | severity: page 11 | annotations: 12 | summary: "Instance {{ $label.foo }} down" 13 | description: "{{ $labels.instance }} of job {{ $labels.job }} has been down for more than 5 minutes." 14 | - alert: AlwaysFiring 15 | expr: 1 16 | 17 | - name: rules 18 | rules: 19 | - record: job:test:count_over_time1m 20 | expr: sum without(instance) (count_over_time(test[1m])) 21 | 22 | # A recording rule that doesn't depend on input series. 23 | - record: fixed_data 24 | expr: 1 25 | 26 | # Subquery with default resolution test. 27 | - record: suquery_interval_test 28 | expr: count_over_time(up[5m:]) 29 | -------------------------------------------------------------------------------- /cmd/promtool/testdata/rules.yml: -------------------------------------------------------------------------------- 1 | # This is the rules file. 2 | 3 | groups: 4 | - name: alerts 5 | rules: 6 | - alert: InstanceDown 7 | expr: up == 0 8 | for: 5m 9 | labels: 10 | severity: page 11 | annotations: 12 | summary: "Instance {{ $labels.instance }} down" 13 | description: "{{ $labels.instance }} of job {{ $labels.job }} has been down for more than 5 minutes." 14 | - alert: AlwaysFiring 15 | expr: 1 16 | 17 | - name: rules 18 | rules: 19 | - record: job:test:count_over_time1m 20 | expr: sum without(instance) (count_over_time(test[1m])) 21 | 22 | # A recording rule that doesn't depend on input series. 23 | - record: fixed_data 24 | expr: 1 25 | 26 | # Subquery with default resolution test. 27 | - record: suquery_interval_test 28 | expr: count_over_time(up[5m:]) 29 | -------------------------------------------------------------------------------- /cmd/promtool/testdata/rules_duplicates.yml: -------------------------------------------------------------------------------- 1 | # This is a rules file with duplicate expressions 2 | 3 | groups: 4 | - name: base 5 | rules: 6 | - record: job:test:count_over_time1m 7 | expr: sum without(instance) (count_over_time(test[1m])) 8 | 9 | # A recording rule that doesn't depend on input series. 10 | - record: fixed_data 11 | expr: 1 12 | 13 | # Subquery with default resolution test. 14 | - record: suquery_interval_test 15 | expr: count_over_time(up[5m:]) 16 | 17 | # Duplicating 18 | - record: job:test:count_over_time1m 19 | expr: sum without(instance) (count_over_time(test[1m])) 20 | 21 | - name: duplicate 22 | rules: 23 | - record: job:test:count_over_time1m 24 | expr: sum without(instance) (count_over_time(test[1m])) 25 | -------------------------------------------------------------------------------- /cmd/promtool/testdata/rules_run.yml: -------------------------------------------------------------------------------- 1 | rule_files: 2 | - rules.yml 3 | 4 | evaluation_interval: 1m 5 | 6 | # Minimal test cases to check focus on a rule group. 7 | tests: 8 | - name: correct test 9 | input_series: 10 | - series: test 11 | values: 1 12 | 13 | promql_expr_test: 14 | - expr: test 15 | eval_time: 0 16 | exp_samples: 17 | - value: 1 18 | labels: test 19 | 20 | - name: wrong test 21 | input_series: 22 | - series: test 23 | values: 0 24 | 25 | promql_expr_test: 26 | - expr: test 27 | eval_time: 0 28 | exp_samples: 29 | - value: 1 30 | labels: test 31 | -------------------------------------------------------------------------------- /cmd/promtool/testdata/rules_run_extrafields.yml: -------------------------------------------------------------------------------- 1 | # Minimal test case to see that --ignore-unknown-fields 2 | # is working as expected. It should not return an error 3 | # when any extra fields are present in the rules file. 4 | rule_files: 5 | - rules_extrafields.yml 6 | 7 | evaluation_interval: 1m 8 | 9 | 10 | tests: 11 | - name: extra ownership field test 12 | input_series: 13 | - series: test 14 | values: 1 15 | 16 | promql_expr_test: 17 | - expr: test 18 | eval_time: 0 19 | exp_samples: 20 | - value: 1 21 | labels: test 22 | -------------------------------------------------------------------------------- /cmd/promtool/testdata/rules_run_no_fuzzy.yml: -------------------------------------------------------------------------------- 1 | # Minimal test case to see that fuzzy compare can be turned off, 2 | # and slight floating point differences fail matching. 3 | 4 | evaluation_interval: 1m 5 | fuzzy_compare: false 6 | 7 | tests: 8 | - name: correct fuzzy match 9 | input_series: 10 | - series: test_low 11 | values: 2.9999999999999996 12 | - series: test_high 13 | values: 3.0000000000000004 14 | promql_expr_test: 15 | - expr: test_low 16 | eval_time: 0 17 | exp_samples: 18 | - labels: test_low 19 | value: 3 20 | - expr: test_high 21 | eval_time: 0 22 | exp_samples: 23 | - labels: test_high 24 | value: 3 25 | -------------------------------------------------------------------------------- /cmd/promtool/testdata/url_in_alert_targetgroup_with_relabel_config.bad.yml: -------------------------------------------------------------------------------- 1 | alerting: 2 | alertmanagers: 3 | - relabel_configs: 4 | - source_labels: [__address__] 5 | target_label: __param_target 6 | static_configs: 7 | - targets: 8 | - http://bad 9 | -------------------------------------------------------------------------------- /cmd/promtool/testdata/url_in_alert_targetgroup_with_relabel_config.good.yml: -------------------------------------------------------------------------------- 1 | alerting: 2 | alertmanagers: 3 | - relabel_configs: 4 | - source_labels: [__address__] 5 | target_label: __param_target 6 | - target_label: __address__ 7 | replacement: good 8 | static_configs: 9 | - targets: 10 | - http://bad 11 | -------------------------------------------------------------------------------- /cmd/promtool/testdata/url_in_scrape_targetgroup_with_relabel_config.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | relabel_configs: 4 | - source_labels: [__address__] 5 | target_label: __param_target 6 | static_configs: 7 | - targets: 8 | - http://bad 9 | -------------------------------------------------------------------------------- /cmd/promtool/testdata/url_in_scrape_targetgroup_with_relabel_config.good.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | relabel_configs: 4 | - source_labels: [__address__] 5 | target_label: __param_target 6 | - target_label: __address__ 7 | replacement: good 8 | static_configs: 9 | - targets: 10 | - http://good 11 | -------------------------------------------------------------------------------- /config/testdata/agent_mode.good.yml: -------------------------------------------------------------------------------- 1 | remote_write: 2 | - url: http://remote1/push 3 | -------------------------------------------------------------------------------- /config/testdata/agent_mode.with_alert_manager.yml: -------------------------------------------------------------------------------- 1 | alerting: 2 | alertmanagers: 3 | - scheme: https 4 | static_configs: 5 | - targets: 6 | - "1.2.3.4:9093" 7 | -------------------------------------------------------------------------------- /config/testdata/agent_mode.with_alert_relabels.yml: -------------------------------------------------------------------------------- 1 | alerting: 2 | alert_relabel_configs: 3 | - action: uppercase 4 | source_labels: [instance] 5 | target_label: instance 6 | -------------------------------------------------------------------------------- /config/testdata/agent_mode.with_remote_reads.yml: -------------------------------------------------------------------------------- 1 | remote_read: 2 | - url: http://remote1/read 3 | read_recent: true 4 | name: default 5 | enable_http2: false 6 | -------------------------------------------------------------------------------- /config/testdata/agent_mode.with_rule_files.yml: -------------------------------------------------------------------------------- 1 | rule_files: 2 | - "first.rules" 3 | - "my/*.rules" 4 | -------------------------------------------------------------------------------- /config/testdata/agent_mode.without_remote_writes.yml: -------------------------------------------------------------------------------- 1 | global: 2 | scrape_interval: 15s 3 | -------------------------------------------------------------------------------- /config/testdata/azure_authentication_method.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - azure_sd_configs: 3 | - authentication_method: invalid 4 | subscription_id: 11AAAA11-A11A-111A-A111-1111A1111A11 5 | -------------------------------------------------------------------------------- /config/testdata/azure_bearertoken_basicauth.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | azure_sd_configs: 4 | - subscription_id: 11AAAA11-A11A-111A-A111-1111A1111A11 5 | tenant_id: BBBB222B-B2B2-2B22-B222-2BB2222BB2B2 6 | client_id: 333333CC-3C33-3333-CCC3-33C3CCCCC33C 7 | client_secret: mysecret 8 | bearer_token: 1234 9 | basic_auth: 10 | username: user 11 | password: password 12 | -------------------------------------------------------------------------------- /config/testdata/azure_client_id_missing.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: azure 3 | azure_sd_configs: 4 | - subscription_id: 11AAAA11-A11A-111A-A111-1111A1111A11 5 | tenant_id: BBBB222B-B2B2-2B22-B222-2BB2222BB2B2 6 | client_id: 7 | client_secret: mysecret 8 | -------------------------------------------------------------------------------- /config/testdata/azure_client_secret_missing.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: azure 3 | azure_sd_configs: 4 | - subscription_id: 11AAAA11-A11A-111A-A111-1111A1111A11 5 | tenant_id: BBBB222B-B2B2-2B22-B222-2BB2222BB2B2 6 | client_id: 333333CC-3C33-3333-CCC3-33C3CCCCC33C 7 | client_secret: 8 | -------------------------------------------------------------------------------- /config/testdata/azure_subscription_id_missing.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: azure 3 | azure_sd_configs: 4 | - subscription_id: 5 | tenant_id: BBBB222B-B2B2-2B22-B222-2BB2222BB2B2 6 | client_id: 333333CC-3C33-3333-CCC3-33C3CCCCC33C 7 | client_secret: mysecret 8 | -------------------------------------------------------------------------------- /config/testdata/azure_tenant_id_missing.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: azure 3 | azure_sd_configs: 4 | - subscription_id: 11AAAA11-A11A-111A-A111-1111A1111A11 5 | tenant_id: 6 | client_id: 333333CC-3C33-3333-CCC3-33C3CCCCC33C 7 | client_secret: mysecret 8 | -------------------------------------------------------------------------------- /config/testdata/bearertoken.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | 4 | bearer_token: 1234 5 | bearer_token_file: somefile 6 | -------------------------------------------------------------------------------- /config/testdata/bearertoken_basicauth.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | 4 | bearer_token: 1234 5 | basic_auth: 6 | username: user 7 | password: password 8 | -------------------------------------------------------------------------------- /config/testdata/config_with_deprecated_am_api_config.yml: -------------------------------------------------------------------------------- 1 | alerting: 2 | alertmanagers: 3 | - scheme: http 4 | api_version: v1 5 | file_sd_configs: 6 | - files: 7 | - nonexistent_file.yml 8 | -------------------------------------------------------------------------------- /config/testdata/dropequal.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | relabel_configs: 4 | - source_labels: [abcdef] 5 | action: dropequal 6 | -------------------------------------------------------------------------------- /config/testdata/dropequal1.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | relabel_configs: 4 | - source_labels: [abcdef] 5 | action: dropequal 6 | regex: foo 7 | target_label: bar 8 | -------------------------------------------------------------------------------- /config/testdata/ec2_filters_empty_values.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | 4 | ec2_sd_configs: 5 | - region: "us-east-1" 6 | filters: 7 | - name: "tag:environment" 8 | values: 9 | -------------------------------------------------------------------------------- /config/testdata/ec2_token_file.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: foo 3 | ec2_sd_configs: 4 | - region: us-east-1 5 | bearer_token: foo 6 | bearer_token_file: foo 7 | -------------------------------------------------------------------------------- /config/testdata/empty_alert_relabel_config.bad.yml: -------------------------------------------------------------------------------- 1 | alerting: 2 | alert_relabel_configs: 3 | - 4 | -------------------------------------------------------------------------------- /config/testdata/empty_alertmanager_relabel_config.bad.yml: -------------------------------------------------------------------------------- 1 | alerting: 2 | alertmanagers: 3 | - relabel_configs: 4 | - 5 | -------------------------------------------------------------------------------- /config/testdata/empty_metric_relabel_config.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: "test" 3 | metric_relabel_configs: 4 | - 5 | -------------------------------------------------------------------------------- /config/testdata/empty_rr_config.bad.yml: -------------------------------------------------------------------------------- 1 | remote_read: 2 | - 3 | -------------------------------------------------------------------------------- /config/testdata/empty_rw_config.bad.yml: -------------------------------------------------------------------------------- 1 | remote_write: 2 | - 3 | -------------------------------------------------------------------------------- /config/testdata/empty_rw_relabel_config.bad.yml: -------------------------------------------------------------------------------- 1 | remote_write: 2 | - url: "foo" 3 | write_relabel_configs: 4 | - 5 | -------------------------------------------------------------------------------- /config/testdata/empty_scrape_config.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - 3 | -------------------------------------------------------------------------------- /config/testdata/empty_scrape_config_action.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | relabel_configs: 4 | - action: null 5 | -------------------------------------------------------------------------------- /config/testdata/empty_static_config.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: "test" 3 | static_configs: 4 | - 5 | -------------------------------------------------------------------------------- /config/testdata/empty_target_relabel_config.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: "test" 3 | relabel_configs: 4 | - 5 | -------------------------------------------------------------------------------- /config/testdata/eureka_invalid_server.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: eureka 3 | eureka_sd_configs: 4 | - server: eureka.com 5 | -------------------------------------------------------------------------------- /config/testdata/eureka_no_server.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: eureka 3 | eureka_sd_configs: 4 | - server: 5 | -------------------------------------------------------------------------------- /config/testdata/external_labels.good.yml: -------------------------------------------------------------------------------- 1 | global: 2 | external_labels: 3 | bar: foo 4 | foo: ${TEST} 5 | baz: foo${TEST}bar 6 | qux: foo$${TEST} 7 | xyz: foo$$bar 8 | -------------------------------------------------------------------------------- /config/testdata/first.rules: -------------------------------------------------------------------------------- 1 | groups: 2 | - name: my-group-name 3 | rules: 4 | - alert: InstanceDown 5 | expr: up == 0 6 | for: 1m 7 | labels: 8 | severity: critical 9 | annotations: 10 | description: "stuff's happening with {{ $labels.service }}" 11 | -------------------------------------------------------------------------------- /config/testdata/global_convert_classic_hist_to_nhcb.good.yml: -------------------------------------------------------------------------------- 1 | global: 2 | convert_classic_histograms_to_nhcb: true 3 | scrape_configs: 4 | - job_name: prometheus 5 | static_configs: 6 | - targets: ['localhost:8080'] 7 | -------------------------------------------------------------------------------- /config/testdata/global_disable_always_scrape_classic_hist.good.yml: -------------------------------------------------------------------------------- 1 | global: 2 | always_scrape_classic_histograms: false 3 | scrape_configs: 4 | - job_name: prometheus 5 | static_configs: 6 | - targets: ['localhost:8080'] 7 | -------------------------------------------------------------------------------- /config/testdata/global_enable_always_scrape_classic_hist.good.yml: -------------------------------------------------------------------------------- 1 | global: 2 | always_scrape_classic_histograms: true 3 | scrape_configs: 4 | - job_name: prometheus 5 | static_configs: 6 | - targets: ['localhost:8080'] 7 | -------------------------------------------------------------------------------- /config/testdata/global_timeout.good.yml: -------------------------------------------------------------------------------- 1 | global: 2 | scrape_timeout: 1h 3 | scrape_interval: 1h 4 | -------------------------------------------------------------------------------- /config/testdata/hetzner_role.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - hetzner_sd_configs: 3 | - role: invalid 4 | -------------------------------------------------------------------------------- /config/testdata/http_token_file.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: foo 3 | http_sd_configs: 4 | - url: http://foo 5 | bearer_token: foo 6 | bearer_token_file: foo 7 | -------------------------------------------------------------------------------- /config/testdata/http_url_bad_scheme.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - http_sd_configs: 3 | - url: ftp://example.com 4 | -------------------------------------------------------------------------------- /config/testdata/http_url_no_host.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - http_sd_configs: 3 | - url: http:// 4 | -------------------------------------------------------------------------------- /config/testdata/http_url_no_scheme.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - http_sd_configs: 3 | - url: invalid 4 | -------------------------------------------------------------------------------- /config/testdata/ionos_datacenter.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - ionos_sd_configs: 3 | - datacenter_id: "" 4 | -------------------------------------------------------------------------------- /config/testdata/jobname.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: 3 | -------------------------------------------------------------------------------- /config/testdata/jobname_dup.bad.yml: -------------------------------------------------------------------------------- 1 | # Two scrape configs with the same job names are not allowed. 2 | global: 3 | metric_name_validation_scheme: legacy 4 | scrape_configs: 5 | - job_name: prometheus 6 | - job_name: service-x 7 | - job_name: prometheus 8 | -------------------------------------------------------------------------------- /config/testdata/keepequal.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | relabel_configs: 4 | - source_labels: [abcdef] 5 | action: keepequal 6 | -------------------------------------------------------------------------------- /config/testdata/keepequal1.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | relabel_configs: 4 | - source_labels: [abcdef] 5 | action: keepequal 6 | regex: foo 7 | target_label: bar 8 | -------------------------------------------------------------------------------- /config/testdata/kubernetes_api_server_with_own_namespace.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | kubernetes_sd_configs: 4 | - role: endpoints 5 | api_server: 'https://localhost:1234' 6 | namespaces: 7 | own_namespace: true 8 | -------------------------------------------------------------------------------- /config/testdata/kubernetes_authorization_basicauth.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | 4 | kubernetes_sd_configs: 5 | - role: pod 6 | api_server: "https://localhost:1234" 7 | 8 | authorization: 9 | credentials: 1234 10 | basic_auth: 11 | username: user 12 | password: password 13 | -------------------------------------------------------------------------------- /config/testdata/kubernetes_bearertoken.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | 4 | kubernetes_sd_configs: 5 | - role: node 6 | api_server: "https://localhost:1234" 7 | 8 | bearer_token: 1234 9 | bearer_token_file: somefile 10 | -------------------------------------------------------------------------------- /config/testdata/kubernetes_bearertoken_basicauth.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | 4 | kubernetes_sd_configs: 5 | - role: pod 6 | api_server: "https://localhost:1234" 7 | 8 | bearer_token: 1234 9 | basic_auth: 10 | username: user 11 | password: password 12 | -------------------------------------------------------------------------------- /config/testdata/kubernetes_empty_apiserver.good.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | kubernetes_sd_configs: 4 | - role: endpoints 5 | -------------------------------------------------------------------------------- /config/testdata/kubernetes_http_config_without_api_server.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | kubernetes_sd_configs: 4 | - role: pod 5 | authorization: 6 | credentials: 1234 7 | -------------------------------------------------------------------------------- /config/testdata/kubernetes_kubeconfig_with_apiserver.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | kubernetes_sd_configs: 4 | - role: endpoints 5 | api_server: 'https://localhost:1234' 6 | kubeconfig_file: /user1/.kube/config 7 | -------------------------------------------------------------------------------- /config/testdata/kubernetes_kubeconfig_with_http_config.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | kubernetes_sd_configs: 4 | - role: endpoints 5 | kubeconfig_file: /user1/.kube/config 6 | basic_auth: 7 | username: user 8 | password: password 9 | -------------------------------------------------------------------------------- /config/testdata/kubernetes_kubeconfig_with_own_namespace.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | kubernetes_sd_configs: 4 | - role: endpoints 5 | kubeconfig_file: /home/User1/.kubeconfig 6 | namespaces: 7 | own_namespace: true 8 | -------------------------------------------------------------------------------- /config/testdata/kubernetes_kubeconfig_without_apiserver.good.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | kubernetes_sd_configs: 4 | - role: endpoints 5 | kubeconfig_file: /user1/.kube/config 6 | -------------------------------------------------------------------------------- /config/testdata/kubernetes_namespace_discovery.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - kubernetes_sd_configs: 3 | - api_server: kubernetes:443 4 | role: endpoints 5 | namespaces: 6 | foo: bar 7 | -------------------------------------------------------------------------------- /config/testdata/kubernetes_role.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - kubernetes_sd_configs: 3 | - api_server: kubernetes:443 4 | role: vacation 5 | -------------------------------------------------------------------------------- /config/testdata/kubernetes_selectors_duplicated_role.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | kubernetes_sd_configs: 4 | - role: endpoints 5 | selectors: 6 | - role: "pod" 7 | label: "foo=bar" 8 | field: "metadata.status=Running" 9 | - role: "pod" 10 | label: "foo=bar" 11 | field: "metadata.status=Running" 12 | -------------------------------------------------------------------------------- /config/testdata/kubernetes_selectors_endpoints.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | kubernetes_sd_configs: 4 | - role: endpoints 5 | selectors: 6 | - role: "node" 7 | label: "foo=bar" 8 | field: "metadata.status=Running" 9 | - role: "service" 10 | label: "foo=bar" 11 | field: "metadata.status=Running" 12 | - role: "endpoints" 13 | label: "foo=bar" 14 | field: "metadata.status=Running" 15 | -------------------------------------------------------------------------------- /config/testdata/kubernetes_selectors_endpoints.good.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | kubernetes_sd_configs: 4 | - role: endpoints 5 | selectors: 6 | - role: "pod" 7 | label: "foo=bar" 8 | field: "metadata.status=Running" 9 | - role: "service" 10 | label: "foo=bar" 11 | field: "metadata.status=Running" 12 | - role: "endpoints" 13 | label: "foo=bar" 14 | field: "metadata.status=Running" 15 | -------------------------------------------------------------------------------- /config/testdata/kubernetes_selectors_incorrect_selector.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | kubernetes_sd_configs: 4 | - role: endpoints 5 | selectors: 6 | - role: "pod" 7 | field: "metadata.status-Running" 8 | -------------------------------------------------------------------------------- /config/testdata/kubernetes_selectors_ingress.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | kubernetes_sd_configs: 4 | - role: ingress 5 | selectors: 6 | - role: "node" 7 | label: "foo=bar" 8 | field: "metadata.status=Running" 9 | -------------------------------------------------------------------------------- /config/testdata/kubernetes_selectors_ingress.good.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | kubernetes_sd_configs: 4 | - role: ingress 5 | selectors: 6 | - role: "ingress" 7 | label: "foo=bar" 8 | field: "metadata.status=Running" 9 | -------------------------------------------------------------------------------- /config/testdata/kubernetes_selectors_node.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | kubernetes_sd_configs: 4 | - role: node 5 | selectors: 6 | - role: "pod" 7 | label: "foo=bar" 8 | field: "metadata.status=Running" 9 | -------------------------------------------------------------------------------- /config/testdata/kubernetes_selectors_node.good.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | kubernetes_sd_configs: 4 | - role: node 5 | selectors: 6 | - role: "node" 7 | label: "foo=bar" 8 | field: "metadata.status=Running" 9 | -------------------------------------------------------------------------------- /config/testdata/kubernetes_selectors_pod.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | kubernetes_sd_configs: 4 | - role: pod 5 | selectors: 6 | - role: "node" 7 | label: "foo=bar" 8 | field: "metadata.status=Running" 9 | -------------------------------------------------------------------------------- /config/testdata/kubernetes_selectors_pod.good.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | kubernetes_sd_configs: 4 | - role: pod 5 | selectors: 6 | - role: "pod" 7 | label: "foo=bar" 8 | field: "metadata.status=Running" 9 | - role: pod 10 | selectors: 11 | - role: "pod" 12 | label: "foo in (bar,baz)" 13 | field: "metadata.status=Running" 14 | -------------------------------------------------------------------------------- /config/testdata/kubernetes_selectors_service.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | kubernetes_sd_configs: 4 | - role: service 5 | selectors: 6 | - role: "pod" 7 | label: "foo=bar" 8 | field: "metadata.status=Running" 9 | -------------------------------------------------------------------------------- /config/testdata/kubernetes_selectors_service.good.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | kubernetes_sd_configs: 4 | - role: service 5 | selectors: 6 | - role: "service" 7 | label: "foo=bar" 8 | field: "metadata.status=Running" 9 | -------------------------------------------------------------------------------- /config/testdata/labeldrop.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | relabel_configs: 4 | - source_labels: [abcdef] 5 | action: labeldrop 6 | -------------------------------------------------------------------------------- /config/testdata/labeldrop2.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | relabel_configs: 4 | - modulus: 8 5 | action: labeldrop 6 | -------------------------------------------------------------------------------- /config/testdata/labeldrop3.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | relabel_configs: 4 | - separator: "," 5 | action: labeldrop 6 | -------------------------------------------------------------------------------- /config/testdata/labeldrop4.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | relabel_configs: 4 | - replacement: yolo-{1} 5 | action: labeldrop 6 | -------------------------------------------------------------------------------- /config/testdata/labeldrop5.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | relabel_configs: 4 | - target_label: yolo 5 | action: labeldrop 6 | -------------------------------------------------------------------------------- /config/testdata/labelkeep.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | relabel_configs: 4 | - source_labels: [abcdef] 5 | action: labelkeep 6 | -------------------------------------------------------------------------------- /config/testdata/labelkeep2.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | relabel_configs: 4 | - modulus: 8 5 | action: labelkeep 6 | -------------------------------------------------------------------------------- /config/testdata/labelkeep3.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | relabel_configs: 4 | - separator: "," 5 | action: labelkeep 6 | -------------------------------------------------------------------------------- /config/testdata/labelkeep4.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | relabel_configs: 4 | - replacement: yolo-{1} 5 | action: labelkeep 6 | -------------------------------------------------------------------------------- /config/testdata/labelkeep5.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | relabel_configs: 4 | - target_label: yolo 5 | action: labelkeep 6 | -------------------------------------------------------------------------------- /config/testdata/labelmap.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | relabel_configs: 4 | - action: labelmap 5 | replacement: !!binary "/w==$1" 6 | -------------------------------------------------------------------------------- /config/testdata/labelname.bad.yml: -------------------------------------------------------------------------------- 1 | global: 2 | external_labels: 3 | !!binary "/w==": value 4 | -------------------------------------------------------------------------------- /config/testdata/labelvalue.bad.yml: -------------------------------------------------------------------------------- 1 | global: 2 | external_labels: 3 | name: !!binary "/w==" 4 | -------------------------------------------------------------------------------- /config/testdata/lightsail_token_file.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: foo 3 | lightsail_sd_configs: 4 | - region: us-east-1 5 | bearer_token: foo 6 | bearer_token_file: foo 7 | -------------------------------------------------------------------------------- /config/testdata/local_convert_classic_hist_to_nhcb.good.yml: -------------------------------------------------------------------------------- 1 | global: 2 | convert_classic_histograms_to_nhcb: false 3 | scrape_configs: 4 | - job_name: prometheus 5 | static_configs: 6 | - targets: ['localhost:8080'] 7 | convert_classic_histograms_to_nhcb: true 8 | -------------------------------------------------------------------------------- /config/testdata/local_disable_always_scrape_classic_hist.good.yml: -------------------------------------------------------------------------------- 1 | global: 2 | always_scrape_classic_histograms: true 3 | scrape_configs: 4 | - job_name: prometheus 5 | static_configs: 6 | - targets: ['localhost:8080'] 7 | always_scrape_classic_histograms: false 8 | -------------------------------------------------------------------------------- /config/testdata/local_disable_convert_classic_hist_to_nhcb.good.yml: -------------------------------------------------------------------------------- 1 | global: 2 | convert_classic_histograms_to_nhcb: true 3 | scrape_configs: 4 | - job_name: prometheus 5 | static_configs: 6 | - targets: ['localhost:8080'] 7 | convert_classic_histograms_to_nhcb: false 8 | -------------------------------------------------------------------------------- /config/testdata/local_enable_always_scrape_classic_hist.good.yml: -------------------------------------------------------------------------------- 1 | global: 2 | always_scrape_classic_histograms: false 3 | scrape_configs: 4 | - job_name: prometheus 5 | static_configs: 6 | - targets: ['localhost:8080'] 7 | always_scrape_classic_histograms: true 8 | -------------------------------------------------------------------------------- /config/testdata/lowercase.bad.yml: -------------------------------------------------------------------------------- 1 | global: 2 | metric_name_validation_scheme: legacy 3 | scrape_configs: 4 | - job_name: prometheus 5 | relabel_configs: 6 | - action: lowercase 7 | source_labels: [__name__] 8 | -------------------------------------------------------------------------------- /config/testdata/lowercase3.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | relabel_configs: 4 | - action: lowercase 5 | source_labels: [__name__] 6 | target_label: __name__ 7 | replacement: bar 8 | -------------------------------------------------------------------------------- /config/testdata/marathon_authtoken_authorization.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | 4 | marathon_sd_configs: 5 | - servers: 6 | - "https://localhost:1234" 7 | 8 | auth_token: 1234 9 | authorization: 10 | credentials: 4567 11 | -------------------------------------------------------------------------------- /config/testdata/marathon_authtoken_authtokenfile.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | 4 | marathon_sd_configs: 5 | - servers: 6 | - "https://localhost:1234" 7 | 8 | auth_token: 1234 9 | auth_token_file: somefile 10 | -------------------------------------------------------------------------------- /config/testdata/marathon_authtoken_basicauth.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | 4 | marathon_sd_configs: 5 | - servers: 6 | - "https://localhost:1234" 7 | 8 | auth_token: 1234 9 | basic_auth: 10 | username: user 11 | password: password 12 | -------------------------------------------------------------------------------- /config/testdata/marathon_authtoken_bearertoken.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | 4 | marathon_sd_configs: 5 | - servers: 6 | - "https://localhost:1234" 7 | 8 | auth_token: 1234 9 | bearer_token: 4567 10 | -------------------------------------------------------------------------------- /config/testdata/marathon_no_servers.bad.yml: -------------------------------------------------------------------------------- 1 | # my global config 2 | global: 3 | scrape_interval: 15s 4 | evaluation_interval: 30s 5 | 6 | scrape_configs: 7 | - job_name: service-marathon 8 | marathon_sd_configs: 9 | - servers: 10 | -------------------------------------------------------------------------------- /config/testdata/modulus_missing.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | relabel_configs: 4 | - regex: abcdef 5 | action: hashmod 6 | -------------------------------------------------------------------------------- /config/testdata/openstack_availability.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - openstack_sd_configs: 3 | - availability: invalid 4 | -------------------------------------------------------------------------------- /config/testdata/openstack_role.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - openstack_sd_configs: 3 | - role: invalid 4 | -------------------------------------------------------------------------------- /config/testdata/otlp_allow_keep_identifying_resource_attributes.good.yml: -------------------------------------------------------------------------------- 1 | otlp: 2 | keep_identifying_resource_attributes: true 3 | -------------------------------------------------------------------------------- /config/testdata/otlp_allow_utf8.bad.yml: -------------------------------------------------------------------------------- 1 | global: 2 | metric_name_validation_scheme: legacy 3 | otlp: 4 | translation_strategy: Invalid 5 | -------------------------------------------------------------------------------- /config/testdata/otlp_allow_utf8.good.yml: -------------------------------------------------------------------------------- 1 | otlp: 2 | translation_strategy: NoUTF8EscapingWithSuffixes 3 | -------------------------------------------------------------------------------- /config/testdata/otlp_allow_utf8.incompatible.yml: -------------------------------------------------------------------------------- 1 | global: 2 | metric_name_validation_scheme: legacy 3 | otlp: 4 | translation_strategy: NoUTF8EscapingWithSuffixes 5 | -------------------------------------------------------------------------------- /config/testdata/otlp_convert_histograms_to_nhcb.good.yml: -------------------------------------------------------------------------------- 1 | otlp: 2 | convert_histograms_to_nhcb: true 3 | -------------------------------------------------------------------------------- /config/testdata/otlp_ignore_resource_attributes_without_promote_all.bad.yml: -------------------------------------------------------------------------------- 1 | otlp: 2 | ignore_resource_attributes: ["k8s.job.name"] 3 | -------------------------------------------------------------------------------- /config/testdata/otlp_no_translation.good.yml: -------------------------------------------------------------------------------- 1 | otlp: 2 | translation_strategy: NoTranslation 3 | -------------------------------------------------------------------------------- /config/testdata/otlp_no_translation.incompatible.yml: -------------------------------------------------------------------------------- 1 | global: 2 | metric_name_validation_scheme: legacy 3 | otlp: 4 | translation_strategy: NoTranslation 5 | -------------------------------------------------------------------------------- /config/testdata/otlp_promote_all_resource_attributes.bad.yml: -------------------------------------------------------------------------------- 1 | otlp: 2 | promote_all_resource_attributes: true 3 | promote_resource_attributes: ["k8s.cluster.name", " k8s.job.name ", "k8s.namespace.name", "k8s.job.name"] 4 | -------------------------------------------------------------------------------- /config/testdata/otlp_sanitize_default_resource_attributes.good.yml: -------------------------------------------------------------------------------- 1 | otlp: 2 | -------------------------------------------------------------------------------- /config/testdata/otlp_sanitize_ignore_resource_attributes.bad.yml: -------------------------------------------------------------------------------- 1 | otlp: 2 | promote_all_resource_attributes: true 3 | ignore_resource_attributes: ["k8s.cluster.name", " k8s.job.name ", "k8s.namespace.name", "k8s.job.name", ""] 4 | -------------------------------------------------------------------------------- /config/testdata/otlp_sanitize_ignore_resource_attributes.good.yml: -------------------------------------------------------------------------------- 1 | otlp: 2 | promote_all_resource_attributes: true 3 | ignore_resource_attributes: ["k8s.cluster.name", " k8s.job.name ", "k8s.namespace.name"] 4 | -------------------------------------------------------------------------------- /config/testdata/otlp_sanitize_promote_resource_attributes.bad.yml: -------------------------------------------------------------------------------- 1 | otlp: 2 | promote_resource_attributes: ["k8s.cluster.name", " k8s.job.name ", "k8s.namespace.name", "k8s.job.name", ""] 3 | -------------------------------------------------------------------------------- /config/testdata/otlp_sanitize_promote_resource_attributes.good.yml: -------------------------------------------------------------------------------- 1 | otlp: 2 | promote_resource_attributes: ["k8s.cluster.name", " k8s.job.name ", "k8s.namespace.name"] 3 | -------------------------------------------------------------------------------- /config/testdata/otlp_sanitize_resource_attributes_promote_all.good.yml: -------------------------------------------------------------------------------- 1 | otlp: 2 | promote_all_resource_attributes: true 3 | -------------------------------------------------------------------------------- /config/testdata/ovhcloud_bad_service.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - ovhcloud_sd_configs: 3 | - service: fakeservice 4 | endpoint: ovh-eu 5 | application_key: testAppKey 6 | application_secret: testAppSecret 7 | consumer_key: testConsumerKey 8 | refresh_interval: 1m 9 | -------------------------------------------------------------------------------- /config/testdata/ovhcloud_no_secret.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - ovhcloud_sd_configs: 3 | - service: dedicated_server 4 | endpoint: ovh-eu 5 | application_key: testAppKey 6 | consumer_key: testConsumerKey 7 | refresh_interval: 1m 8 | -------------------------------------------------------------------------------- /config/testdata/puppetdb_bad_url.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - puppetdb_sd_configs: 3 | - url: http:// 4 | query: 'resources { type = "Package" and title = "httpd" }' 5 | -------------------------------------------------------------------------------- /config/testdata/puppetdb_no_query.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - puppetdb_sd_configs: 3 | - url: http://puppetserver/ 4 | -------------------------------------------------------------------------------- /config/testdata/puppetdb_no_scheme.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - puppetdb_sd_configs: 3 | - url: ftp://puppet 4 | query: 'resources { type = "Package" and title = "httpd" }' 5 | -------------------------------------------------------------------------------- /config/testdata/puppetdb_no_url.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - puppetdb_sd_configs: 3 | - query: 'resources { type = "Package" and title = "httpd" }' 4 | -------------------------------------------------------------------------------- /config/testdata/puppetdb_token_file.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: puppetdb 3 | puppetdb_sd_configs: 4 | - url: http://puppet 5 | query: 'resources { type = "Package" and title = "httpd" }' 6 | bearer_token: foo 7 | bearer_token_file: foo 8 | -------------------------------------------------------------------------------- /config/testdata/regex.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | relabel_configs: 4 | - regex: abc(def 5 | -------------------------------------------------------------------------------- /config/testdata/remote_read_dup.bad.yml: -------------------------------------------------------------------------------- 1 | remote_read: 2 | - url: http://localhost:9090 3 | name: queue1 4 | - url: localhost:9091 5 | name: queue1 6 | -------------------------------------------------------------------------------- /config/testdata/remote_read_header.bad.yml: -------------------------------------------------------------------------------- 1 | remote_read: 2 | - url: localhost:9090 3 | name: queue1 4 | headers: 5 | "x-prometheus-remote-write-version": "somehack" 6 | -------------------------------------------------------------------------------- /config/testdata/remote_read_url_missing.bad.yml: -------------------------------------------------------------------------------- 1 | remote_read: 2 | - url: 3 | -------------------------------------------------------------------------------- /config/testdata/remote_write_authorization_header.bad.yml: -------------------------------------------------------------------------------- 1 | remote_write: 2 | - url: localhost:9090 3 | name: queue1 4 | headers: 5 | "authorization": "Basic YWxhZGRpbjpvcGVuc2VzYW1l" 6 | -------------------------------------------------------------------------------- /config/testdata/remote_write_dup.bad.yml: -------------------------------------------------------------------------------- 1 | remote_write: 2 | - url: localhost:9090 3 | name: queue1 4 | - url: localhost:9091 5 | name: queue1 6 | -------------------------------------------------------------------------------- /config/testdata/remote_write_header.bad.yml: -------------------------------------------------------------------------------- 1 | remote_write: 2 | - url: localhost:9090 3 | name: queue1 4 | headers: 5 | "x-prometheus-remote-write-version": "somehack" 6 | -------------------------------------------------------------------------------- /config/testdata/remote_write_retry_on_rate_limit.good.yml: -------------------------------------------------------------------------------- 1 | remote_write: 2 | - url: localhost:9090 3 | queue_config: 4 | retry_on_http_429: true 5 | - url: localhost:9201 6 | -------------------------------------------------------------------------------- /config/testdata/remote_write_url_missing.bad.yml: -------------------------------------------------------------------------------- 1 | remote_write: 2 | - url: 3 | -------------------------------------------------------------------------------- /config/testdata/remote_write_wrong_msg.bad.yml: -------------------------------------------------------------------------------- 1 | remote_write: 2 | - url: localhost:9090 3 | protobuf_message: io.prometheus.writet.v2.Request # typo in 'write" 4 | -------------------------------------------------------------------------------- /config/testdata/rules.bad.yml: -------------------------------------------------------------------------------- 1 | rule_files: 2 | - 'my_rule' # fine 3 | - 'my/*/rule' # bad 4 | -------------------------------------------------------------------------------- /config/testdata/rules_abs_path.good.yml: -------------------------------------------------------------------------------- 1 | rule_files: 2 | - 'first.rules' 3 | - 'rules/second.rules' 4 | - '/absolute/third.rules' 5 | -------------------------------------------------------------------------------- /config/testdata/rules_abs_path_windows.good.yml: -------------------------------------------------------------------------------- 1 | rule_files: 2 | - 'first.rules' 3 | - 'rules\second.rules' 4 | - 'c:\absolute\third.rules' 5 | -------------------------------------------------------------------------------- /config/testdata/scaleway_no_secret.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - scaleway_sd_configs: 3 | - role: instance 4 | project_id: 11111111-1111-1111-1111-111111111112 5 | access_key: SCWXXXXXXXXXXXXXXXXX 6 | -------------------------------------------------------------------------------- /config/testdata/scaleway_role.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - scaleway_sd_configs: 3 | - role: invalid 4 | project_id: 11111111-1111-1111-1111-111111111112 5 | access_key: SCWXXXXXXXXXXXXXXXXX 6 | secret_key_file: bar 7 | -------------------------------------------------------------------------------- /config/testdata/scaleway_two_secrets.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - scaleway_sd_configs: 3 | - role: instance 4 | project_id: 11111111-1111-1111-1111-111111111112 5 | access_key: SCWXXXXXXXXXXXXXXXXX 6 | secret_key_file: bar 7 | secret_key: 11111111-1111-1111-1111-111111111112 8 | -------------------------------------------------------------------------------- /config/testdata/scrape_body_size_limit.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | body_size_limit: 100 4 | -------------------------------------------------------------------------------- /config/testdata/scrape_config_default_validation_mode.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | -------------------------------------------------------------------------------- /config/testdata/scrape_config_disable_compression.good.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | static_configs: 4 | - targets: ['localhost:8080'] 5 | enable_compression: false 6 | -------------------------------------------------------------------------------- /config/testdata/scrape_config_files.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | scrape_interval: 10s 4 | scrape_timeout: 20s 5 | static_configs: 6 | - targets: ['localhost:8080'] 7 | -------------------------------------------------------------------------------- /config/testdata/scrape_config_files.good.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | static_configs: 4 | - targets: ['localhost:8080'] 5 | -------------------------------------------------------------------------------- /config/testdata/scrape_config_files2.good.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: alertmanager 3 | static_configs: 4 | - targets: ['localhost:8080'] 5 | -------------------------------------------------------------------------------- /config/testdata/scrape_config_files_combined.good.yml: -------------------------------------------------------------------------------- 1 | scrape_config_files: 2 | - scrape_config_files.good.yml 3 | - scrape_config_files2.good.yml 4 | scrape_configs: 5 | - job_name: node 6 | static_configs: 7 | - targets: ['localhost:8080'] 8 | -------------------------------------------------------------------------------- /config/testdata/scrape_config_files_double_import.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_config_files: 2 | - scrape_config_files.good.yml 3 | - scrape_config_files.good.yml 4 | -------------------------------------------------------------------------------- /config/testdata/scrape_config_files_duplicate.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_config_files: 2 | - scrape_config_files.good.yml 3 | scrape_configs: 4 | - job_name: prometheus 5 | static_configs: 6 | - targets: ['localhost:8080'] 7 | -------------------------------------------------------------------------------- /config/testdata/scrape_config_files_fallback_scrape_protocol1.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: node 3 | fallback_scrape_protocol: "prometheusproto" 4 | static_configs: 5 | - targets: ['localhost:8080'] 6 | -------------------------------------------------------------------------------- /config/testdata/scrape_config_files_fallback_scrape_protocol2.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: node 3 | fallback_scrape_protocol: ["OpenMetricsText1.0.0", "PrometheusText0.0.4"] 4 | static_configs: 5 | - targets: ['localhost:8080'] 6 | -------------------------------------------------------------------------------- /config/testdata/scrape_config_files_glob.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_config_files: 2 | - scrape_configs/*/* 3 | scrape_configs: 4 | - job_name: node 5 | static_configs: 6 | - targets: ['localhost:8080'] 7 | -------------------------------------------------------------------------------- /config/testdata/scrape_config_files_glob.good.yml: -------------------------------------------------------------------------------- 1 | scrape_config_files: 2 | - scrape_configs/*.yml 3 | -------------------------------------------------------------------------------- /config/testdata/scrape_config_files_global.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_config_files: 2 | - scrape_config_files.bad.yml 3 | -------------------------------------------------------------------------------- /config/testdata/scrape_config_files_global_duplicate.bad.yml: -------------------------------------------------------------------------------- 1 | global: 2 | scrape_interval: 15s 3 | 4 | scrape_config_files: 5 | - scrape_config_files.good.yml 6 | - scrape_config_files.good.yml 7 | 8 | scrape_configs: 9 | - job_name: prometheus 10 | static_configs: 11 | - targets: ['localhost:8080'] 12 | -------------------------------------------------------------------------------- /config/testdata/scrape_config_files_only.good.yml: -------------------------------------------------------------------------------- 1 | scrape_config_files: 2 | - scrape_config_files.good.yml 3 | -------------------------------------------------------------------------------- /config/testdata/scrape_config_files_scrape_protocols.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: node 3 | scrape_protocols: ["prometheusproto"] 4 | static_configs: 5 | - targets: ['localhost:8080'] 6 | -------------------------------------------------------------------------------- /config/testdata/scrape_config_files_scrape_protocols2.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: node 3 | scrape_protocols: ["OpenMetricsText1.0.0", "PrometheusProto", "OpenMetricsText1.0.0"] 4 | static_configs: 5 | - targets: ['localhost:8080'] 6 | -------------------------------------------------------------------------------- /config/testdata/scrape_config_global_validation_mode.yml: -------------------------------------------------------------------------------- 1 | global: 2 | metric_name_validation_scheme: legacy 3 | metric_name_escaping_scheme: dots 4 | scrape_configs: 5 | - job_name: prometheus 6 | -------------------------------------------------------------------------------- /config/testdata/scrape_config_local_global_validation_mode.yml: -------------------------------------------------------------------------------- 1 | global: 2 | metric_name_validation_scheme: legacy 3 | metric_name_escaping_scheme: values 4 | scrape_configs: 5 | - job_name: prometheus 6 | metric_name_validation_scheme: utf8 7 | metric_name_escaping_scheme: dots 8 | -------------------------------------------------------------------------------- /config/testdata/scrape_config_local_validation_mode.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | metric_name_validation_scheme: legacy 4 | metric_name_escaping_scheme: values 5 | -------------------------------------------------------------------------------- /config/testdata/scrape_config_utf8_conflicting.bad.yml: -------------------------------------------------------------------------------- 1 | global: 2 | metric_name_validation_scheme: legacy 3 | metric_name_escaping_scheme: allow-utf-8 4 | scrape_configs: 5 | - job_name: prometheus 6 | -------------------------------------------------------------------------------- /config/testdata/scrape_configs/scrape_config_files1.good.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | static_configs: 4 | - targets: ['localhost:8080'] 5 | tls_config: 6 | cert_file: valid_cert_file 7 | key_file: valid_key_file 8 | -------------------------------------------------------------------------------- /config/testdata/scrape_configs/scrape_config_files2.good.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: node 3 | scrape_interval: 15s 4 | tls_config: 5 | cert_file: ../valid_cert_file 6 | key_file: ../valid_key_file 7 | vultr_sd_configs: 8 | - authorization: 9 | credentials: abcdef 10 | -------------------------------------------------------------------------------- /config/testdata/scrape_interval.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | scrape_interval: 5s 4 | scrape_timeout: 6s 5 | -------------------------------------------------------------------------------- /config/testdata/scrape_interval_larger.good.yml: -------------------------------------------------------------------------------- 1 | global: 2 | scrape_interval: 15s 3 | scrape_timeout: 15s 4 | 5 | scrape_configs: 6 | - job_name: prometheus 7 | 8 | scrape_interval: 5s 9 | 10 | dns_sd_configs: 11 | - refresh_interval: 15s 12 | names: 13 | - first.dns.address.domain.com 14 | - second.dns.address.domain.com 15 | - names: 16 | - first.dns.address.domain.com 17 | -------------------------------------------------------------------------------- /config/testdata/section_key_dup.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: 'prometheus_system' 3 | 4 | scrape_configs: 5 | - job_name: 'foo_system' 6 | -------------------------------------------------------------------------------- /config/testdata/static_config.bad.yml: -------------------------------------------------------------------------------- 1 | targets: ['1.2.3.4:9001', '1.2.3.5:9090'] 2 | labels: 3 | valid_label: foo 4 | !!binary "/w==": bar 5 | -------------------------------------------------------------------------------- /config/testdata/target_label_hashmod_missing.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | relabel_configs: 4 | - source_labels: [__address__] 5 | modulus: 8 6 | action: hashmod 7 | -------------------------------------------------------------------------------- /config/testdata/target_label_missing.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | relabel_configs: 4 | - regex: abcdef 5 | -------------------------------------------------------------------------------- /config/testdata/tracing_invalid_authorization_header.bad.yml: -------------------------------------------------------------------------------- 1 | tracing: 2 | sampling_fraction: 1 3 | endpoint: "localhost:4317" 4 | headers: 5 | "authorization": foo 6 | -------------------------------------------------------------------------------- /config/testdata/tracing_invalid_compression.bad.yml: -------------------------------------------------------------------------------- 1 | tracing: 2 | sampling_fraction: 1 3 | endpoint: "localhost:4317" 4 | compression: foo 5 | -------------------------------------------------------------------------------- /config/testdata/tracing_invalid_header.bad.yml: -------------------------------------------------------------------------------- 1 | tracing: 2 | sampling_fraction: 1 3 | endpoint: "localhost:4317" 4 | headers: 5 | "x-prometheus-remote-write-version": foo 6 | -------------------------------------------------------------------------------- /config/testdata/tracing_missing_endpoint.bad.yml: -------------------------------------------------------------------------------- 1 | tracing: 2 | sampling_fraction: 1 3 | -------------------------------------------------------------------------------- /config/testdata/unknown_attr.bad.yml: -------------------------------------------------------------------------------- 1 | # my global config 2 | global: 3 | scrape_interval: 15s 4 | evaluation_interval: 30s 5 | # scrape_timeout is set to the global default (10s). 6 | 7 | external_labels: 8 | monitor: codelab 9 | foo: bar 10 | 11 | rule_files: 12 | - "first.rules" 13 | - "second.rules" 14 | - "my/*.rules" 15 | 16 | scrape_configs: 17 | - job_name: prometheus 18 | 19 | consult_sd_configs: 20 | - server: "localhost:1234" 21 | -------------------------------------------------------------------------------- /config/testdata/unknown_global_attr.bad.yml: -------------------------------------------------------------------------------- 1 | global: 2 | nonexistent_field: test 3 | -------------------------------------------------------------------------------- /config/testdata/uppercase.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | relabel_configs: 4 | - action: uppercase 5 | source_labels: [__name__] 6 | -------------------------------------------------------------------------------- /config/testdata/uppercase3.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | relabel_configs: 4 | - action: uppercase 5 | source_labels: [__name__] 6 | target_label: __name__ 7 | replacement: bar 8 | -------------------------------------------------------------------------------- /config/testdata/url_in_targetgroup.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | static_configs: 4 | - targets: 5 | - http://bad 6 | -------------------------------------------------------------------------------- /config/testdata/uyuni_no_server.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: uyuni 3 | uyuni_sd_configs: 4 | - server: 5 | -------------------------------------------------------------------------------- /config/testdata/uyuni_token_file.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: uyuni 3 | uyuni_sd_configs: 4 | - server: "server" 5 | username: "username" 6 | password: "password" 7 | bearer_token: foo 8 | bearer_token_file: foo 9 | -------------------------------------------------------------------------------- /discovery/file/fixtures/invalid_nil.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "targets": ["localhost:9090", "example.org:443"], 4 | "labels": { 5 | "foo": "bar" 6 | } 7 | }, 8 | null 9 | ] 10 | -------------------------------------------------------------------------------- /discovery/file/fixtures/invalid_nil.yml: -------------------------------------------------------------------------------- 1 | - targets: ['localhost:9090', 'example.org:443'] 2 | labels: 3 | foo: bar 4 | 5 | - null 6 | -------------------------------------------------------------------------------- /discovery/file/fixtures/valid.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "targets": ["localhost:9090", "example.org:443"], 4 | "labels": { 5 | "foo": "bar" 6 | } 7 | }, 8 | { 9 | "targets": ["my.domain"] 10 | } 11 | ] 12 | -------------------------------------------------------------------------------- /discovery/file/fixtures/valid.yml: -------------------------------------------------------------------------------- 1 | - targets: ['localhost:9090', 'example.org:443'] 2 | labels: 3 | foo: bar 4 | 5 | - targets: ['my.domain'] 6 | -------------------------------------------------------------------------------- /discovery/file/fixtures/valid2.yml: -------------------------------------------------------------------------------- 1 | - targets: ['my.domain'] 2 | - targets: ['localhost:9090'] 3 | labels: 4 | foo: bar 5 | fred: baz 6 | - targets: ['example.org:443'] 7 | labels: 8 | scheme: https 9 | -------------------------------------------------------------------------------- /discovery/file/fixtures/valid3.yml: -------------------------------------------------------------------------------- 1 | # the YAML structure is identical to valid.yml but the raw data is different. 2 | - targets: ["localhost:9090", "example.org:443"] 3 | labels: 4 | foo: bar 5 | 6 | - targets: ["my.domain"] 7 | -------------------------------------------------------------------------------- /discovery/http/fixtures/http_sd.good.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "labels": { 4 | "__meta_datacenter": "bru1" 5 | }, 6 | "targets": [ 7 | "127.0.0.1:9090" 8 | ] 9 | } 10 | ] 11 | -------------------------------------------------------------------------------- /discovery/linode/testdata/ca-central/v4/account/events.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [], 3 | "results": 0, 4 | "pages": 1, 5 | "page": 1 6 | } 7 | -------------------------------------------------------------------------------- /discovery/linode/testdata/ca-central/v4/networking/ips.json: -------------------------------------------------------------------------------- 1 | { 2 | "page": 1, 3 | "pages": 1, 4 | "results": 2, 5 | "data": [ 6 | { 7 | "address": "192.53.120.25", 8 | "gateway": "192.53.120.1", 9 | "subnet_mask": "255.255.255.0", 10 | "prefix": 24, 11 | "type": "ipv4", 12 | "public": true, 13 | "rdns": "li2216-25.members.linode.com", 14 | "linode_id": 26837938, 15 | "region": "ca-central" 16 | }, 17 | { 18 | "address": "2600:3c04::f03c:92ff:fe1a:fb68", 19 | "gateway": "fe80::1", 20 | "subnet_mask": "ffff:ffff:ffff:ffff::", 21 | "prefix": 64, 22 | "type": "ipv6", 23 | "rdns": null, 24 | "linode_id": 26837938, 25 | "region": "ca-central", 26 | "public": true 27 | } 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /discovery/linode/testdata/ca-central/v4/networking/ipv6/ranges.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | { 4 | "range": "2600:3c04:e001:456::", 5 | "prefix": 64, 6 | "region": "ca-central", 7 | "route_target": "2600:3c04::f03c:92ff:fe1a:fb68" 8 | } 9 | ], 10 | "page": 1, 11 | "pages": 1, 12 | "results": 1 13 | } 14 | -------------------------------------------------------------------------------- /discovery/linode/testdata/no_region_filter/v4/account/events.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [], 3 | "results": 0, 4 | "pages": 1, 5 | "page": 1 6 | } 7 | -------------------------------------------------------------------------------- /discovery/linode/testdata/no_region_filter/v4/networking/ipv6/ranges.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | { 4 | "range": "2600:3c03:e000:123::", 5 | "prefix": 64, 6 | "region": "us-east", 7 | "route_target": "2600:3c03::f03c:92ff:fe1a:fb4c" 8 | }, 9 | { 10 | "range": "2600:3c04:e001:456::", 11 | "prefix": 64, 12 | "region": "ca-central", 13 | "route_target": "2600:3c04::f03c:92ff:fe1a:fb68" 14 | } 15 | ], 16 | "page": 1, 17 | "pages": 1, 18 | "results": 2 19 | } 20 | -------------------------------------------------------------------------------- /discovery/linode/testdata/us-east/v4/account/events.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [], 3 | "results": 0, 4 | "pages": 1, 5 | "page": 1 6 | } 7 | -------------------------------------------------------------------------------- /discovery/linode/testdata/us-east/v4/networking/ipv6/ranges.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | { 4 | "range": "2600:3c03:e000:123::", 5 | "prefix": 64, 6 | "region": "us-east", 7 | "route_target": "2600:3c03::f03c:92ff:fe1a:fb4c" 8 | } 9 | ], 10 | "page": 1, 11 | "pages": 1, 12 | "results": 1 13 | } 14 | -------------------------------------------------------------------------------- /discovery/moby/testdata/dockerprom/_ping.json: -------------------------------------------------------------------------------- 1 | OK -------------------------------------------------------------------------------- /discovery/moby/testdata/dockerprom/headers.yml: -------------------------------------------------------------------------------- 1 | Ostype: linux 2 | Server: Docker/19.03.5-ce (linux) 3 | Docker-Experimental: "false" 4 | Api-Version: "1.40" 5 | Cache-Control: no-cache, no-store, must-revalidat 6 | -------------------------------------------------------------------------------- /discovery/moby/testdata/swarmprom/_ping.json: -------------------------------------------------------------------------------- 1 | OK -------------------------------------------------------------------------------- /discovery/moby/testdata/swarmprom/headers.yml: -------------------------------------------------------------------------------- 1 | Ostype: linux 2 | Server: Docker/19.03.5-ce (linux) 3 | Docker-Experimental: "false" 4 | Api-Version: "1.40" 5 | Cache-Control: no-cache, no-store, must-revalidat 6 | -------------------------------------------------------------------------------- /discovery/ovhcloud/testdata/dedicated_server/dedicated_servers.json: -------------------------------------------------------------------------------- 1 | [ 2 | "abcde" 3 | ] -------------------------------------------------------------------------------- /discovery/ovhcloud/testdata/dedicated_server/dedicated_servers_abcde_ips.json: -------------------------------------------------------------------------------- 1 | [ 2 | "1.2.3.4/32", 3 | "2001:0db8:0000:0000:0000:0000:0000:0001/64" 4 | ] -------------------------------------------------------------------------------- /discovery/ovhcloud/testdata/dedicated_server/dedicated_servers_details.json: -------------------------------------------------------------------------------- 1 | { 2 | "ip": "1.2.3.4", 3 | "newUpgradeSystem": true, 4 | "commercialRange": "Advance-1 Gen 2", 5 | "rack": "TESTRACK", 6 | "rescueMail": null, 7 | "supportLevel": "pro", 8 | "bootId": 1, 9 | "linkSpeed": 123, 10 | "professionalUse": false, 11 | "monitoring": true, 12 | "noIntervention": false, 13 | "name": "abcde", 14 | "rootDevice": null, 15 | "state": "test", 16 | "datacenter": "gra3", 17 | "os": "debian11_64", 18 | "reverse": "abcde-rev", 19 | "serverId": 1234 20 | } -------------------------------------------------------------------------------- /discovery/ovhcloud/testdata/vps/vps.json: -------------------------------------------------------------------------------- 1 | [ 2 | "abc" 3 | ] -------------------------------------------------------------------------------- /discovery/ovhcloud/testdata/vps/vps_abc_ips.json: -------------------------------------------------------------------------------- 1 | [ 2 | "192.0.2.1/32", 3 | "2001:0db1:0000:0000:0000:0000:0000:0001/64" 4 | ] -------------------------------------------------------------------------------- /discovery/ovhcloud/testdata/vps/vps_details.json: -------------------------------------------------------------------------------- 1 | { 2 | "offerType": "ssd", 3 | "monitoringIpBlocks": [], 4 | "displayName": "abc", 5 | "zone": "zone", 6 | "cluster": "cluster_test", 7 | "slaMonitoring": false, 8 | "name": "abc", 9 | "vcore": 1, 10 | "state": "running", 11 | "keymap": null, 12 | "netbootMode": "local", 13 | "model": { 14 | "name": "vps-value-1-2-40", 15 | "availableOptions": [], 16 | "maximumAdditionnalIp": 16, 17 | "offer": "VPS abc", 18 | "disk": 40, 19 | "version": "2019v1", 20 | "vcore": 1, 21 | "memory": 2048, 22 | "datacenter": [] 23 | }, 24 | "memoryLimit": 2048 25 | } -------------------------------------------------------------------------------- /discovery/scaleway/testdata/secret_key: -------------------------------------------------------------------------------- 1 | 6d6579e5-a5b9-49fc-a35f-b4feb9b87301 2 | -------------------------------------------------------------------------------- /docs/command-line/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Command Line 3 | sort_rank: 9 4 | --- 5 | -------------------------------------------------------------------------------- /docs/configuration/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Configuration 3 | sort_rank: 3 4 | --- 5 | -------------------------------------------------------------------------------- /docs/images/remote_integrations.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/mimir-prometheus/49aee40e890e160b76f81dcb65c03031cc702dc5/docs/images/remote_integrations.png -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | # todo: internal 3 | --- 4 | 5 | # Prometheus 6 | 7 | Welcome to the documentation of the Prometheus server. 8 | 9 | The documentation is available alongside all the project documentation at 10 | [prometheus.io](https://prometheus.io/docs/prometheus/latest/). 11 | 12 | ## Content 13 | 14 | - [Getting started](getting_started.md) 15 | - [Installation](installation.md) 16 | - [Configuration](configuration/configuration.md) 17 | - [Querying](querying/basics.md) 18 | - [Storage](storage.md) 19 | - [Federation](federation.md) 20 | - [Migration](migration.md) 21 | -------------------------------------------------------------------------------- /docs/querying/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Querying 3 | sort_rank: 4 4 | --- 5 | -------------------------------------------------------------------------------- /documentation/examples/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The Prometheus Authors 2 | # Licensed under the Apache License, Version 2.0 (the "License"); 3 | # you may not use this file except in compliance with the License. 4 | # You may obtain a copy of the License at 5 | # 6 | # http://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, 10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | # See the License for the specific language governing permissions and 12 | # limitations under the License. 13 | 14 | .PHONY: all 15 | all: check-examples-syntax 16 | 17 | .PHONY: check-examples-syntax 18 | check-examples-syntax: prometheus-*.yml 19 | @echo ">> check example configurations syntax" 20 | @set -e; for file in $^; do ../../promtool check config --syntax-only $$file; done 21 | -------------------------------------------------------------------------------- /documentation/examples/kubernetes-rabbitmq/rc.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ReplicationController 3 | metadata: 4 | name: rabbitmq 5 | spec: 6 | replicas: 1 7 | selector: 8 | app: rabbitmq 9 | template: 10 | metadata: 11 | name: rabbitmq 12 | labels: 13 | app: rabbitmq 14 | spec: 15 | containers: 16 | - image: rabbitmq:3.5.4-management 17 | name: rabbitmq 18 | ports: 19 | - containerPort: 5672 20 | name: service 21 | - containerPort: 15672 22 | name: management 23 | - image: kbudde/rabbitmq-exporter 24 | name: rabbitmq-exporter 25 | ports: 26 | - containerPort: 9090 27 | name: exporter 28 | -------------------------------------------------------------------------------- /documentation/examples/kubernetes-rabbitmq/svc.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: rabbitmq 5 | labels: 6 | name: rabbitmq 7 | spec: 8 | ports: 9 | - port: 9090 10 | name: exporter 11 | targetPort: exporter 12 | protocol: TCP 13 | selector: 14 | app: rabbitmq 15 | -------------------------------------------------------------------------------- /documentation/examples/prometheus-agent.yml: -------------------------------------------------------------------------------- 1 | # my global config 2 | global: 3 | scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute. 4 | evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute. 5 | # scrape_timeout is set to the global default (10s). 6 | 7 | # A scrape configuration containing exactly one endpoint to scrape: 8 | # Here it's Prometheus itself. 9 | scrape_configs: 10 | # The job name is added as a label `job=` to any timeseries scraped from this config. 11 | - job_name: "prometheus" 12 | 13 | # metrics_path defaults to '/metrics' 14 | # scheme defaults to 'http'. 15 | 16 | static_configs: 17 | - targets: ["localhost:9090"] 18 | 19 | # When running prometheus in Agent mode, remote-write is required. 20 | remote_write: 21 | # Agent is able to run with a invalid remote-write URL, but, of course, will fail to push timeseries. 22 | - url: "http://remote-write-url" 23 | -------------------------------------------------------------------------------- /documentation/examples/prometheus-digitalocean.yml: -------------------------------------------------------------------------------- 1 | # A example scrape configuration for running Prometheus with 2 | # DigitalOcean. 3 | 4 | scrape_configs: 5 | # Make Prometheus scrape itself for metrics. 6 | - job_name: "prometheus" 7 | static_configs: 8 | - targets: ["localhost:9090"] 9 | 10 | # Discover Node Exporter instances to scrape. 11 | - job_name: "node" 12 | 13 | digitalocean_sd_configs: 14 | - authorization: 15 | credentials: "" 16 | relabel_configs: 17 | # Only scrape targets that have a tag 'monitoring'. 18 | - source_labels: [__meta_digitalocean_tags] 19 | regex: ".*,monitoring,.*" 20 | action: keep 21 | 22 | # Use the public IPv6 address and port 9100 to scrape the target. 23 | - source_labels: [__meta_digitalocean_public_ipv6] 24 | target_label: __address__ 25 | replacement: "[$1]:9100" 26 | -------------------------------------------------------------------------------- /documentation/examples/prometheus-nomad.yml: -------------------------------------------------------------------------------- 1 | # An example scrape configuration for running Prometheus with 2 | # Nomad build in service discovery. 3 | # 4 | # The following config can be used to monitor services running on 5 | # a nomad that is started using the getting started tutorial [1] 6 | # 7 | # sudo nomad agent -dev -bind 0.0.0.0 -log-level INFO 8 | # 9 | # [1] https://learn.hashicorp.com/tutorials/nomad/get-started-run?in=nomad/get-started 10 | 11 | scrape_configs: 12 | # Make Prometheus scrape itself for metrics. 13 | - job_name: "prometheus" 14 | static_configs: 15 | - targets: ["localhost:9090"] 16 | 17 | # Discover Nomad services to scrape. 18 | - job_name: 'nomad_sd' 19 | nomad_sd_configs: 20 | - server: 'http://localhost:4646' 21 | relabel_configs: 22 | - source_labels: [__meta_nomad_service] 23 | target_label: job 24 | -------------------------------------------------------------------------------- /documentation/examples/prometheus-ovhcloud.yml: -------------------------------------------------------------------------------- 1 | # An example scrape configuration for running Prometheus with OVHcloud. 2 | scrape_configs: 3 | - job_name: 'ovhcloud' 4 | ovhcloud_sd_configs: 5 | - service: vps 6 | endpoint: ovh-eu 7 | application_key: XXX 8 | application_secret: XXX 9 | consumer_key: XXX 10 | refresh_interval: 1m 11 | - service: dedicated_server 12 | endpoint: ovh-eu 13 | application_key: XXX 14 | application_secret: XXX 15 | consumer_key: XXX 16 | refresh_interval: 1m 17 | -------------------------------------------------------------------------------- /documentation/examples/prometheus-vultr.yml: -------------------------------------------------------------------------------- 1 | # An example scrape configuration for running Prometheus with 2 | # Vultr. 3 | 4 | scrape_configs: 5 | # Make Prometheus scrape itself for metrics. 6 | - job_name: "prometheus" 7 | static_configs: 8 | - targets: ["localhost:9090"] 9 | 10 | # Discover Node Exporter instances to scrape. 11 | - job_name: "node" 12 | vultr_sd_configs: 13 | - authorization: 14 | credentials: "" 15 | relabel_configs: 16 | # Only scrape targets that have a tag 'monitoring'. 17 | - source_labels: [__meta_vultr_instance_tags] 18 | regex: ".*,monitoring,.*" 19 | action: keep 20 | 21 | # Use the public IPv6 address and port 9100 to scrape the target. 22 | - source_labels: [__meta_vultr_instance_main_ipv6] 23 | target_label: __address__ 24 | replacement: "[$1]:9100" 25 | -------------------------------------------------------------------------------- /documentation/examples/remote_storage/example_write_adapter/README.md: -------------------------------------------------------------------------------- 1 | ## Remote Write Adapter Example 2 | 3 | This is a simple example of how to write a server to 4 | receive samples from the remote storage output. 5 | 6 | To use it: 7 | 8 | ``` 9 | go build 10 | 11 | ./example_write_adapter 12 | ``` 13 | 14 | ...and then add the following to your `prometheus.yml`: 15 | 16 | ```yaml 17 | remote_write: 18 | - url: "http://localhost:1234/receive" 19 | protobuf_message: "io.prometheus.write.v2.Request" 20 | ``` 21 | 22 | or for the eventually deprecated Remote Write 1.0 message: 23 | 24 | ```yaml 25 | remote_write: 26 | - url: "http://localhost:1234/receive" 27 | protobuf_message: "prometheus.WriteRequest" 28 | ``` 29 | 30 | Then start Prometheus (in separate terminal): 31 | 32 | ``` 33 | ./prometheus --enable-feature=metadata-wal-records 34 | ``` 35 | -------------------------------------------------------------------------------- /documentation/examples/web-config.yml: -------------------------------------------------------------------------------- 1 | # TLS and basic authentication configuration example. 2 | # 3 | # Additionally, a certificate and a key file are needed. 4 | tls_server_config: 5 | cert_file: server.crt 6 | key_file: server.key 7 | 8 | # Usernames and passwords required to connect to Prometheus. 9 | # Passwords are hashed with bcrypt: https://github.com/prometheus/exporter-toolkit/blob/master/docs/web-configuration.md#about-bcrypt 10 | basic_auth_users: 11 | alice: $2y$10$mDwo.lAisC94iLAyP81MCesa29IzH37oigHC/42V2pdJlUprsJPze 12 | bob: $2y$10$hLqFl9jSjoAAy95Z/zw8Ye8wkdMBM8c5Bn1ptYqP/AXyV0.oy0S8m 13 | -------------------------------------------------------------------------------- /documentation/images/diagram_note.md: -------------------------------------------------------------------------------- 1 | The architecture image was drawn on https://app.diagrams.net/. The native draw.io 2 | source file is called `architecture.xml`, while `architecture.svg` is its SVG 3 | export. 4 | 5 | To change the architecture diagram, go to https://app.diagrams.net/ and import the 6 | XML source file. After making changes to the diagram, export the result as SVG. 7 | Update both the source file and the SVG export in this directory. 8 | -------------------------------------------------------------------------------- /documentation/prometheus-mixin/.gitignore: -------------------------------------------------------------------------------- 1 | *.yaml 2 | dashboards_out 3 | vendor 4 | jsonnetfile.lock.json 5 | -------------------------------------------------------------------------------- /documentation/prometheus-mixin/alerts.jsonnet: -------------------------------------------------------------------------------- 1 | std.manifestYamlDoc((import 'mixin.libsonnet').prometheusAlerts) 2 | -------------------------------------------------------------------------------- /documentation/prometheus-mixin/dashboards.jsonnet: -------------------------------------------------------------------------------- 1 | local dashboards = (import 'mixin.libsonnet').grafanaDashboards; 2 | 3 | { 4 | [name]: dashboards[name] 5 | for name in std.objectFields(dashboards) 6 | } 7 | -------------------------------------------------------------------------------- /documentation/prometheus-mixin/jsonnetfile.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "dependencies": [ 4 | { 5 | "source": { 6 | "git": { 7 | "remote": "https://github.com/grafana/grafonnet.git", 8 | "subdir": "gen/grafonnet-latest" 9 | } 10 | }, 11 | "version": "main" 12 | } 13 | ], 14 | "legacyImports": false 15 | } 16 | -------------------------------------------------------------------------------- /documentation/prometheus-mixin/mixin.libsonnet: -------------------------------------------------------------------------------- 1 | (import 'config.libsonnet') + 2 | (import 'dashboards.libsonnet') + 3 | (import 'alerts.libsonnet') 4 | -------------------------------------------------------------------------------- /model/metadata/metadata.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | package metadata 15 | 16 | import "github.com/prometheus/common/model" 17 | 18 | // Metadata stores a series' metadata information. 19 | type Metadata struct { 20 | Type model.MetricType `json:"type"` 21 | Unit string `json:"unit"` 22 | Help string `json:"help"` 23 | } 24 | -------------------------------------------------------------------------------- /model/rulefmt/testdata/bad_expr.bad.yaml: -------------------------------------------------------------------------------- 1 | groups: 2 | - name: yolo 3 | rules: 4 | - record: yolo 5 | expr: rate(hi) 6 | -------------------------------------------------------------------------------- /model/rulefmt/testdata/bad_field.bad.yaml: -------------------------------------------------------------------------------- 1 | groups: 2 | - name: yolo 3 | rules: 4 | - alert: hola 5 | expr: 1 6 | labels: 7 | instance: localhost 8 | annotation: 9 | summary: annotations is written without s above 10 | -------------------------------------------------------------------------------- /model/rulefmt/testdata/duplicate_grp.bad.yaml: -------------------------------------------------------------------------------- 1 | groups: 2 | - name: yolo 3 | - name: yolo 4 | -------------------------------------------------------------------------------- /model/rulefmt/testdata/invalid_label_name.bad.yaml: -------------------------------------------------------------------------------- 1 | groups: 2 | - name: yolo 3 | rules: 4 | - record: hola 5 | expr: 1 6 | labels: 7 | __name__: anything 8 | -------------------------------------------------------------------------------- /model/rulefmt/testdata/invalid_record_name.bad.yaml: -------------------------------------------------------------------------------- 1 | groups: 2 | - name: yolo 3 | rules: 4 | - record: strawberry{flavor="sweet"} 5 | expr: 1 6 | -------------------------------------------------------------------------------- /model/rulefmt/testdata/no_rec_alert.bad.yaml: -------------------------------------------------------------------------------- 1 | groups: 2 | - name: yolo 3 | rules: 4 | - expr: 1 5 | -------------------------------------------------------------------------------- /model/rulefmt/testdata/noexpr.bad.yaml: -------------------------------------------------------------------------------- 1 | groups: 2 | - name: yolo 3 | rules: 4 | - record: ylo 5 | -------------------------------------------------------------------------------- /model/rulefmt/testdata/record_and_alert.bad.yaml: -------------------------------------------------------------------------------- 1 | groups: 2 | - name: yolo 3 | rules: 4 | - record: Hi 5 | alert: Hello 6 | expr: 1 7 | -------------------------------------------------------------------------------- /model/rulefmt/testdata/record_and_for.bad.yaml: -------------------------------------------------------------------------------- 1 | groups: 2 | - name: yolo 3 | rules: 4 | - record: Hello 5 | expr: 1 6 | for: 1m 7 | -------------------------------------------------------------------------------- /model/rulefmt/testdata/record_and_keep_firing_for.bad.yaml: -------------------------------------------------------------------------------- 1 | groups: 2 | - name: yolo 3 | rules: 4 | - record: Hello 5 | expr: 1 6 | keep_firing_for: 1m 7 | -------------------------------------------------------------------------------- /model/rulefmt/testdata/utf-8_annotation.good.yaml: -------------------------------------------------------------------------------- 1 | groups: 2 | - name: yolo 3 | rules: 4 | - alert: hola 5 | expr: 1 6 | annotations: 7 | ins-tance: localhost 8 | -------------------------------------------------------------------------------- /model/rulefmt/testdata/utf-8_lname.good.yaml: -------------------------------------------------------------------------------- 1 | groups: 2 | - name: yolo 3 | rules: 4 | - record: hola 5 | expr: 1 6 | labels: 7 | ins-tance: localhost 8 | -------------------------------------------------------------------------------- /model/textparse/README.md: -------------------------------------------------------------------------------- 1 | # Making changes to textparse lexers 2 | In the rare case that you need to update the textparse lexers, edit promlex.l or openmetricslex.l and then run the following command: 3 | `golex -o=promlex.l.go promlex.l` 4 | 5 | Note that you need golex installed: 6 | `go get -u modernc.org/golex` -------------------------------------------------------------------------------- /plugins/minimum.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | package plugins 15 | 16 | import ( 17 | _ "github.com/prometheus/prometheus/discovery/file" // Register file plugin. 18 | _ "github.com/prometheus/prometheus/discovery/http" // Register http plugin. 19 | ) 20 | -------------------------------------------------------------------------------- /prompb/README.md: -------------------------------------------------------------------------------- 1 | The compiled protobufs are version controlled and you won't normally need to 2 | re-compile them when building Prometheus. 3 | 4 | If however you have modified the defs and do need to re-compile, run 5 | `make proto` from the parent dir. 6 | 7 | In order for the [script](../scripts/genproto.sh) to run, you'll need `protoc` (version 3.15.8) in 8 | your PATH. 9 | 10 | -------------------------------------------------------------------------------- /prompb/buf.gen.yaml: -------------------------------------------------------------------------------- 1 | version: v2 2 | plugins: 3 | - local: protoc-gen-gogofast 4 | out: . 5 | opt: [plugins=grpc, paths=source_relative, Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types] 6 | -------------------------------------------------------------------------------- /prompb/buf.lock: -------------------------------------------------------------------------------- 1 | # Generated by buf. DO NOT EDIT. 2 | version: v1 3 | deps: 4 | - remote: buf.build 5 | owner: gogo 6 | repository: protobuf 7 | commit: e1dbca2775a74a89955a99990de45a53 8 | digest: shake256:2523041b61927813260d369e632adb1938da2e9a0e10c42c6fca1b38acdb04661046bf20a2d99a7c9fb69676a63f9655147667dca8d49cea1644114fa97c0add 9 | -------------------------------------------------------------------------------- /prompb/buf.yaml: -------------------------------------------------------------------------------- 1 | version: v1 2 | name: buf.build/prometheus/prometheus 3 | lint: 4 | ignore_only: 5 | ENUM_VALUE_PREFIX: 6 | - remote.proto 7 | - types.proto 8 | - io/prometheus/client/metrics.proto 9 | ENUM_ZERO_VALUE_SUFFIX: 10 | - remote.proto 11 | - types.proto 12 | - io/prometheus/client/metrics.proto 13 | PACKAGE_DIRECTORY_MATCH: 14 | - remote.proto 15 | - types.proto 16 | PACKAGE_VERSION_SUFFIX: 17 | - remote.proto 18 | - types.proto 19 | - io/prometheus/client/metrics.proto 20 | deps: 21 | - buf.build/gogo/protobuf 22 | -------------------------------------------------------------------------------- /promql/fuzz-data/ParseExpr/corpus/from_tests_1: -------------------------------------------------------------------------------- 1 | 1 2 | -------------------------------------------------------------------------------- /promql/fuzz-data/ParseExpr/corpus/from_tests_10: -------------------------------------------------------------------------------- 1 | 0755 2 | -------------------------------------------------------------------------------- /promql/fuzz-data/ParseExpr/corpus/from_tests_11: -------------------------------------------------------------------------------- 1 | +5.5e-3 2 | -------------------------------------------------------------------------------- /promql/fuzz-data/ParseExpr/corpus/from_tests_12: -------------------------------------------------------------------------------- 1 | -0755 2 | -------------------------------------------------------------------------------- /promql/fuzz-data/ParseExpr/corpus/from_tests_13: -------------------------------------------------------------------------------- 1 | 1 + 1 2 | -------------------------------------------------------------------------------- /promql/fuzz-data/ParseExpr/corpus/from_tests_14: -------------------------------------------------------------------------------- 1 | 1 - 1 2 | -------------------------------------------------------------------------------- /promql/fuzz-data/ParseExpr/corpus/from_tests_15: -------------------------------------------------------------------------------- 1 | 1 * 1 2 | -------------------------------------------------------------------------------- /promql/fuzz-data/ParseExpr/corpus/from_tests_16: -------------------------------------------------------------------------------- 1 | 1 % 1 2 | -------------------------------------------------------------------------------- /promql/fuzz-data/ParseExpr/corpus/from_tests_17: -------------------------------------------------------------------------------- 1 | 1 / 1 2 | -------------------------------------------------------------------------------- /promql/fuzz-data/ParseExpr/corpus/from_tests_18: -------------------------------------------------------------------------------- 1 | 1 == 1 2 | -------------------------------------------------------------------------------- /promql/fuzz-data/ParseExpr/corpus/from_tests_19: -------------------------------------------------------------------------------- 1 | 1 != 1 2 | -------------------------------------------------------------------------------- /promql/fuzz-data/ParseExpr/corpus/from_tests_2: -------------------------------------------------------------------------------- 1 | +Inf 2 | -------------------------------------------------------------------------------- /promql/fuzz-data/ParseExpr/corpus/from_tests_20: -------------------------------------------------------------------------------- 1 | 1 > 1 2 | -------------------------------------------------------------------------------- /promql/fuzz-data/ParseExpr/corpus/from_tests_21: -------------------------------------------------------------------------------- 1 | 1 >= 1 2 | -------------------------------------------------------------------------------- /promql/fuzz-data/ParseExpr/corpus/from_tests_22: -------------------------------------------------------------------------------- 1 | 1 < 1 2 | -------------------------------------------------------------------------------- /promql/fuzz-data/ParseExpr/corpus/from_tests_23: -------------------------------------------------------------------------------- 1 | 1 <= 1 2 | -------------------------------------------------------------------------------- /promql/fuzz-data/ParseExpr/corpus/from_tests_24: -------------------------------------------------------------------------------- 1 | +1 + -2 * 1 2 | -------------------------------------------------------------------------------- /promql/fuzz-data/ParseExpr/corpus/from_tests_25: -------------------------------------------------------------------------------- 1 | 1 + 2/(3*1) 2 | -------------------------------------------------------------------------------- /promql/fuzz-data/ParseExpr/corpus/from_tests_26: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /promql/fuzz-data/ParseExpr/corpus/from_tests_27: -------------------------------------------------------------------------------- 1 | #comment 2 | -------------------------------------------------------------------------------- /promql/fuzz-data/ParseExpr/corpus/from_tests_28: -------------------------------------------------------------------------------- 1 | foo * bar 2 | -------------------------------------------------------------------------------- /promql/fuzz-data/ParseExpr/corpus/from_tests_29: -------------------------------------------------------------------------------- 1 | foo == 1 2 | -------------------------------------------------------------------------------- /promql/fuzz-data/ParseExpr/corpus/from_tests_3: -------------------------------------------------------------------------------- 1 | -Inf 2 | -------------------------------------------------------------------------------- /promql/fuzz-data/ParseExpr/corpus/from_tests_30: -------------------------------------------------------------------------------- 1 | 2.5 / bar 2 | -------------------------------------------------------------------------------- /promql/fuzz-data/ParseExpr/corpus/from_tests_31: -------------------------------------------------------------------------------- 1 | foo and bar 2 | -------------------------------------------------------------------------------- /promql/fuzz-data/ParseExpr/corpus/from_tests_32: -------------------------------------------------------------------------------- 1 | foo or bar 2 | -------------------------------------------------------------------------------- /promql/fuzz-data/ParseExpr/corpus/from_tests_33: -------------------------------------------------------------------------------- 1 | foo + bar or bla and blub 2 | -------------------------------------------------------------------------------- /promql/fuzz-data/ParseExpr/corpus/from_tests_34: -------------------------------------------------------------------------------- 1 | bar + on(foo) bla / on(baz, buz) group_right(test) blub 2 | -------------------------------------------------------------------------------- /promql/fuzz-data/ParseExpr/corpus/from_tests_4: -------------------------------------------------------------------------------- 1 | .5 2 | -------------------------------------------------------------------------------- /promql/fuzz-data/ParseExpr/corpus/from_tests_5: -------------------------------------------------------------------------------- 1 | 5. 2 | -------------------------------------------------------------------------------- /promql/fuzz-data/ParseExpr/corpus/from_tests_6: -------------------------------------------------------------------------------- 1 | 123.4567 2 | -------------------------------------------------------------------------------- /promql/fuzz-data/ParseExpr/corpus/from_tests_7: -------------------------------------------------------------------------------- 1 | 5e-3 2 | -------------------------------------------------------------------------------- /promql/fuzz-data/ParseExpr/corpus/from_tests_8: -------------------------------------------------------------------------------- 1 | 5e3 2 | -------------------------------------------------------------------------------- /promql/fuzz-data/ParseExpr/corpus/from_tests_9: -------------------------------------------------------------------------------- 1 | 0xc 2 | -------------------------------------------------------------------------------- /promql/fuzz-data/ParseMetric/corpus/982cbe5ad899f03c630b1a21876a206707ea3dc9: -------------------------------------------------------------------------------- 1 | o { quantile = "1.0", a = "b" } 8.3835e-05 2 | -------------------------------------------------------------------------------- /promql/fuzz-data/ParseMetric/corpus/exposition_formats_0: -------------------------------------------------------------------------------- 1 | # HELP api_http_request_count The total number of HTTP requests. 2 | # TYPE api_http_request_count counter 3 | http_request_count{method="post",code="200"} 1027 1395066363000 4 | -------------------------------------------------------------------------------- /promql/fuzz-data/ParseMetric/corpus/exposition_formats_1: -------------------------------------------------------------------------------- 1 | msdos_file_access_time_ms{path="C:\\DIR\\FILE.TXT",error="Cannot find file:\n\"FILE.TXT\""} 1.234e3 2 | -------------------------------------------------------------------------------- /promql/fuzz-data/ParseMetric/corpus/exposition_formats_2: -------------------------------------------------------------------------------- 1 | metric_without_timestamp_and_labels 12.47 2 | -------------------------------------------------------------------------------- /promql/fuzz-data/ParseMetric/corpus/exposition_formats_3: -------------------------------------------------------------------------------- 1 | something_weird{problem="division by zero"} +Inf -3982045 2 | -------------------------------------------------------------------------------- /promql/fuzz-data/ParseMetric/corpus/exposition_formats_4: -------------------------------------------------------------------------------- 1 | http_request_duration_seconds_bucket{le="+Inf"} 144320 2 | -------------------------------------------------------------------------------- /promql/fuzz-data/ParseMetric/corpus/exposition_formats_5: -------------------------------------------------------------------------------- 1 | go_gc_duration_seconds{ quantile="0.9", a="b"} 8.3835e-05 2 | -------------------------------------------------------------------------------- /promql/fuzz-data/ParseMetric/corpus/exposition_formats_6: -------------------------------------------------------------------------------- 1 | go_gc_duration_seconds{ quantile="1.0", a="b" } 8.3835e-05 2 | -------------------------------------------------------------------------------- /promql/fuzz-data/ParseMetric/corpus/exposition_formats_7: -------------------------------------------------------------------------------- 1 | go_gc_duration_seconds { quantile = "1.0", a = "b" } 8.3835e-05 2 | -------------------------------------------------------------------------------- /promql/promqltest/testdata/literals.test: -------------------------------------------------------------------------------- 1 | eval instant at 50m 12.34e6 2 | 12340000 3 | 4 | eval instant at 50m 12.34e+6 5 | 12340000 6 | 7 | eval instant at 50m 12.34e-6 8 | 0.00001234 9 | 10 | eval instant at 50m 1+1 11 | 2 12 | 13 | eval instant at 50m 1-1 14 | 0 15 | 16 | eval instant at 50m 1 - -1 17 | 2 18 | 19 | eval instant at 50m .2 20 | 0.2 21 | 22 | eval instant at 50m +0.2 23 | 0.2 24 | 25 | eval instant at 50m -0.2e-6 26 | -0.0000002 27 | 28 | eval instant at 50m +Inf 29 | +Inf 30 | 31 | eval instant at 50m inF 32 | +Inf 33 | 34 | eval instant at 50m -inf 35 | -Inf 36 | 37 | eval instant at 50m NaN 38 | NaN 39 | 40 | eval instant at 50m nan 41 | NaN 42 | 43 | eval instant at 50m 2. 44 | 2 45 | 46 | eval instant at 50m 1 / 0 47 | +Inf 48 | 49 | eval instant at 50m ((1) / (0)) 50 | +Inf 51 | 52 | eval instant at 50m -1 / 0 53 | -Inf 54 | 55 | eval instant at 50m 0 / 0 56 | NaN 57 | 58 | eval instant at 50m 1 % 0 59 | NaN 60 | -------------------------------------------------------------------------------- /rules/fixtures/alert_rule.yaml: -------------------------------------------------------------------------------- 1 | groups: 2 | - name: test 3 | interval: 1s 4 | rules: 5 | - alert: rule1 6 | expr: 1 < bool 2 7 | -------------------------------------------------------------------------------- /rules/fixtures/alert_rule1.yaml: -------------------------------------------------------------------------------- 1 | groups: 2 | - name: test2 3 | interval: 1s 4 | rules: 5 | - alert: rule2 6 | expr: 1 < bool 2 7 | -------------------------------------------------------------------------------- /rules/fixtures/invalid_rules.yaml: -------------------------------------------------------------------------------- 1 | groups: 2 | - name: invalid 3 | rules: 4 | - record: job:http_requests:rate5m 5 | expr: sum by (job)(rate(http_requests_total[5m])) 6 | unexpected_field: this_field_should_not_be_here 7 | -------------------------------------------------------------------------------- /rules/fixtures/rules.yaml: -------------------------------------------------------------------------------- 1 | groups: 2 | - name: test 3 | rules: 4 | - record: job:http_requests:rate5m 5 | expr: sum by (job)(rate(http_requests_total[5m])) 6 | -------------------------------------------------------------------------------- /rules/fixtures/rules1.yaml: -------------------------------------------------------------------------------- 1 | groups: 2 | - name: test_1 3 | rules: 4 | - record: test_2 5 | expr: vector(2) 6 | -------------------------------------------------------------------------------- /rules/fixtures/rules2.yaml: -------------------------------------------------------------------------------- 1 | groups: 2 | - name: test_2 3 | rules: 4 | - record: test_2 5 | expr: vector(2) 6 | -------------------------------------------------------------------------------- /rules/fixtures/rules2_copy.yaml: -------------------------------------------------------------------------------- 1 | groups: 2 | - name: test_2 copy 3 | rules: 4 | - record: test_2 5 | expr: vector(2) 6 | -------------------------------------------------------------------------------- /rules/fixtures/rules_dependencies.yaml: -------------------------------------------------------------------------------- 1 | groups: 2 | - name: test 3 | rules: 4 | - record: job:http_requests:rate5m 5 | expr: sum by (job)(rate(http_requests_total[5m])) 6 | - record: HighRequestRate 7 | expr: job:http_requests:rate5m > 100 8 | -------------------------------------------------------------------------------- /rules/fixtures/rules_indeterminates.yaml: -------------------------------------------------------------------------------- 1 | groups: 2 | - name: indeterminate 3 | rules: 4 | # This shouldn't run in parallel because of the open matcher 5 | - record: job:http_requests:rate1m 6 | expr: sum by (job)(rate(http_requests_total[1m])) 7 | - record: job:http_requests:rate5m 8 | expr: sum by (job)(rate(http_requests_total[5m])) 9 | - record: job:http_requests:rate15m 10 | expr: sum by (job)(rate(http_requests_total[15m])) 11 | - record: job:http_requests:rate30m 12 | expr: sum by (job)(rate(http_requests_total[30m])) 13 | - record: job:http_requests:rate1h 14 | expr: sum by (job)(rate(http_requests_total[1h])) 15 | - record: job:http_requests:rate2h 16 | expr: sum by (job)(rate(http_requests_total[2h])) 17 | - record: matcher 18 | expr: '{job="job1"}' 19 | -------------------------------------------------------------------------------- /rules/fixtures/rules_multiple.yaml: -------------------------------------------------------------------------------- 1 | groups: 2 | - name: test 3 | rules: 4 | # independents 5 | - record: job:http_requests:rate1m 6 | expr: sum by (job)(rate(http_requests_total[1m])) 7 | - record: job:http_requests:rate5m 8 | expr: sum by (job)(rate(http_requests_total[5m])) 9 | 10 | # dependents 11 | - record: job:http_requests:rate15m 12 | expr: sum by (job)(rate(http_requests_total[15m])) 13 | - record: TooManyRequests 14 | expr: job:http_requests:rate15m > 100 15 | -------------------------------------------------------------------------------- /rules/fixtures/rules_multiple_independent.yaml: -------------------------------------------------------------------------------- 1 | groups: 2 | - name: independents 3 | rules: 4 | - record: job:http_requests:rate1m 5 | expr: sum by (job)(rate(http_requests_total[1m])) 6 | - record: job:http_requests:rate5m 7 | expr: sum by (job)(rate(http_requests_total[5m])) 8 | - record: job:http_requests:rate15m 9 | expr: sum by (job)(rate(http_requests_total[15m])) 10 | - record: job:http_requests:rate30m 11 | expr: sum by (job)(rate(http_requests_total[30m])) 12 | - record: job:http_requests:rate1h 13 | expr: sum by (job)(rate(http_requests_total[1h])) 14 | - record: job:http_requests:rate2h 15 | expr: sum by (job)(rate(http_requests_total[2h])) 16 | -------------------------------------------------------------------------------- /rules/fixtures/rules_with_alignment.yaml: -------------------------------------------------------------------------------- 1 | groups: 2 | - name: aligned 3 | align_evaluation_time_on_interval: true 4 | interval: 5m 5 | rules: 6 | - record: job:http_requests:rate5m 7 | expr: sum by (job)(rate(http_requests_total[5m])) 8 | 9 | - name: aligned_with_crazy_interval 10 | align_evaluation_time_on_interval: true 11 | interval: 1m27s 12 | rules: 13 | - record: job:http_requests:rate5m 14 | expr: sum by (job)(rate(http_requests_total[5m])) 15 | 16 | - name: unaligned_default 17 | interval: 5m 18 | rules: 19 | - record: job:http_requests:rate5m 20 | expr: sum by (job)(rate(http_requests_total[5m])) 21 | 22 | - name: unaligned_explicit 23 | interval: 5m 24 | align_evaluation_time_on_interval: false 25 | rules: 26 | - record: job:http_requests:rate5m 27 | expr: sum by (job)(rate(http_requests_total[5m])) 28 | -------------------------------------------------------------------------------- /rules/fixtures/rules_with_source_tenants.yaml: -------------------------------------------------------------------------------- 1 | groups: 2 | - name: test 3 | rules: 4 | - record: job:http_requests:rate5m 5 | expr: sum by (job)(rate(http_requests_total[5m])) 6 | source_tenants: [tenant-1, tenant-2] 7 | -------------------------------------------------------------------------------- /scrape/testdata/bearertoken.txt: -------------------------------------------------------------------------------- 1 | 12345 2 | -------------------------------------------------------------------------------- /scripts/check-go-mod-version.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | readarray -t mod_files < <(find . -type f -name go.mod) 4 | 5 | echo "Checking files ${mod_files[@]}" 6 | 7 | matches=$(awk '$1 == "go" {print $2}' "${mod_files[@]}" | sort -u | wc -l) 8 | 9 | if [[ "${matches}" -ne 1 ]]; then 10 | echo 'Not all go.mod files have matching go versions' 11 | exit 1 12 | fi 13 | -------------------------------------------------------------------------------- /scripts/get_module_version.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # if no version string is passed as an argument, read VERSION file 4 | if [ $# -eq 0 ]; then 5 | VERSION="$(< VERSION)" 6 | else 7 | VERSION=$1 8 | fi 9 | 10 | 11 | # Remove leading 'v' if present 12 | VERSION="${VERSION#v}" 13 | 14 | # Extract MAJOR, MINOR, and REST 15 | MAJOR="${VERSION%%.*}" 16 | MINOR="${VERSION#*.}"; MINOR="${MINOR%%.*}" 17 | REST="${VERSION#*.*.}" 18 | 19 | # Format and output based on MAJOR version 20 | if [[ "$MAJOR" == "2" ]]; then 21 | echo "0.$MINOR.$REST" 22 | elif [[ "$MAJOR" == "3" ]]; then 23 | printf "0.3%02d.$REST\n" "$MINOR" 24 | fi 25 | -------------------------------------------------------------------------------- /scripts/npm-deps.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | current=$(pwd) 6 | root_ui_folder=${current}/web/ui 7 | 8 | function ncu() { 9 | target=$1 10 | npx npm-check-updates -u --target "${target}" 11 | } 12 | 13 | cd "${root_ui_folder}" 14 | 15 | for workspace in $(jq -r '.workspaces[]' < package.json); do 16 | cd "${workspace}" 17 | ncu "$1" 18 | cd "${root_ui_folder}" 19 | done 20 | 21 | ncu "$1" 22 | npm install 23 | -------------------------------------------------------------------------------- /scripts/package_assets.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # compress static assets 4 | 5 | set -euo pipefail 6 | 7 | version="$(< VERSION)" 8 | mkdir -p .tarballs 9 | cd web/ui 10 | find static -type f -not -name '*.gz' -print0 | xargs -0 tar czf ../../.tarballs/prometheus-web-ui-${version}.tar.gz 11 | -------------------------------------------------------------------------------- /storage/remote/azuread/README.md: -------------------------------------------------------------------------------- 1 | azuread package 2 | ========================================= 3 | 4 | azuread provides an http.RoundTripper that attaches an Azure AD accessToken 5 | to remote write requests. 6 | 7 | This module is considered internal to Prometheus, without any stability 8 | guarantees for external usage. 9 | -------------------------------------------------------------------------------- /storage/remote/azuread/testdata/azuread_bad_configmissing.yaml: -------------------------------------------------------------------------------- 1 | cloud: AzurePublic 2 | -------------------------------------------------------------------------------- /storage/remote/azuread/testdata/azuread_bad_invalidclientid.yaml: -------------------------------------------------------------------------------- 1 | cloud: AzurePublic 2 | managed_identity: 3 | client_id: foo-foobar-bar-foo-00000000 4 | -------------------------------------------------------------------------------- /storage/remote/azuread/testdata/azuread_bad_invalidoauthconfig.yaml: -------------------------------------------------------------------------------- 1 | cloud: AzurePublic 2 | oauth: 3 | client_id: 00000000-0000-0000-0000-000000000000 4 | client_secret: Cl1ent$ecret! 5 | -------------------------------------------------------------------------------- /storage/remote/azuread/testdata/azuread_bad_oauthsdkconfig.yaml: -------------------------------------------------------------------------------- 1 | cloud: AzurePublic 2 | oauth: 3 | client_id: 00000000-0000-0000-0000-000000000000 4 | client_secret: Cl1ent$ecret! 5 | tenant_id: 00000000-a12b-3cd4-e56f-000000000000 6 | sdk: 7 | tenant_id: 00000000-a12b-3cd4-e56f-000000000000 8 | -------------------------------------------------------------------------------- /storage/remote/azuread/testdata/azuread_bad_twoconfig.yaml: -------------------------------------------------------------------------------- 1 | cloud: AzurePublic 2 | managed_identity: 3 | client_id: 00000000-0000-0000-0000-000000000000 4 | oauth: 5 | client_id: 00000000-0000-0000-0000-000000000000 6 | client_secret: Cl1ent$ecret! 7 | tenant_id: 00000000-a12b-3cd4-e56f-000000000000 8 | -------------------------------------------------------------------------------- /storage/remote/azuread/testdata/azuread_good_cloudmissing.yaml: -------------------------------------------------------------------------------- 1 | managed_identity: 2 | client_id: 00000000-0000-0000-0000-000000000000 3 | -------------------------------------------------------------------------------- /storage/remote/azuread/testdata/azuread_good_defaultmanagedidentity.yaml: -------------------------------------------------------------------------------- 1 | cloud: AzurePublic 2 | managed_identity: 3 | client_id: 4 | -------------------------------------------------------------------------------- /storage/remote/azuread/testdata/azuread_good_oauth.yaml: -------------------------------------------------------------------------------- 1 | cloud: AzurePublic 2 | oauth: 3 | client_id: 00000000-0000-0000-0000-000000000000 4 | client_secret: Cl1ent$ecret! 5 | tenant_id: 00000000-a12b-3cd4-e56f-000000000000 6 | -------------------------------------------------------------------------------- /storage/remote/azuread/testdata/azuread_good_sdk.yaml: -------------------------------------------------------------------------------- 1 | cloud: AzurePublic 2 | sdk: 3 | tenant_id: 00000000-a12b-3cd4-e56f-000000000000 4 | -------------------------------------------------------------------------------- /storage/remote/azuread/testdata/azuread_good_specificmanagedidentity.yaml: -------------------------------------------------------------------------------- 1 | cloud: AzurePublic 2 | managed_identity: 3 | client_id: 00000000-0000-0000-0000-000000000000 4 | -------------------------------------------------------------------------------- /tsdb/.gitignore: -------------------------------------------------------------------------------- 1 | benchout/ 2 | -------------------------------------------------------------------------------- /tsdb/addsymbol.go: -------------------------------------------------------------------------------- 1 | //go:build !stringlabels 2 | 3 | // Split out function which needs to be coded differently for stringlabels case. 4 | 5 | package tsdb 6 | 7 | func (sw *symbolsBatcher) addSymbol(sym string) error { 8 | sw.buffer[sym] = struct{}{} 9 | return sw.flushSymbols(false) 10 | } 11 | -------------------------------------------------------------------------------- /tsdb/addsymbol_stringlabels.go: -------------------------------------------------------------------------------- 1 | //go:build stringlabels 2 | 3 | // Split out function which needs to be coded differently for stringlabels case. 4 | 5 | package tsdb 6 | 7 | import "strings" 8 | 9 | func (sw *symbolsBatcher) addSymbol(sym string) error { 10 | if _, found := sw.buffer[sym]; !found { 11 | sym = strings.Clone(sym) // So we don't retain reference to the entire labels block. 12 | sw.buffer[sym] = struct{}{} 13 | } 14 | return sw.flushSymbols(false) 15 | } 16 | -------------------------------------------------------------------------------- /tsdb/chunks/head_chunks_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | package chunks 15 | 16 | // HeadChunkFilePreallocationSize is the size to which the m-map file should be preallocated when a new file is cut. 17 | // Windows needs pre-allocation to m-map the file. 18 | var HeadChunkFilePreallocationSize int64 = MaxHeadChunkFileSize 19 | -------------------------------------------------------------------------------- /tsdb/docs/format/README.md: -------------------------------------------------------------------------------- 1 | ## TSDB format 2 | 3 | * [Index](index.md) 4 | * [Chunks](chunks.md) 5 | * [Head Chunks](head_chunks.md) 6 | * [Tombstones](tombstones.md) 7 | * [Wal](wal.md) 8 | * [Memory Snapshot](memory_snapshot.md) 9 | -------------------------------------------------------------------------------- /tsdb/fileutil/dir_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | //go:build !windows 16 | 17 | package fileutil 18 | 19 | import "os" 20 | 21 | // OpenDir opens a directory for syncing. 22 | func OpenDir(path string) (*os.File, error) { return os.Open(path) } 23 | -------------------------------------------------------------------------------- /tsdb/fileutil/mmap_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | //go:build windows 15 | 16 | package fileutil 17 | 18 | const maxMapSize = 0x7FFFFFFF // 2GB 19 | -------------------------------------------------------------------------------- /tsdb/fileutil/mmap_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | //go:build windows 15 | 16 | package fileutil 17 | 18 | const maxMapSize = 0xFFFFFFFFFFFF // 256TB 19 | -------------------------------------------------------------------------------- /tsdb/fileutil/mmap_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | //go:build windows 15 | 16 | package fileutil 17 | 18 | const maxMapSize = 0xFFFFFFFFFFFF // 256TB 19 | -------------------------------------------------------------------------------- /tsdb/fileutil/mmap_js.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | //go:build js 15 | 16 | package fileutil 17 | 18 | import ( 19 | "errors" 20 | "os" 21 | ) 22 | 23 | func mmap(f *os.File, length int) ([]byte, error) { 24 | return nil, errors.New("unsupported") 25 | } 26 | 27 | func munmap(b []byte) (err error) { 28 | return errors.New("unsupported") 29 | } 30 | -------------------------------------------------------------------------------- /tsdb/fileutil/preallocate_other.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | //go:build !linux && !darwin 16 | 17 | package fileutil 18 | 19 | import "os" 20 | 21 | func preallocExtend(f *os.File, sizeInBytes int64) error { 22 | return preallocExtendTrunc(f, sizeInBytes) 23 | } 24 | 25 | func preallocFixed(f *os.File, sizeInBytes int64) error { return nil } 26 | -------------------------------------------------------------------------------- /tsdb/fileutil/sync.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | //go:build !linux && !darwin 16 | 17 | package fileutil 18 | 19 | import "os" 20 | 21 | // Fdatasync is a wrapper around file.Sync(). Special handling is needed on linux platform. 22 | func Fdatasync(f *os.File) error { 23 | return f.Sync() 24 | } 25 | -------------------------------------------------------------------------------- /tsdb/fileutil/sync_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | //go:build darwin 16 | 17 | package fileutil 18 | 19 | import ( 20 | "os" 21 | ) 22 | 23 | // Fdatasync on darwin platform invokes fcntl(F_FULLFSYNC) for actual persistence 24 | // on physical drive media. 25 | func Fdatasync(f *os.File) error { 26 | return f.Sync() 27 | } 28 | -------------------------------------------------------------------------------- /tsdb/goversion/goversion.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | //go:build go1.12 15 | 16 | // Package goversion enforces the go version supported by the tsdb module. 17 | package goversion 18 | 19 | const _SoftwareRequiresGOVERSION1_12 = uint8(0) 20 | -------------------------------------------------------------------------------- /tsdb/goversion/init.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | package goversion 15 | 16 | // This will fail to compile if the Go runtime version isn't >= 1.12. 17 | var _ = _SoftwareRequiresGOVERSION1_12 18 | -------------------------------------------------------------------------------- /tsdb/head_read_mimir.go: -------------------------------------------------------------------------------- 1 | package tsdb 2 | 3 | import "math" 4 | 5 | func (h *Head) MustIndex() IndexReader { 6 | return h.indexRange(math.MinInt64, math.MaxInt64) 7 | } 8 | -------------------------------------------------------------------------------- /tsdb/testdata/index_format_v1/chunks/000001: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/mimir-prometheus/49aee40e890e160b76f81dcb65c03031cc702dc5/tsdb/testdata/index_format_v1/chunks/000001 -------------------------------------------------------------------------------- /tsdb/testdata/index_format_v1/index: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/mimir-prometheus/49aee40e890e160b76f81dcb65c03031cc702dc5/tsdb/testdata/index_format_v1/index -------------------------------------------------------------------------------- /tsdb/testdata/index_format_v1/meta.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "ulid": "01DXXFZDYD1MQW6079WK0K6EDQ", 4 | "minTime": 0, 5 | "maxTime": 7200000, 6 | "stats": { 7 | "numSamples": 102, 8 | "numSeries": 102, 9 | "numChunks": 102 10 | }, 11 | "compaction": { 12 | "level": 1, 13 | "sources": [ 14 | "01DXXFZDYD1MQW6079WK0K6EDQ" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /tsdb/testdata/index_format_v1/tombstones: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/mimir-prometheus/49aee40e890e160b76f81dcb65c03031cc702dc5/tsdb/testdata/index_format_v1/tombstones -------------------------------------------------------------------------------- /tsdb/testdata/repair_index_version/01BZJ9WJQPWHGNC2W4J9TA62KC/index: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/mimir-prometheus/49aee40e890e160b76f81dcb65c03031cc702dc5/tsdb/testdata/repair_index_version/01BZJ9WJQPWHGNC2W4J9TA62KC/index -------------------------------------------------------------------------------- /tsdb/testdata/repair_index_version/01BZJ9WJQPWHGNC2W4J9TA62KC/meta.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "ulid": "01BZJ9WJQPWHGNC2W4J9TA62KC", 4 | "minTime": 1511366400000, 5 | "maxTime": 1511368200000, 6 | "stats": { 7 | "numSamples": 31897565, 8 | "numSeries": 88910, 9 | "numChunks": 266093 10 | }, 11 | "compaction": { 12 | "level": 1, 13 | "sources": [ 14 | "01BZJ9WJQPWHGNC2W4J9TA62KC" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /ui-commits: -------------------------------------------------------------------------------- 1 | dfec29d8e Fix border color for target pools with one target that is failing 2 | 65743bf9b ui: drop template readme 3 | a7c1a951d Add general Mantine overrides CSS file 4 | 0757fbbec Make sure that alert element table headers are not wrapped 5 | 0180cf31a Factor out common icon and card styles 6 | 50af7d589 Fix tree line drawing by using a callback ref 7 | ac01dc903 Explain, vector-to-vector: Do not compute results for set operators 8 | 9b0dc68d0 PromQL explain view: Support set operators 9 | 57898c792 Refactor and fix time formatting functions, add tests 10 | 091fc403c Fiddle with targets table styles to try and improve things a bit 11 | a1908df92 Don't wrap action buttons below metric name in metrics explorer 12 | ac5377873 mantine UI: Distinguish between Not Ready and Stopping 13 | -------------------------------------------------------------------------------- /util/runtime/limits_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | //go:build windows 15 | 16 | package runtime 17 | 18 | // FdLimits not supported on Windows 19 | func FdLimits() string { 20 | return "N/A" 21 | } 22 | 23 | // VMLimits not supported on Windows 24 | func VMLimits() string { 25 | return "N/A" 26 | } 27 | -------------------------------------------------------------------------------- /util/runtime/statfs.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | //go:build openbsd || windows || netbsd || solaris 15 | 16 | package runtime 17 | 18 | // Statfs returns the file system type (Unix only) 19 | // syscall.Statfs_t isn't available on openbsd 20 | func Statfs(path string) string { 21 | return "unknown" 22 | } 23 | -------------------------------------------------------------------------------- /util/runtime/uname_default.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | //go:build !linux 15 | 16 | package runtime 17 | 18 | import "runtime" 19 | 20 | // Uname for any platform other than linux. 21 | func Uname() string { 22 | return "(" + runtime.GOOS + ")" 23 | } 24 | -------------------------------------------------------------------------------- /util/runtime/vmlimits_default.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | //go:build !windows && !openbsd 15 | 16 | package runtime 17 | 18 | import ( 19 | "syscall" 20 | ) 21 | 22 | // VMLimits returns the soft and hard limits for virtual memory. 23 | func VMLimits() string { 24 | return getLimits(syscall.RLIMIT_AS, "b") 25 | } 26 | -------------------------------------------------------------------------------- /util/runtime/vmlimits_openbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | //go:build openbsd 15 | 16 | package runtime 17 | 18 | import ( 19 | "syscall" 20 | ) 21 | 22 | // VMLimits returns the soft and hard limits for virtual memory. 23 | func VMLimits() string { 24 | return getLimits(syscall.RLIMIT_DATA, "b") 25 | } 26 | -------------------------------------------------------------------------------- /web/ui/.gitignore: -------------------------------------------------------------------------------- 1 | *.gz 2 | embed.go 3 | -------------------------------------------------------------------------------- /web/ui/.nvmrc: -------------------------------------------------------------------------------- 1 | v20.5.1 2 | -------------------------------------------------------------------------------- /web/ui/assets_embed.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | //go:build builtinassets 15 | 16 | package ui 17 | 18 | import ( 19 | "net/http" 20 | 21 | "github.com/prometheus/common/assets" 22 | ) 23 | 24 | var Assets = http.FS(assets.New(EmbedFS)) 25 | -------------------------------------------------------------------------------- /web/ui/embed.go.tmpl: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | //go:build builtinassets 15 | // +build builtinassets 16 | 17 | package ui 18 | 19 | import "embed" 20 | 21 | -------------------------------------------------------------------------------- /web/ui/mantine-ui/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | -------------------------------------------------------------------------------- /web/ui/mantine-ui/postcss.config.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | 'postcss-preset-mantine': {}, 4 | 'postcss-simple-vars': { 5 | variables: { 6 | 'mantine-breakpoint-xs': '36em', 7 | 'mantine-breakpoint-sm': '48em', 8 | 'mantine-breakpoint-md': '62em', 9 | 'mantine-breakpoint-lg': '75em', 10 | 'mantine-breakpoint-xl': '88em', 11 | }, 12 | }, 13 | }, 14 | }; 15 | -------------------------------------------------------------------------------- /web/ui/mantine-ui/src/Panel.module.css: -------------------------------------------------------------------------------- 1 | .panelHealthOk { 2 | border-left: 5px solid 3 | light-dark(var(--mantine-color-green-3), var(--mantine-color-green-8)) !important; 4 | } 5 | 6 | .panelHealthErr { 7 | border-left: 5px solid 8 | light-dark(var(--mantine-color-red-3), var(--mantine-color-red-9)) !important; 9 | } 10 | 11 | .panelHealthWarn { 12 | border-left: 5px solid 13 | light-dark(var(--mantine-color-orange-3), var(--mantine-color-yellow-9)) !important; 14 | } 15 | 16 | .panelHealthUnknown { 17 | border-left: 5px solid 18 | light-dark(var(--mantine-color-gray-3), var(--mantine-color-gray-6)) !important; 19 | } 20 | -------------------------------------------------------------------------------- /web/ui/mantine-ui/src/api/responseTypes/alertmanagers.ts: -------------------------------------------------------------------------------- 1 | export type AlertmanagerTarget = { 2 | url: string; 3 | }; 4 | 5 | // Result type for /api/v1/alertmanagers endpoint. 6 | // See: https://prometheus.io/docs/prometheus/latest/querying/api/#alertmanagers 7 | export type AlertmanagersResult = { 8 | activeAlertmanagers: AlertmanagerTarget[]; 9 | droppedAlertmanagers: AlertmanagerTarget[]; 10 | }; 11 | -------------------------------------------------------------------------------- /web/ui/mantine-ui/src/api/responseTypes/config.ts: -------------------------------------------------------------------------------- 1 | // Result type for /api/v1/status/config endpoint. 2 | // See: https://prometheus.io/docs/prometheus/latest/querying/api/#config 3 | export default interface ConfigResult { 4 | yaml: string; 5 | } 6 | -------------------------------------------------------------------------------- /web/ui/mantine-ui/src/api/responseTypes/labelValues.ts: -------------------------------------------------------------------------------- 1 | // Result type for /api/v1/label//values endpoint. 2 | // See: https://prometheus.io/docs/prometheus/latest/querying/api/#querying-label-values 3 | export type LabelValuesResult = string[]; 4 | -------------------------------------------------------------------------------- /web/ui/mantine-ui/src/api/responseTypes/metadata.ts: -------------------------------------------------------------------------------- 1 | // Result type for /api/v1/alerts endpoint. 2 | // See: https://prometheus.io/docs/prometheus/latest/querying/api/#querying-target-metadata 3 | export type MetadataResult = Record< 4 | string, 5 | { type: string; help: string; unit: string }[] 6 | >; 7 | -------------------------------------------------------------------------------- /web/ui/mantine-ui/src/api/responseTypes/notifications.ts: -------------------------------------------------------------------------------- 1 | export interface Notification { 2 | text: string; 3 | date: string; 4 | active: boolean; 5 | modified: boolean; 6 | } 7 | 8 | export type NotificationsResult = Notification[]; 9 | -------------------------------------------------------------------------------- /web/ui/mantine-ui/src/api/responseTypes/scrapePools.ts: -------------------------------------------------------------------------------- 1 | // Result type for /api/v1/scrape_pools endpoint. 2 | export type ScrapePoolsResult = { scrapePools: string[] }; 3 | -------------------------------------------------------------------------------- /web/ui/mantine-ui/src/api/responseTypes/series.ts: -------------------------------------------------------------------------------- 1 | // Result type for /api/v1/series endpoint. 2 | 3 | import { Metric } from "./query"; 4 | 5 | // See: https://prometheus.io/docs/prometheus/latest/querying/api/#finding-series-by-label-matchers 6 | export type SeriesResult = Metric[]; 7 | -------------------------------------------------------------------------------- /web/ui/mantine-ui/src/api/responseTypes/targets.ts: -------------------------------------------------------------------------------- 1 | export interface Labels { 2 | [key: string]: string; 3 | } 4 | 5 | export type Target = { 6 | discoveredLabels: Labels; 7 | labels: Labels; 8 | scrapePool: string; 9 | scrapeUrl: string; 10 | globalUrl: string; 11 | lastError: string; 12 | lastScrape: string; 13 | lastScrapeDuration: number; 14 | health: string; 15 | scrapeInterval: string; 16 | scrapeTimeout: string; 17 | }; 18 | 19 | export interface DroppedTarget { 20 | discoveredLabels: Labels; 21 | scrapePool: string; 22 | } 23 | 24 | // Result type for /api/v1/targets endpoint. 25 | // See: https://prometheus.io/docs/prometheus/latest/querying/api/#targets 26 | export type TargetsResult = { 27 | activeTargets: Target[]; 28 | droppedTargets: DroppedTarget[]; 29 | droppedTargetCounts: Record; 30 | }; 31 | -------------------------------------------------------------------------------- /web/ui/mantine-ui/src/api/responseTypes/tsdbStatus.ts: -------------------------------------------------------------------------------- 1 | interface Stats { 2 | name: string; 3 | value: number; 4 | } 5 | 6 | interface HeadStats { 7 | numSeries: number; 8 | numLabelPairs: number; 9 | chunkCount: number; 10 | minTime: number; 11 | maxTime: number; 12 | } 13 | 14 | // Result type for /api/v1/status/tsdb endpoint. 15 | // See: https://prometheus.io/docs/prometheus/latest/querying/api/#tsdb-stats 16 | export interface TSDBStatusResult { 17 | headStats: HeadStats; 18 | seriesCountByMetricName: Stats[]; 19 | labelValueCountByLabelName: Stats[]; 20 | memoryInBytesByLabelName: Stats[]; 21 | seriesCountByLabelValuePair: Stats[]; 22 | } 23 | -------------------------------------------------------------------------------- /web/ui/mantine-ui/src/api/responseTypes/walreplay.ts: -------------------------------------------------------------------------------- 1 | // Result type for /api/v1/status/walreplay endpoint. 2 | // See: https://prometheus.io/docs/prometheus/latest/querying/api/#wal-replay-stats 3 | export interface WALReplayStatus { 4 | min: number; 5 | max: number; 6 | current: number; 7 | } 8 | -------------------------------------------------------------------------------- /web/ui/mantine-ui/src/components/InfoPageCard.tsx: -------------------------------------------------------------------------------- 1 | import { Card, Group } from "@mantine/core"; 2 | import { IconProps } from "@tabler/icons-react"; 3 | import { FC, ReactNode } from "react"; 4 | import { infoPageCardTitleIconStyle } from "../styles"; 5 | 6 | const InfoPageCard: FC<{ 7 | children: ReactNode; 8 | title?: string; 9 | icon?: React.ComponentType; 10 | }> = ({ children, title, icon: Icon }) => { 11 | return ( 12 | 13 | {title && ( 14 | 23 | {Icon && } 24 | {title} 25 | 26 | )} 27 | {children} 28 | 29 | ); 30 | }; 31 | 32 | export default InfoPageCard; 33 | -------------------------------------------------------------------------------- /web/ui/mantine-ui/src/components/InfoPageStack.tsx: -------------------------------------------------------------------------------- 1 | import { Stack } from "@mantine/core"; 2 | import { FC, ReactNode } from "react"; 3 | 4 | const InfoPageStack: FC<{ children: ReactNode }> = ({ children }) => { 5 | return ( 6 | 7 | {children} 8 | 9 | ); 10 | }; 11 | 12 | export default InfoPageStack; 13 | -------------------------------------------------------------------------------- /web/ui/mantine-ui/src/components/LabelBadges.tsx: -------------------------------------------------------------------------------- 1 | import { Group, Stack } from "@mantine/core"; 2 | import { FC } from "react"; 3 | import { escapeString } from "../lib/escapeString"; 4 | import badgeClasses from "../Badge.module.css"; 5 | import { maybeQuoteLabelName } from "../promql/utils"; 6 | 7 | export interface LabelBadgesProps { 8 | labels: Record; 9 | wrapper?: typeof Group | typeof Stack; 10 | style?: React.CSSProperties; 11 | } 12 | 13 | export const LabelBadges: FC = ({ 14 | labels, 15 | wrapper: Wrapper = Group, 16 | style, 17 | }) => ( 18 | 19 | {Object.entries(labels).map(([k, v]) => ( 20 | // We build our own Mantine-style badges here for performance 21 | // reasons (see comment in Badge.module.css). 22 | 23 | {maybeQuoteLabelName(k)}="{escapeString(v)}" 24 | 25 | ))} 26 | 27 | ); 28 | -------------------------------------------------------------------------------- /web/ui/mantine-ui/src/components/RuleDefinition.module.css: -------------------------------------------------------------------------------- 1 | .codebox { 2 | background-color: light-dark( 3 | var(--mantine-color-gray-1), 4 | var(--mantine-color-gray-9) 5 | ); 6 | } 7 | 8 | .queryButton { 9 | opacity: 0; 10 | transition: opacity 0.1s ease-in-out; 11 | } 12 | 13 | .codebox:hover .queryButton { 14 | opacity: 1; 15 | } 16 | -------------------------------------------------------------------------------- /web/ui/mantine-ui/src/fonts/codicon.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/mimir-prometheus/49aee40e890e160b76f81dcb65c03031cc702dc5/web/ui/mantine-ui/src/fonts/codicon.ttf -------------------------------------------------------------------------------- /web/ui/mantine-ui/src/lib/escapeString.ts: -------------------------------------------------------------------------------- 1 | // Used for escaping escape sequences and double quotes in double-quoted strings. 2 | export const escapeString = (str: string) => { 3 | return str.replace(/([\\"])/g, "\\$1"); 4 | }; 5 | -------------------------------------------------------------------------------- /web/ui/mantine-ui/src/lib/formatFloatValue.ts: -------------------------------------------------------------------------------- 1 | export const parsePrometheusFloat = (str: string): number => { 2 | switch (str) { 3 | case "+Inf": 4 | return Infinity; 5 | case "-Inf": 6 | return -Infinity; 7 | default: 8 | return parseFloat(str); 9 | } 10 | }; 11 | 12 | export const formatPrometheusFloat = (num: number): string => { 13 | switch (num) { 14 | case Infinity: 15 | return "+Inf"; 16 | case -Infinity: 17 | return "-Inf"; 18 | default: 19 | return num.toString(); 20 | } 21 | }; 22 | -------------------------------------------------------------------------------- /web/ui/mantine-ui/src/lib/formatSeries.ts: -------------------------------------------------------------------------------- 1 | import { 2 | maybeQuoteLabelName, 3 | metricContainsExtendedCharset, 4 | } from "../promql/utils"; 5 | import { escapeString } from "./escapeString"; 6 | 7 | // TODO: Maybe replace this with the new PromLens-derived serialization code in src/promql/serialize.ts? 8 | export const formatSeries = (labels: { [key: string]: string }): string => { 9 | if (labels === null) { 10 | return "scalar"; 11 | } 12 | 13 | if (metricContainsExtendedCharset(labels.__name__ || "")) { 14 | return `{"${escapeString(labels.__name__)}",${Object.entries(labels) 15 | .filter(([k]) => k !== "__name__") 16 | .map(([k, v]) => `${maybeQuoteLabelName(k)}="${escapeString(v)}"`) 17 | .join(", ")}}`; 18 | } 19 | 20 | return `${labels.__name__ || ""}{${Object.entries(labels) 21 | .filter(([k]) => k !== "__name__") 22 | .map(([k, v]) => `${maybeQuoteLabelName(k)}="${escapeString(v)}"`) 23 | .join(", ")}}`; 24 | }; 25 | -------------------------------------------------------------------------------- /web/ui/mantine-ui/src/main.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import ReactDOM from "react-dom/client"; 3 | import App from "./App.tsx"; 4 | import store from "./state/store.ts"; 5 | import { Provider } from "react-redux"; 6 | import "./fonts/codicon.ttf"; 7 | import "./promql.css"; 8 | 9 | ReactDOM.createRoot(document.getElementById("root")!).render( 10 | 11 | 12 | 13 | 14 | 15 | ); 16 | -------------------------------------------------------------------------------- /web/ui/mantine-ui/src/mantine-overrides.css: -------------------------------------------------------------------------------- 1 | .mantine-Badge-label { 2 | overflow: unset; 3 | text-overflow: unset; 4 | } 5 | -------------------------------------------------------------------------------- /web/ui/mantine-ui/src/pages/AgentPage.tsx: -------------------------------------------------------------------------------- 1 | import { Text } from "@mantine/core"; 2 | import { IconSpy } from "@tabler/icons-react"; 3 | import { FC } from "react"; 4 | import InfoPageStack from "../components/InfoPageStack"; 5 | import InfoPageCard from "../components/InfoPageCard"; 6 | 7 | const AgentPage: FC = () => { 8 | return ( 9 | 10 | 14 | 15 | This Prometheus instance is running in agent mode. In 16 | this mode, Prometheus is only used to scrape discovered targets and 17 | forward the scraped metrics to remote write endpoints. 18 | 19 | 20 | Some features are not available in this mode, such as querying and 21 | alerting. 22 | 23 | 24 | 25 | ); 26 | }; 27 | 28 | export default AgentPage; 29 | -------------------------------------------------------------------------------- /web/ui/mantine-ui/src/pages/ConfigPage.tsx: -------------------------------------------------------------------------------- 1 | import { CodeHighlight } from "@mantine/code-highlight"; 2 | import { useSuspenseAPIQuery } from "../api/api"; 3 | import ConfigResult from "../api/responseTypes/config"; 4 | 5 | export default function ConfigPage() { 6 | const { 7 | data: { 8 | data: { yaml }, 9 | }, 10 | } = useSuspenseAPIQuery({ path: `/status/config` }); 11 | 12 | return ( 13 | 22 | ); 23 | } 24 | -------------------------------------------------------------------------------- /web/ui/mantine-ui/src/pages/FlagsPage.module.css: -------------------------------------------------------------------------------- 1 | .th { 2 | padding: 0; 3 | } 4 | 5 | .control { 6 | width: 100%; 7 | padding: var(--mantine-spacing-xs) var(--mantine-spacing-md); 8 | 9 | @mixin hover { 10 | background-color: light-dark( 11 | var(--mantine-color-gray-0), 12 | var(--mantine-color-dark-6) 13 | ); 14 | } 15 | } 16 | 17 | .icon { 18 | width: rem(21px); 19 | height: rem(21px); 20 | border-radius: rem(21px); 21 | } 22 | -------------------------------------------------------------------------------- /web/ui/mantine-ui/src/pages/query/DataTable.module.css: -------------------------------------------------------------------------------- 1 | .tableWrapper { 2 | border: 1px solid 3 | light-dark(var(--mantine-color-gray-3), var(--mantine-color-dark-5)); 4 | border-radius: var(--mantine-radius-default); 5 | } 6 | 7 | .numberCell { 8 | text-align: right; 9 | font-variant-numeric: tabular-nums; 10 | } 11 | -------------------------------------------------------------------------------- /web/ui/mantine-ui/src/pages/query/ExplainViews/ExplainView.module.css: -------------------------------------------------------------------------------- 1 | .funcDoc code { 2 | background-color: light-dark( 3 | var(--mantine-color-gray-1), 4 | var(--mantine-color-dark-5) 5 | ); 6 | padding: 0.05em 0.2em; 7 | border-radius: 0.2em; 8 | } 9 | -------------------------------------------------------------------------------- /web/ui/mantine-ui/src/pages/query/ExpressionInput.module.css: -------------------------------------------------------------------------------- 1 | .input { 2 | /* border: calc(0.0625rem * var(--mantine-scale)) solid var(--input-bd); */ 3 | border-radius: var(--mantine-radius-default); 4 | flex: auto; 5 | /* padding: 4px 0 0 8px; */ 6 | /* font-size: 15px; */ 7 | /* font-family: "DejaVu Sans Mono"; */ 8 | 9 | &:focus-within { 10 | outline: rem(1.3px) solid var(--mantine-color-blue-filled); 11 | border-color: transparent; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /web/ui/mantine-ui/src/pages/query/Graph.module.css: -------------------------------------------------------------------------------- 1 | .chartWrapper { 2 | border: 1px solid 3 | light-dark(var(--mantine-color-gray-3), var(--mantine-color-dark-5)); 4 | border-radius: var(--mantine-radius-default); 5 | } 6 | 7 | .uplotChart { 8 | width: 100%; 9 | height: 100%; 10 | padding: 15px; 11 | } 12 | -------------------------------------------------------------------------------- /web/ui/mantine-ui/src/pages/query/MetricsExplorer/LabelsExplorer.module.css: -------------------------------------------------------------------------------- 1 | .labelValue { 2 | cursor: pointer; 3 | } 4 | 5 | .labelValue:hover { 6 | background-color: light-dark( 7 | var(--mantine-color-gray-2), 8 | var(--mantine-color-gray-8) 9 | ); 10 | border-radius: var(--mantine-radius-sm); 11 | } 12 | 13 | .promqlPill { 14 | background-color: light-dark( 15 | var(--mantine-color-gray-1), 16 | var(--mantine-color-dark-5) 17 | ); 18 | } 19 | -------------------------------------------------------------------------------- /web/ui/mantine-ui/src/pages/query/MetricsExplorer/MetricsExplorer.module.css: -------------------------------------------------------------------------------- 1 | .typeLabel { 2 | color: light-dark(#008080, #14bfad); 3 | } 4 | 5 | .helpLabel { 6 | color: light-dark(#800000, #ff8585); 7 | } 8 | -------------------------------------------------------------------------------- /web/ui/mantine-ui/src/pages/query/QueryPanel.module.css: -------------------------------------------------------------------------------- 1 | .input { 2 | font-family: "DejaVu Sans Mono"; 3 | padding-top: 7px; 4 | transition: none; 5 | 6 | &:focus-within { 7 | outline: rem(2px) solid var(--mantine-color-blue-filled); 8 | border-color: transparent; 9 | } 10 | 11 | &:placeholder-shown { 12 | font-family: unset; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /web/ui/mantine-ui/src/pages/query/SeriesName.module.css: -------------------------------------------------------------------------------- 1 | .metricName { 2 | } 3 | 4 | .labelPair:hover { 5 | --bg-expand: 4px; 6 | background-color: #add6ffa0; 7 | border-radius: 3px; 8 | padding: var(--bg-expand); 9 | margin: calc(-1 * var(--bg-expand)); 10 | color: #495057; 11 | cursor: pointer; 12 | } 13 | 14 | .labelName { 15 | font-weight: 600; 16 | } 17 | 18 | .labelValue { 19 | } 20 | -------------------------------------------------------------------------------- /web/ui/mantine-ui/src/pages/query/TreeNode.module.css: -------------------------------------------------------------------------------- 1 | .nodeText { 2 | cursor: pointer; 3 | background-color: light-dark( 4 | var(--mantine-color-gray-1), 5 | var(--mantine-color-dark-5) 6 | ); 7 | border: 2px solid transparent; 8 | } 9 | 10 | .nodeText.nodeTextSelected, 11 | .nodeText.nodeTextSelected:hover { 12 | background-color: light-dark( 13 | var(--mantine-color-gray-4), 14 | var(--mantine-color-gray-7) 15 | ); 16 | border: 2px solid 17 | light-dark(var(--mantine-color-gray-5), var(--mantine-color-dark-2)); 18 | } 19 | 20 | .nodeText:hover { 21 | background-color: light-dark( 22 | var(--mantine-color-gray-2), 23 | var(--mantine-color-dark-4) 24 | ); 25 | } 26 | 27 | .nodeText.nodeTextError { 28 | background-color: light-dark( 29 | var(--mantine-color-red-1), 30 | darken(var(--mantine-color-red-5), 70%) 31 | ); 32 | } 33 | 34 | .errorText { 35 | color: light-dark(var(--mantine-color-red-9), var(--mantine-color-red-3)); 36 | } 37 | -------------------------------------------------------------------------------- /web/ui/mantine-ui/src/promql.css: -------------------------------------------------------------------------------- 1 | .promql-code { 2 | font-family: "DejaVu Sans Mono", monospace; 3 | } 4 | 5 | .promql-keyword { 6 | color: light-dark(#008080, #14bfad); 7 | } 8 | 9 | .promql-metric-name { 10 | /* Should already inherit the right color from the theme. */ 11 | } 12 | 13 | .promql-label-name { 14 | color: light-dark(#800000, #ff8585); 15 | } 16 | 17 | .promql-string { 18 | color: light-dark(#a31515, #fca5a5); 19 | } 20 | 21 | .promql-paren, 22 | .promql-brace { 23 | } 24 | 25 | .promql-ellipsis { 26 | color: light-dark(rgb(170, 170, 170), rgb(170, 170, 170)); 27 | } 28 | 29 | .promql-duration { 30 | color: light-dark(#09885a, #22c55e); 31 | } 32 | 33 | .promql-number { 34 | color: light-dark(#09885a, #22c55e); 35 | } 36 | -------------------------------------------------------------------------------- /web/ui/mantine-ui/src/setupTests.ts: -------------------------------------------------------------------------------- 1 | import "@testing-library/jest-dom"; 2 | -------------------------------------------------------------------------------- /web/ui/mantine-ui/src/state/hooks.ts: -------------------------------------------------------------------------------- 1 | import { useDispatch, useSelector } from "react-redux"; 2 | import type { RootState, AppDispatch } from "./store"; 3 | 4 | // Use these typed hooks throughout the app instead of plain `useDispatch` and `useSelector` 5 | export const useAppDispatch = useDispatch.withTypes(); 6 | export const useAppSelector = useSelector.withTypes(); 7 | -------------------------------------------------------------------------------- /web/ui/mantine-ui/src/state/initializeFromLocalStorage.ts: -------------------------------------------------------------------------------- 1 | // This has to live in its own file since including it from 2 | // localStorageMiddleware.ts causes startup issues, as the 3 | // listener setup there accesses an action creator before Redux 4 | // has been initialized. 5 | export const initializeFromLocalStorage = ( 6 | key: string, 7 | defaultValue: T 8 | ): T => { 9 | const value = localStorage.getItem(key); 10 | if (value === null) { 11 | return defaultValue; 12 | } 13 | return JSON.parse(value); 14 | }; 15 | -------------------------------------------------------------------------------- /web/ui/mantine-ui/src/state/useNotifications.ts: -------------------------------------------------------------------------------- 1 | import { createContext, useContext } from 'react'; 2 | import { Notification } from "../api/responseTypes/notifications"; 3 | 4 | export type NotificationsContextType = { 5 | notifications: Notification[]; 6 | isConnectionError: boolean; 7 | }; 8 | 9 | const defaultContextValue: NotificationsContextType = { 10 | notifications: [], 11 | isConnectionError: false, 12 | }; 13 | 14 | export const NotificationsContext = createContext(defaultContextValue); 15 | 16 | // Custom hook to access notifications context 17 | export const useNotifications = () => useContext(NotificationsContext); 18 | -------------------------------------------------------------------------------- /web/ui/mantine-ui/src/styles.ts: -------------------------------------------------------------------------------- 1 | import { em, rem } from "@mantine/core"; 2 | 3 | export const navIconStyle = { width: rem(16), height: rem(16) }; 4 | export const menuIconStyle = { width: rem(14), height: rem(14) }; 5 | export const badgeIconStyle = { width: em(17), height: em(17) }; 6 | export const actionIconStyle = { width: "70%", height: "70%" }; 7 | export const inputIconStyle = { width: em(16), height: em(16) }; 8 | export const buttonIconStyle = { width: em(20), height: em(20) }; 9 | export const infoPageCardTitleIconStyle = { width: em(17.5), height: em(17.5) }; 10 | export const expandIconStyle = { width: em(16), height: em(16) }; 11 | export const themeSwitcherIconStyle = { 12 | width: rem(20), 13 | height: rem(20), 14 | display: "block", 15 | }; 16 | -------------------------------------------------------------------------------- /web/ui/mantine-ui/src/types/types.ts: -------------------------------------------------------------------------------- 1 | export interface Histogram { 2 | count: string; 3 | sum: string; 4 | buckets?: [number, string, string, string][]; 5 | } 6 | -------------------------------------------------------------------------------- /web/ui/mantine-ui/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /web/ui/mantine-ui/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2020", 4 | "useDefineForClassFields": true, 5 | "lib": ["ES2020", "DOM", "DOM.Iterable"], 6 | "module": "ESNext", 7 | "skipLibCheck": true, 8 | 9 | /* Bundler mode */ 10 | "moduleResolution": "bundler", 11 | "allowImportingTsExtensions": true, 12 | "resolveJsonModule": true, 13 | "isolatedModules": true, 14 | "noEmit": true, 15 | "jsx": "react-jsx", 16 | 17 | /* Linting */ 18 | "strict": true, 19 | "noUnusedLocals": true, 20 | "noUnusedParameters": true, 21 | "noFallthroughCasesInSwitch": true 22 | }, 23 | "include": ["src"], 24 | "references": [{ "path": "./tsconfig.node.json" }] 25 | } 26 | -------------------------------------------------------------------------------- /web/ui/mantine-ui/tsconfig.node.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "composite": true, 4 | "skipLibCheck": true, 5 | "module": "ESNext", 6 | "moduleResolution": "bundler", 7 | "allowSyntheticDefaultImports": true, 8 | "strict": true 9 | }, 10 | "include": ["vite.config.ts"] 11 | } 12 | -------------------------------------------------------------------------------- /web/ui/mantine-ui/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from "vite"; 2 | import react from "@vitejs/plugin-react"; 3 | 4 | // https://vitejs.dev/config/ 5 | export default defineConfig({ 6 | base: '', 7 | plugins: [react()], 8 | server: { 9 | proxy: { 10 | "/api": { 11 | target: "http://localhost:9090", 12 | }, 13 | "/-/": { 14 | target: "http://localhost:9090", 15 | }, 16 | // "/api": { 17 | // target: "https://prometheus.demo.do.prometheus.io/", 18 | // changeOrigin: true, 19 | // }, 20 | // "/-/": { 21 | // target: "https://prometheus.demo.do.prometheus.io/", 22 | // changeOrigin: true, 23 | // }, 24 | }, 25 | }, 26 | }); 27 | -------------------------------------------------------------------------------- /web/ui/mantine-ui/vitest.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from "vitest/config"; 2 | import react from "@vitejs/plugin-react"; 3 | 4 | export default defineConfig({ 5 | plugins: [react()], 6 | test: { 7 | globals: true, 8 | environment: "jsdom", 9 | setupFiles: "./src/setupTests.ts", 10 | }, 11 | }); 12 | -------------------------------------------------------------------------------- /web/ui/module/codemirror-promql/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | 3 | node_modules/ 4 | dist/ 5 | lib/ 6 | 7 | /.nyc_output 8 | 9 | LICENSE 10 | CHANGELOG.md 11 | -------------------------------------------------------------------------------- /web/ui/module/codemirror-promql/.npmignore: -------------------------------------------------------------------------------- 1 | /.vscode/ 2 | /release/**/*.test.js 3 | /release/**/test/ 4 | /scripts/ 5 | /.circleci/ 6 | /src/ 7 | /test/ 8 | /examples/ 9 | /gulpfile.js 10 | /tsconfig.json 11 | /.npmignore 12 | /.gitignore 13 | /.eslintrc.js 14 | /.nyc_output 15 | -------------------------------------------------------------------------------- /web/ui/module/codemirror-promql/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2021 The Prometheus Authors 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | set -ex 17 | 18 | # build the lib (both ES2015 and CommonJS) 19 | tsc --module esnext --target es2018 --outDir dist/esm 20 | tsc --module commonjs --target es5 --outDir dist/cjs --downlevelIteration 21 | -------------------------------------------------------------------------------- /web/ui/module/codemirror-promql/jest.config.cjs: -------------------------------------------------------------------------------- 1 | /** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */ 2 | module.exports = { 3 | preset: 'ts-jest', 4 | extensionsToTreatAsEsm: ['.ts'], 5 | testEnvironment: 'node', 6 | setupFiles: [ 7 | './setupJest.cjs' 8 | ], 9 | globals: { 10 | 'ts-jest': { 11 | useESM: true, 12 | }, 13 | }, 14 | moduleNameMapper: { 15 | 'lezer-promql': '/../../node_modules/@prometheus-io/lezer-promql/dist/index.cjs' 16 | }, 17 | transformIgnorePatterns: ["/../../node_modules/(?!@prometheus-io/lezer-promql)/"] 18 | }; 19 | -------------------------------------------------------------------------------- /web/ui/module/codemirror-promql/setupJest.cjs: -------------------------------------------------------------------------------- 1 | global.fetch = require('isomorphic-fetch') 2 | -------------------------------------------------------------------------------- /web/ui/module/codemirror-promql/src/client/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | export { PrometheusClient, PrometheusConfig, CacheConfig } from './prometheus'; 15 | 16 | export type FetchFn = (input: RequestInfo, init?: RequestInit) => Promise; 17 | -------------------------------------------------------------------------------- /web/ui/module/codemirror-promql/src/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | export { PrometheusClient } from './client'; 15 | export { CompleteConfiguration, CompleteStrategy, newCompleteStrategy } from './complete'; 16 | export { LintStrategy } from './lint'; 17 | export { PromQLExtension, LanguageType, promQLLanguage } from './promql'; 18 | -------------------------------------------------------------------------------- /web/ui/module/codemirror-promql/src/parser/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | export { buildLabelMatchers, labelMatchersToString } from './matcher'; 15 | export { Parser } from './parser'; 16 | export { walkBackward, containsAtLeastOneChild, containsChild } from './path-finder'; 17 | -------------------------------------------------------------------------------- /web/ui/module/codemirror-promql/src/test/alertmanager_alerts_series.json: -------------------------------------------------------------------------------- 1 | { 2 | "status": "success", 3 | "data": [ 4 | { 5 | "__name__": "alertmanager_alerts", 6 | "env": "demo", 7 | "instance": "demo.do.prometheus.io:9093", 8 | "job": "alertmanager", 9 | "state": "active" 10 | }, 11 | { 12 | "__name__": "alertmanager_alerts", 13 | "env": "demo", 14 | "instance": "demo.do.prometheus.io:9093", 15 | "job": "alertmanager", 16 | "state": "suppressed" 17 | } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /web/ui/module/codemirror-promql/src/test/metric_name.json: -------------------------------------------------------------------------------- 1 | { 2 | "status": "success", 3 | "data": [ 4 | "ALERTS", 5 | "ALERTS_FOR_STATE", 6 | "alertmanager_alerts", 7 | "alertmanager_alerts_invalid_total", 8 | "alertmanager_alerts_received_total", 9 | "alertmanager_build_info", 10 | "alertmanager_cluster_enabled", 11 | "alertmanager_config_hash", 12 | "alertmanager_config_last_reload_success_timestamp_seconds", 13 | "alertmanager_config_last_reload_successful", 14 | "alertmanager_dispatcher_aggregation_groups", 15 | "alertmanager_dispatcher_alert_processing_duration_seconds_count", 16 | "alertmanager_dispatcher_alert_processing_duration_seconds_sum", 17 | "alertmanager_http_concurrency_limit_exceeded_total", 18 | "alertmanager_http_request_duration_seconds_bucket", 19 | "alertmanager_http_request_duration_seconds_count", 20 | "alertmanager_http_request_duration_seconds_sum" 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /web/ui/module/codemirror-promql/src/types/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | export { ValueType, PromQLFunction, getFunction } from './function'; 15 | export { Matcher } from './matcher'; 16 | export { VectorMatchCardinality, VectorMatching } from './vector'; 17 | -------------------------------------------------------------------------------- /web/ui/module/codemirror-promql/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "target": "es2018", 5 | "module": "esnext", 6 | "lib": ["dom", "dom.iterable", "esnext"], 7 | "declaration": true, 8 | "outDir": "dist", 9 | "strict": true, 10 | "sourceMap": true, 11 | "moduleResolution": "node", 12 | "esModuleInterop": true, 13 | "allowSyntheticDefaultImports": true, 14 | "allowJs": true, 15 | "skipLibCheck": true 16 | }, 17 | "include": [ 18 | "src/" 19 | ], 20 | "exclude": [ 21 | "src/**/*.test.ts", 22 | "src/test/**" 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /web/ui/module/lezer-promql/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | dist/ 3 | lib/ 4 | src/parser.js 5 | src/parser.terms.js 6 | 7 | LICENSE 8 | CHANGELOG.md 9 | -------------------------------------------------------------------------------- /web/ui/module/lezer-promql/.npmignore: -------------------------------------------------------------------------------- 1 | build.sh 2 | generate-types.sh 3 | jest.config.cjs 4 | rollup.config.js 5 | /test/ 6 | /src/ 7 | -------------------------------------------------------------------------------- /web/ui/module/lezer-promql/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2021 The Prometheus Authors 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | set -ex 18 | 19 | npx lezer-generator src/promql.grammar -o src/parser 20 | 21 | cat src/parser.terms.js >> src/parser.js 22 | 23 | bash ./generate-types.sh 24 | 25 | rollup -c 26 | -------------------------------------------------------------------------------- /web/ui/module/lezer-promql/jest.config.cjs: -------------------------------------------------------------------------------- 1 | /** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */ 2 | module.exports = { 3 | preset: 'ts-jest', 4 | extensionsToTreatAsEsm: ['.ts'], 5 | testEnvironment: 'node', 6 | globals: { 7 | 'ts-jest': { 8 | useESM: true, 9 | }, 10 | }, 11 | }; 12 | -------------------------------------------------------------------------------- /web/ui/module/lezer-promql/rollup.config.js: -------------------------------------------------------------------------------- 1 | import { nodeResolve } from "@rollup/plugin-node-resolve" 2 | 3 | export default { 4 | input: "./src/parser.js", 5 | output: [{ 6 | format: "cjs", 7 | file: "./dist/index.cjs" 8 | }, { 9 | format: "es", 10 | file: "./dist/index.es.js" 11 | }], 12 | external(id) { return !/^[.\/]/.test(id) }, 13 | plugins: [ 14 | nodeResolve() 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /web/ui/module/lezer-promql/test/promql.test.js: -------------------------------------------------------------------------------- 1 | import { parser } from '../dist/index.es.js'; 2 | import { fileTests } from '@lezer/generator/dist/test'; 3 | 4 | import * as fs from 'fs'; 5 | import * as path from 'path'; 6 | import { fileURLToPath } from 'url'; 7 | 8 | let caseDir = path.dirname(fileURLToPath(import.meta.url)) 9 | for (const file of fs.readdirSync(caseDir)) { 10 | if (!/\.txt$/.test(file)) continue; 11 | 12 | const name = /^[^.]*/.exec(file)[0]; 13 | describe(name, () => { 14 | for (const { name, run } of fileTests(fs.readFileSync(path.join(caseDir, file), 'utf8'), file)) it(name, () => run(parser)); 15 | }); 16 | } 17 | -------------------------------------------------------------------------------- /web/ui/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "prometheus-io", 3 | "description": "Monorepo for the Prometheus UI", 4 | "version": "0.304.0", 5 | "private": true, 6 | "scripts": { 7 | "build": "bash build_ui.sh --all", 8 | "build:module": "bash build_ui.sh --build-module", 9 | "start": "npm run start -w mantine-ui", 10 | "test": "npm run test --workspaces", 11 | "lint": "npm run lint --workspaces" 12 | }, 13 | "workspaces": [ 14 | "mantine-ui", 15 | "module/*" 16 | ], 17 | "devDependencies": { 18 | "@types/jest": "^29.5.14", 19 | "@typescript-eslint/eslint-plugin": "^8.31.0", 20 | "@typescript-eslint/parser": "^8.31.0", 21 | "eslint-config-prettier": "^10.1.2", 22 | "prettier": "^3.5.3", 23 | "ts-jest": "^29.3.2", 24 | "typescript": "^5.8.3", 25 | "vite": "^6.3.3" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /web/ui/react-app/.env: -------------------------------------------------------------------------------- 1 | # This ensures that all links in the generated asset bundle will be relative, 2 | # so that assets are loaded correctly even when a path prefix is used. 3 | PUBLIC_URL=. 4 | -------------------------------------------------------------------------------- /web/ui/react-app/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "parser": "@typescript-eslint/parser", 3 | "extends": [ 4 | "react-app", 5 | "plugin:@typescript-eslint/recommended", 6 | "plugin:prettier/recommended" 7 | ], 8 | "rules": { 9 | "@typescript-eslint/explicit-function-return-type": ["off"], 10 | "eol-last": [ 11 | "error", 12 | "always" 13 | ], 14 | "object-curly-spacing": [ 15 | "error", 16 | "always" 17 | ], 18 | "prefer-const": "warn", 19 | "comma-dangle": [ 20 | "error", 21 | { 22 | "arrays": "always-multiline", 23 | "objects": "always-multiline", 24 | "imports": "always-multiline" 25 | } 26 | ] 27 | }, 28 | "plugins": [ 29 | "prettier" 30 | ], 31 | "ignorePatterns": ["src/vendor/**"] 32 | } 33 | -------------------------------------------------------------------------------- /web/ui/react-app/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /web/ui/react-app/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/mimir-prometheus/49aee40e890e160b76f81dcb65c03031cc702dc5/web/ui/react-app/public/favicon.ico -------------------------------------------------------------------------------- /web/ui/react-app/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "Prometheus UI", 3 | "name": "Prometheus Server Web Interface", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": ".", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /web/ui/react-app/src/components/Checkbox.tsx: -------------------------------------------------------------------------------- 1 | import React, { FC, memo, CSSProperties } from 'react'; 2 | import { FormGroup, Label, Input, InputProps } from 'reactstrap'; 3 | 4 | interface CheckboxProps extends InputProps { 5 | wrapperStyles?: CSSProperties; 6 | } 7 | 8 | const Checkbox: FC = ({ children, wrapperStyles, id, ...rest }) => { 9 | return ( 10 | 11 | 12 | 15 | 16 | ); 17 | }; 18 | 19 | export default memo(Checkbox); 20 | -------------------------------------------------------------------------------- /web/ui/react-app/src/components/ToggleMoreLess.tsx: -------------------------------------------------------------------------------- 1 | import React, { FC } from 'react'; 2 | import { Button } from 'reactstrap'; 3 | 4 | interface ToggleMoreLessProps { 5 | event(): void; 6 | showMore: boolean; 7 | } 8 | 9 | export const ToggleMoreLess: FC = ({ children, event, showMore }) => { 10 | return ( 11 |

12 | {children} 13 | 26 |

27 | ); 28 | }; 29 | -------------------------------------------------------------------------------- /web/ui/react-app/src/constants/constants.tsx: -------------------------------------------------------------------------------- 1 | export const API_PATH = 'api/v1'; 2 | -------------------------------------------------------------------------------- /web/ui/react-app/src/contexts/AnimateLogoContext.tsx: -------------------------------------------------------------------------------- 1 | import { createContext } from 'react'; 2 | 3 | export const AnimateLogoContext = createContext(false); 4 | -------------------------------------------------------------------------------- /web/ui/react-app/src/contexts/PathPrefixContext.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const PathPrefixContext = React.createContext(''); 4 | 5 | function usePathPrefix(): string { 6 | return React.useContext(PathPrefixContext); 7 | } 8 | 9 | export { usePathPrefix, PathPrefixContext }; 10 | -------------------------------------------------------------------------------- /web/ui/react-app/src/contexts/ReadyContext.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const ReadyContext = React.createContext(false); 4 | 5 | function useReady(): boolean { 6 | return React.useContext(ReadyContext); 7 | } 8 | 9 | export { useReady, ReadyContext }; 10 | -------------------------------------------------------------------------------- /web/ui/react-app/src/contexts/ThemeContext.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export type themeName = 'light' | 'dark'; 4 | export type themeSetting = themeName | 'auto'; 5 | 6 | export interface ThemeCtx { 7 | theme: themeName; 8 | userPreference: themeSetting; 9 | setTheme: (t: themeSetting) => void; 10 | } 11 | 12 | // defaults, will be overridden in App.tsx 13 | export const ThemeContext = React.createContext({ 14 | theme: 'light', 15 | userPreference: 'auto', 16 | // eslint-disable-next-line @typescript-eslint/no-empty-function 17 | setTheme: (s: themeSetting) => {}, 18 | }); 19 | 20 | export const useTheme = (): ThemeCtx => { 21 | return React.useContext(ThemeContext); 22 | }; 23 | -------------------------------------------------------------------------------- /web/ui/react-app/src/contexts/ToastContext.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const ToastContext = React.createContext((msg: string) => { 4 | return; 5 | }); 6 | 7 | function useToastContext() { 8 | return React.useContext(ToastContext); 9 | } 10 | 11 | export { useToastContext, ToastContext }; 12 | -------------------------------------------------------------------------------- /web/ui/react-app/src/fonts/codicon.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/mimir-prometheus/49aee40e890e160b76f81dcb65c03031cc702dc5/web/ui/react-app/src/fonts/codicon.ttf -------------------------------------------------------------------------------- /web/ui/react-app/src/globals.ts: -------------------------------------------------------------------------------- 1 | import jquery from 'jquery'; 2 | 3 | // eslint-disable-next-line @typescript-eslint/no-explicit-any 4 | (window as any).jQuery = jquery; 5 | // eslint-disable-next-line @typescript-eslint/no-explicit-any 6 | (window as any).moment = require('moment'); 7 | -------------------------------------------------------------------------------- /web/ui/react-app/src/hooks/useLocalStorage.tsx: -------------------------------------------------------------------------------- 1 | import { Dispatch, SetStateAction, useEffect, useState } from 'react'; 2 | 3 | export function useLocalStorage(localStorageKey: string, initialState: S): [S, Dispatch>] { 4 | const [value, setValue] = useState(() => 5 | JSON.parse(localStorage.getItem(localStorageKey) || JSON.stringify(initialState)) 6 | ); 7 | 8 | useEffect(() => { 9 | const serializedState = JSON.stringify(value); 10 | localStorage.setItem(localStorageKey, serializedState); 11 | }, [localStorageKey, value]); 12 | 13 | return [value, setValue]; 14 | } 15 | -------------------------------------------------------------------------------- /web/ui/react-app/src/hooks/useMedia.ts: -------------------------------------------------------------------------------- 1 | import { useEffect, useState } from 'react'; 2 | 3 | // A hook to determine whether a CSS media query finds any matches. 4 | const useMedia = (query: string): boolean => { 5 | const mediaQuery = window.matchMedia(query); 6 | const [matches, setMatches] = useState(mediaQuery.matches); 7 | 8 | useEffect(() => { 9 | const handler = () => setMatches(mediaQuery.matches); 10 | mediaQuery.addEventListener('change', handler); 11 | return () => mediaQuery.removeEventListener('change', handler); 12 | }, [mediaQuery]); 13 | 14 | return matches; 15 | }; 16 | 17 | export default useMedia; 18 | -------------------------------------------------------------------------------- /web/ui/react-app/src/pages/agent/Agent.tsx: -------------------------------------------------------------------------------- 1 | import React, { FC } from 'react'; 2 | 3 | const Agent: FC = () => { 4 | return ( 5 | <> 6 |

Prometheus Agent

7 |

8 | This Prometheus instance is running in agent mode. In this mode, Prometheus is only used to scrape 9 | discovered targets and forward the scraped metrics to remote write endpoints. 10 |

11 |

Some features are not available in this mode, such as querying and alerting.

12 | 13 | ); 14 | }; 15 | 16 | export default Agent; 17 | -------------------------------------------------------------------------------- /web/ui/react-app/src/pages/graph/QueryStatsView.test.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import { shallow } from 'enzyme'; 3 | import QueryStatsView from './QueryStatsView'; 4 | 5 | describe('QueryStatsView', () => { 6 | it('renders props as query stats', () => { 7 | const queryStatsProps = { 8 | loadTime: 100, 9 | resolution: 5, 10 | resultSeries: 10000, 11 | }; 12 | const queryStatsView = shallow(); 13 | expect(queryStatsView.prop('className')).toEqual('query-stats'); 14 | expect(queryStatsView.children().prop('className')).toEqual('float-right'); 15 | expect(queryStatsView.children().text()).toEqual('Load time: 100ms   Resolution: 5s   Result series: 10000'); 16 | }); 17 | }); 18 | -------------------------------------------------------------------------------- /web/ui/react-app/src/pages/graph/QueryStatsView.tsx: -------------------------------------------------------------------------------- 1 | import React, { FC } from 'react'; 2 | 3 | export interface QueryStats { 4 | loadTime: number; 5 | resolution: number; 6 | resultSeries: number; 7 | } 8 | 9 | const QueryStatsView: FC = (props) => { 10 | const { loadTime, resolution, resultSeries } = props; 11 | 12 | return ( 13 |
14 | 15 | Load time: {loadTime}ms   Resolution: {resolution}s   Result series: {resultSeries} 16 | 17 |
18 | ); 19 | }; 20 | 21 | export default QueryStatsView; 22 | -------------------------------------------------------------------------------- /web/ui/react-app/src/pages/rules/Rules.tsx: -------------------------------------------------------------------------------- 1 | import React, { FC } from 'react'; 2 | import { useFetch } from '../../hooks/useFetch'; 3 | import { withStatusIndicator } from '../../components/withStatusIndicator'; 4 | import { RulesMap, RulesContent } from './RulesContent'; 5 | import { usePathPrefix } from '../../contexts/PathPrefixContext'; 6 | import { API_PATH } from '../../constants/constants'; 7 | 8 | const RulesWithStatusIndicator = withStatusIndicator(RulesContent); 9 | 10 | const Rules: FC = () => { 11 | const pathPrefix = usePathPrefix(); 12 | const { response, error, isLoading } = useFetch(`${pathPrefix}/${API_PATH}/rules`); 13 | 14 | return ; 15 | }; 16 | 17 | export default Rules; 18 | -------------------------------------------------------------------------------- /web/ui/react-app/src/pages/targets/ScrapePoolPanel.module.css: -------------------------------------------------------------------------------- 1 | .container { 2 | margin-top: -12px; 3 | } 4 | 5 | .title { 6 | font-size: 20px; 7 | font-weight: bold; 8 | cursor: pointer; 9 | } 10 | 11 | .normal { 12 | composes: title; 13 | } 14 | 15 | .danger { 16 | composes: title; 17 | color: rgb(242, 65, 65); 18 | } 19 | 20 | .table { 21 | width: 100%; 22 | } 23 | 24 | .cell { 25 | height: auto; 26 | word-wrap: break-word; 27 | word-break: break-all; 28 | } 29 | 30 | .endpoint, .labels { 31 | composes: cell; 32 | width: 25%; 33 | } 34 | 35 | .state, .last-scrape { 36 | composes: cell; 37 | width: 10%; 38 | } 39 | 40 | .errors { 41 | composes: cell; 42 | width: 30%; 43 | } 44 | -------------------------------------------------------------------------------- /web/ui/react-app/src/react-app-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /web/ui/react-app/src/setupProxy.js: -------------------------------------------------------------------------------- 1 | const { createProxyMiddleware } = require('http-proxy-middleware'); 2 | 3 | module.exports = function(app) { 4 | app.use( 5 | '/api', 6 | createProxyMiddleware({ 7 | target: 'http://localhost:9090', 8 | changeOrigin: true, 9 | }) 10 | ); 11 | }; 12 | -------------------------------------------------------------------------------- /web/ui/react-app/src/themes/app.scss: -------------------------------------------------------------------------------- 1 | /* This file contains styles that are applied to root document, which cannot be 2 | nested under theme selectors. */ 3 | 4 | html { 5 | /* https://github.com/prometheus/prometheus/issues/7434 */ 6 | /* Scroll to hash-fragment-links counting the fixed navbar 40px tall with 16px padding */ 7 | scroll-padding-top: 56px; 8 | } 9 | 10 | /* Font used for autocompletion item icons. */ 11 | @font-face { 12 | font-family: 'codicon'; 13 | src: local('codicon'), url(../fonts/codicon.ttf) format('truetype'); 14 | } 15 | -------------------------------------------------------------------------------- /web/ui/react-app/src/themes/dark.scss: -------------------------------------------------------------------------------- 1 | @import 'bootstrap_dark'; 2 | 3 | @import '~bootstrap/scss/functions'; 4 | @import '~bootstrap/scss/variables'; 5 | @import '~@forevolve/bootstrap-dark/scss/_dark-variables.scss'; 6 | 7 | $alert-cell-color: $white; 8 | $rule-cell-bg: $gray-900; 9 | 10 | $config-yaml-color: $black; 11 | $config-yaml-bg: $gray-500; 12 | $config-yaml-border: $gray-700; 13 | 14 | $query-stats-color: lighten($secondary, 20%); 15 | 16 | $metrics-explorer-bg: $dropdown-link-hover-bg; 17 | 18 | $clear-time-btn-bg: $secondary; 19 | 20 | $checked-checkbox-color: #60a5fa; 21 | 22 | $histogram-chart-axis-color: $gray-700; 23 | $histogram-chart-grid-color: $gray-600; 24 | $histogram-chart-hover-color: $gray-400; 25 | 26 | .bootstrap-dark { 27 | @import './shared'; 28 | } 29 | -------------------------------------------------------------------------------- /web/ui/react-app/src/themes/light.scss: -------------------------------------------------------------------------------- 1 | @import 'bootstrap_light'; 2 | 3 | @import '~bootstrap/scss/functions'; 4 | @import '~bootstrap/scss/variables'; 5 | 6 | $alert-cell-color: inherit; 7 | $rule-cell-bg: #f5f5f5; 8 | 9 | $config-yaml-color: #333; 10 | $config-yaml-bg: #f5f5f5; 11 | $config-yaml-border: #ccc; 12 | 13 | $query-stats-color: #71808e; 14 | 15 | $metrics-explorer-bg: #efefef; 16 | 17 | $clear-time-btn-bg: $white; 18 | 19 | $checked-checkbox-color: #286090; 20 | 21 | $histogram-chart-axis-color: $gray-700; 22 | $histogram-chart-grid-color: $gray-600; 23 | $histogram-chart-hover-color: $gray-400; 24 | 25 | .bootstrap { 26 | @import './shared'; 27 | } 28 | -------------------------------------------------------------------------------- /web/ui/react-app/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "lib": [ 5 | "dom", 6 | "dom.iterable", 7 | "esnext" 8 | ], 9 | "allowJs": true, 10 | "skipLibCheck": true, 11 | "esModuleInterop": true, 12 | "allowSyntheticDefaultImports": true, 13 | "strict": true, 14 | "forceConsistentCasingInFileNames": true, 15 | "module": "esnext", 16 | "moduleResolution": "node", 17 | "resolveJsonModule": true, 18 | "isolatedModules": true, 19 | "noEmit": true, 20 | "jsx": "react-jsx", 21 | "noFallthroughCasesInSwitch": true 22 | }, 23 | "include": [ 24 | "src", 25 | "test", 26 | "react-app-env.d.ts" 27 | ] 28 | } 29 | --------------------------------------------------------------------------------