├── .devcontainer └── arm │ └── devcontainer.json ├── .dockerignore ├── .github ├── CODEOWNERS ├── ISSUE_TEMPLATE │ ├── bug_report.yml │ ├── config.yml │ └── feature_request.yml ├── pull_request_template.md └── workflows │ ├── build-and-publish-dockerhub.yaml │ ├── build-ci-image.yaml │ ├── build_dev.yaml │ ├── clang_lint.yaml │ ├── create_tag_latest.yaml │ ├── dev-registry_cleanup.yaml │ └── tests.yaml ├── .gitignore ├── .gitpod.Dockerfile ├── .gitpod.yml ├── .golangci.yml ├── .idea └── .gitignore ├── .promu.yml ├── .yamllint ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── Dockerfile ├── Dockerfile.ci ├── LICENSE ├── MAINTAINERS.md ├── Makefile ├── Makefile.common ├── NOTICE ├── README.md ├── VERSION ├── cmd ├── prometheus │ ├── main.go │ ├── main_test.go │ ├── main_unix_test.go │ ├── query_log_test.go │ └── testdata │ │ ├── consoles │ │ └── test.html │ │ └── rules │ │ └── test.yml ├── prompptool │ ├── main.go │ ├── walpp.go │ └── walvanilla.go └── 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.nonexistant │ ├── 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 │ ├── 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.yml │ ├── prometheus-rules.lint.yml │ ├── rules-bad.yml │ ├── rules.yml │ ├── rules_duplicates.yml │ ├── rules_large.yml │ ├── rules_run.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_test.go │ ├── unittest.go │ └── unittest_test.go ├── config ├── config.go ├── config_default_test.go ├── config_test.go ├── config_windows_test.go ├── pp_config_test.go ├── pp_remote_write_config.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 │ ├── 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_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 │ ├── labelname2.bad.yml │ ├── labelvalue.bad.yml │ ├── lightsail_token_file.bad.yml │ ├── lowercase.bad.yml │ ├── lowercase2.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 │ ├── op.conf.good.yml │ ├── openstack_availability.bad.yml │ ├── openstack_role.bad.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 │ ├── 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_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_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_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.json │ ├── 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 │ ├── uppercase2.bad.yml │ ├── uppercase3.bad.yml │ ├── url_in_targetgroup.bad.yml │ ├── uyuni_no_server.bad.yml │ └── uyuni_token_file.bad.yml ├── console_libraries ├── menu.lib └── prom.lib ├── consoles ├── index.html.example ├── node-cpu.html ├── node-disk.html ├── node-overview.html ├── node.html ├── prometheus-overview.html └── prometheus.html ├── discovery ├── README.md ├── aws │ ├── ec2.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 ├── 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_adaptor.go │ ├── endpointslice_adaptor_test.go │ ├── endpointslice_test.go │ ├── ingress.go │ ├── ingress_adaptor.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 ├── legacymanager │ ├── manager.go │ ├── manager_test.go │ └── registry.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 │ ├── 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-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 │ ├── prompp_dark_logo.svg │ └── prompp_white_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 ├── 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_common_noncpp.go │ ├── labels_common_nonslice_noncpp.go │ ├── labels_dedupelabels.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_annotation.bad.yaml │ │ ├── bad_expr.bad.yaml │ │ ├── bad_field.bad.yaml │ │ ├── bad_lname.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 ├── textparse │ ├── README.md │ ├── interface.go │ ├── interface_test.go │ ├── op_interface.go │ ├── openmetricslex.l │ ├── openmetricslex.l.go │ ├── openmetricsparse.go │ ├── openmetricsparse_test.go │ ├── promlex.l │ ├── promlex.l.go │ ├── promparse.go │ ├── promparse_test.go │ ├── promtestdata.nometa.txt │ ├── promtestdata.txt │ ├── protobufparse.go │ └── protobufparse_test.go ├── timestamp │ └── timestamp.go └── value │ └── value.go ├── notifier ├── notifier.go └── notifier_test.go ├── plugins.yml ├── plugins ├── generate.go ├── minimum.go └── plugins.go ├── pp-pkg ├── config │ ├── receiver_config.go │ └── receiver_config_test.go ├── dialer │ └── dialer.go ├── handler │ ├── adapter │ │ ├── refill.go │ │ ├── refill_test.go │ │ ├── remote_write.go │ │ ├── remote_write_test.go │ │ ├── stream.go │ │ └── stream_test.go │ ├── decoder │ │ ├── decoder.go │ │ └── ppcore │ │ │ ├── decoder.go │ │ │ └── replay.go │ ├── interface.go │ ├── middleware │ │ └── metadata.go │ ├── model │ │ ├── metadata.go │ │ ├── refill.go │ │ ├── refill_test.go │ │ ├── remote_write.go │ │ ├── remote_write_test.go │ │ ├── segment.go │ │ ├── segment_test.go │ │ ├── stream.go │ │ ├── stream_test.go │ │ ├── utils.go │ │ └── utils_test.go │ ├── otlp_handler.go │ ├── pp_converter_test.go │ ├── pp_handler.go │ ├── processor │ │ ├── interface.go │ │ ├── refill_processor.go │ │ ├── refill_processor_test.go │ │ ├── remote_write_processor.go │ │ ├── remote_write_processor_test.go │ │ ├── stream_processor.go │ │ └── stream_processor_test.go │ └── storage │ │ ├── block │ │ ├── reader.go │ │ ├── storage.go │ │ ├── storage_test.go │ │ └── writer.go │ │ └── io.go ├── receiver │ ├── appender.go │ ├── receiver.go │ ├── trigger.go │ └── upgrader.go ├── remote │ └── config.go ├── scrape │ ├── manager.go │ ├── metrics.go │ ├── pool.go │ ├── scrape.go │ └── target.go ├── storage │ ├── remote_read.go │ └── storage.go └── tsdb │ └── db.go ├── pp ├── .bazelignore ├── .bazelrc ├── .clang-format ├── .clang-tidy ├── .clangd ├── .gitignore ├── .golangci.yml ├── BUILD ├── MODULE.bazel ├── Makefile ├── WORKSPACE ├── bare_bones │ ├── algorithm.h │ ├── allocated_memory.h │ ├── allocator.h │ ├── benchmarks │ │ ├── BUILD │ │ └── stream_v_byte_benchmark.cpp │ ├── bit.h │ ├── bit_sequence.h │ ├── bitset.h │ ├── compiler.h │ ├── concepts.h │ ├── crc32.h │ ├── encoding.h │ ├── exception.cpp │ ├── exception.h │ ├── gorilla.h │ ├── iterator.h │ ├── lz4_stream.h │ ├── memory.h │ ├── numeric.h │ ├── preprocess.h │ ├── serializer.h │ ├── snug_composite.h │ ├── sparse_vector.h │ ├── stream_v_byte.h │ ├── streams.h │ ├── tests │ │ ├── bit_sequence_tests.cpp │ │ ├── bitset_tests.cpp │ │ ├── container_tests.cpp │ │ ├── coredump_test_separate.cpp │ │ ├── crc32_tests.cpp │ │ ├── encoder_tests.cpp │ │ ├── exception_tests.cpp │ │ ├── gorilla_tests.cpp │ │ ├── lz4_stream_tests.cpp │ │ ├── memory_tests.cpp │ │ ├── snug_composite_tests.cpp │ │ ├── sparse_vector_tests.cpp │ │ ├── stream_v_byte_tests.cpp │ │ ├── vector_tests.cpp │ │ ├── vector_with_holes_tests.cpp │ │ └── zigzag_tests.cpp │ ├── type_traits.h │ ├── utf8.h │ ├── varint.h │ ├── vector.h │ ├── vector_with_holes.h │ ├── xxhash.h │ └── zigzag.h ├── bazel │ ├── rules │ │ ├── cc_static_library.bzl │ │ └── go_binary.bzl │ └── toolchain │ │ ├── BUILD │ │ └── cc_toolchain_config.bzl ├── entrypoint │ ├── .gitignore │ ├── Makefile │ ├── README.md │ ├── build.mk │ ├── common.cpp │ ├── common.h │ ├── entrypoint.cpp.mk │ ├── entrypoint.cpp.template │ ├── entrypoint.h.template │ ├── exception.hpp │ ├── hashdex.hpp │ ├── head │ │ ├── data_storage.h │ │ ├── lss.h │ │ └── series_data.h │ ├── head_status.cpp │ ├── head_status.h │ ├── head_wal.cpp │ ├── head_wal.h │ ├── index_writer.cpp │ ├── index_writer.h │ ├── label_set.cpp │ ├── label_set.h │ ├── primitives_lss.cpp │ ├── primitives_lss.h │ ├── prometheus_relabeler.cpp │ ├── prometheus_relabeler.h │ ├── series_data_data_storage.cpp │ ├── series_data_data_storage.h │ ├── series_data_decode_iterator.cpp │ ├── series_data_decode_iterator.h │ ├── series_data_deserializer.cpp │ ├── series_data_deserializer.h │ ├── series_data_encoder.cpp │ ├── series_data_encoder.h │ ├── wal_decoder.cpp │ ├── wal_decoder.h │ ├── wal_encoder.cpp │ ├── wal_encoder.h │ ├── wal_hashdex.cpp │ └── wal_hashdex.h ├── go │ ├── .gitignore │ ├── cppbridge │ │ ├── c_garbage_collector.go │ │ ├── common.go │ │ ├── entrypoint.go │ │ ├── entrypoint.h │ │ ├── exception.go │ │ ├── exception_test.go │ │ ├── fastcgo │ │ │ ├── call.s │ │ │ ├── package.go │ │ │ └── runtime_go1.9.go │ │ ├── head.go │ │ ├── head_status.go │ │ ├── head_status_test.go │ │ ├── head_test.go │ │ ├── head_wal.go │ │ ├── head_wal_test.go │ │ ├── index_writer.go │ │ ├── index_writer_test.go │ │ ├── labels.go │ │ ├── lss_snapshot.go │ │ ├── primitives_lss.go │ │ ├── primitives_lss_test.go │ │ ├── prometheus_relabeler.go │ │ ├── prometheus_relabeler_test.go │ │ ├── wal_decoder.go │ │ ├── wal_decoder_test.go │ │ ├── wal_encode_decode_test.go │ │ ├── wal_encoder.go │ │ ├── wal_encoder_test.go │ │ ├── wal_hashdex.go │ │ ├── wal_hashdex_test.go │ │ ├── wal_open_metrics_scraper_hashdex_test.go │ │ └── wal_prometheus_scraper_hashdex_test.go │ ├── frames │ │ ├── binary_body.go │ │ ├── binary_body_test.go │ │ ├── consts.go │ │ ├── errors.go │ │ ├── frames.go │ │ ├── frames_test.go │ │ ├── framestest │ │ │ └── read_payload.go │ │ ├── header.go │ │ ├── header_test.go │ │ ├── title.go │ │ ├── title_test.go │ │ ├── transport_frames.go │ │ ├── transport_frames_test.go │ │ ├── types.go │ │ └── write_frame.go │ ├── model │ │ ├── labelmatcher.go │ │ ├── labelset.go │ │ ├── labelset_test.go │ │ └── timeseries.go │ ├── relabeler │ │ ├── appender │ │ │ ├── appender.go │ │ │ ├── appender_test.go │ │ │ ├── delivery_moq_test.go │ │ │ ├── head.go │ │ │ ├── metrics.go │ │ │ ├── rotator.go │ │ │ └── storage.go │ │ ├── autosharder.go │ │ ├── block.go │ │ ├── block │ │ │ ├── chunk_writer.go │ │ │ ├── file_writer.go │ │ │ ├── noop.go │ │ │ └── writer.go │ │ ├── block_test.go │ │ ├── config │ │ │ └── config.go │ │ ├── cppbridge_moq_test.go │ │ ├── current_state.go │ │ ├── delivery_moq_test.go │ │ ├── destination_group.go │ │ ├── distributor │ │ │ ├── distributor.go │ │ │ └── promise.go │ │ ├── errors.go │ │ ├── exchange.go │ │ ├── file_storage.go │ │ ├── head │ │ │ ├── builder.go │ │ │ ├── catalog │ │ │ │ ├── catalog.go │ │ │ │ ├── catalog_test.go │ │ │ │ ├── decoder.go │ │ │ │ ├── decoder_test.go │ │ │ │ ├── encoder.go │ │ │ │ ├── gc.go │ │ │ │ ├── log.go │ │ │ │ ├── log_header.go │ │ │ │ ├── log_migrate.go │ │ │ │ ├── log_test.go │ │ │ │ ├── record.go │ │ │ │ ├── record_test.go │ │ │ │ └── testdata │ │ │ │ │ ├── headv1.log │ │ │ │ │ ├── headv2.log │ │ │ │ │ └── headv3.log │ │ │ ├── head.go │ │ │ ├── load.go │ │ │ ├── load_test.go │ │ │ ├── manager │ │ │ │ ├── head.go │ │ │ │ └── manager.go │ │ │ ├── promise.go │ │ │ ├── ready │ │ │ │ └── ready.go │ │ │ ├── shard.go │ │ │ ├── task.go │ │ │ ├── wal.go │ │ │ ├── wal_test.go │ │ │ └── wal_writer.go │ │ ├── high_availability_tracker.go │ │ ├── interface.go │ │ ├── logger.go │ │ ├── logger │ │ │ └── logger.go │ │ ├── main_test.go │ │ ├── manager.go │ │ ├── manager_keeper.go │ │ ├── markup_file.go │ │ ├── models.go │ │ ├── querier │ │ │ ├── chunk_querier.go │ │ │ ├── chunk_series.go │ │ │ ├── chunk_series_test.go │ │ │ ├── dedup.go │ │ │ ├── metrics.go │ │ │ ├── multi.go │ │ │ ├── querier.go │ │ │ ├── series.go │ │ │ └── series_test.go │ │ ├── refill.go │ │ ├── refill_sender.go │ │ ├── remotewriter │ │ │ ├── README.md │ │ │ ├── cursor.go │ │ │ ├── cursor_test.go │ │ │ ├── datasource.go │ │ │ ├── decoder.go │ │ │ ├── destination.go │ │ │ ├── errors.go │ │ │ ├── iterator.go │ │ │ ├── remotewriter.go │ │ │ ├── remotewriter_test.go │ │ │ ├── walreader.go │ │ │ ├── writeloop.go │ │ │ ├── writeloop_test.go │ │ │ └── writer.go │ │ ├── rotate_timer.go │ │ ├── sender.go │ │ ├── storage_manager.go │ │ └── transport.go │ ├── server │ │ ├── transport.go │ │ └── transport_test.go │ ├── transport │ │ └── transport.go │ └── util │ │ ├── closer.go │ │ ├── fn_writer.go │ │ ├── offset_reader.go │ │ ├── optional │ │ └── optional.go │ │ ├── profile.go │ │ ├── registerer.go │ │ ├── shutdown.go │ │ └── varint.go ├── head │ ├── chunk_recoder.h │ ├── chunk_recoder_tests.cpp │ ├── status.h │ └── status_tests.cpp ├── integration_tests │ ├── configuration.cpp │ ├── configuration.h │ ├── filling_snug_composites_from_stream.cpp │ └── test_file_name_suffix.h ├── performance_tests │ ├── benchmarks │ │ ├── BUILD │ │ └── generate_reverse_index_benchmark.cpp │ ├── chunk_recoder_test.cpp │ ├── chunk_recoder_test.h │ ├── config.cpp │ ├── config.h │ ├── dummy_wal.h │ ├── full_load_lss_test.cpp │ ├── full_load_lss_test.h │ ├── full_save_lss_test.cpp │ ├── full_save_lss_test.h │ ├── load_gorilla_from_wal_and_calculate_hash_over_label_set_names_test.cpp │ ├── load_gorilla_from_wal_and_calculate_hash_over_label_set_names_test.h │ ├── load_gorilla_from_wal_and_calculate_hash_over_label_sets_test.cpp │ ├── load_gorilla_from_wal_and_calculate_hash_over_label_sets_test.h │ ├── load_gorilla_from_wal_and_iterate_over_label_name_and_value_ids_test.cpp │ ├── load_gorilla_from_wal_and_iterate_over_label_name_and_value_ids_test.h │ ├── load_gorilla_from_wal_and_iterate_over_label_names_and_values_test.cpp │ ├── load_gorilla_from_wal_and_iterate_over_label_names_and_values_test.h │ ├── load_gorilla_from_wal_and_iterate_over_label_set_ids_test.cpp │ ├── load_gorilla_from_wal_and_iterate_over_label_set_ids_test.h │ ├── load_gorilla_from_wal_and_iterate_over_label_set_names_test.cpp │ ├── load_gorilla_from_wal_and_iterate_over_label_set_names_test.h │ ├── load_gorilla_from_wal_and_iterate_over_sample_label_name_ids_test.cpp │ ├── load_gorilla_from_wal_and_iterate_over_sample_label_name_ids_test.h │ ├── load_gorilla_from_wal_and_iterate_over_series_label_name_ids_test.cpp │ ├── load_gorilla_from_wal_and_iterate_over_series_label_name_ids_test.h │ ├── load_gorilla_from_wal_and_make_remote_write_from_it_test.cpp │ ├── load_gorilla_from_wal_and_make_remote_write_from_it_test.h │ ├── load_gorilla_from_wal_and_process_data.cpp │ ├── load_gorilla_from_wal_and_process_data.h │ ├── load_lss_from_wal_test.cpp │ ├── load_lss_from_wal_test.h │ ├── load_ordered_indexing_table_in_loop_test.cpp │ ├── load_ordered_indexing_table_in_loop_test.h │ ├── load_protobuf_non_naned_wal_and_process_it_with_stale_nans.cpp │ ├── load_protobuf_non_naned_wal_and_process_it_with_stale_nans.h │ ├── load_protobuf_wal_and_save_gorilla_to_sharded_wal_test.cpp │ ├── load_protobuf_wal_and_save_gorilla_to_sharded_wal_test.h │ ├── load_protobuf_wal_and_save_gorilla_to_wal_test.cpp │ ├── load_protobuf_wal_and_save_gorilla_to_wal_test.h │ ├── load_protobuf_wal_and_save_gorilla_to_wal_with_redundants_test.cpp │ ├── load_protobuf_wal_and_save_gorilla_to_wal_with_redundants_test.h │ ├── log.cpp │ ├── log.h │ ├── metric.cpp │ ├── metric.h │ ├── metrics.cpp │ ├── metrics.h │ ├── performance_tests.cpp │ ├── save_gorilla_to_wal_test.cpp │ ├── save_gorilla_to_wal_test.h │ ├── save_lss_to_wal_test.cpp │ ├── save_lss_to_wal_test.h │ ├── series_data_encoder_test.cpp │ ├── series_data_encoder_test.h │ ├── series_index │ │ ├── generate_cedarpp_series_index_test.cpp │ │ ├── generate_cedarpp_series_index_test.h │ │ ├── generate_queryable_encoding_bimap_test.cpp │ │ ├── generate_queryable_encoding_bimap_test.h │ │ ├── generate_series_reverse_index_test.cpp │ │ └── generate_series_reverse_index_test.h │ ├── test.cpp │ ├── test.h │ ├── test_with_input_and_output.cpp │ ├── test_with_input_and_output.h │ ├── test_with_input_only.cpp │ ├── test_with_input_only.h │ ├── tests_database.cpp │ ├── tests_database.h │ ├── write_protobuf_non_naned_wal_test.cpp │ ├── write_protobuf_non_naned_wal_test.h │ ├── write_protobuf_wal_test.cpp │ └── write_protobuf_wal_test.h ├── primitives │ ├── go_model.h │ ├── go_slice.h │ ├── go_slice_protozero.h │ ├── hash.h │ ├── label_set.h │ ├── labels_builder.h │ ├── primitives.h │ ├── sample.h │ ├── snug_composites.h │ ├── snug_composites_filaments.h │ ├── tests │ │ ├── go_model_tests.cpp │ │ ├── go_slice_tests.cpp │ │ ├── labels_builder_tests.cpp │ │ ├── primitives_tests.cpp │ │ ├── snug_composites_filaments_tests.cpp │ │ └── snug_composites_tests.cpp │ └── timeseries.h ├── prometheus │ ├── hashdex.h │ ├── label_matcher.h │ ├── metric.h │ ├── query.h │ ├── relabeler.h │ ├── remote.h │ ├── remote_write.h │ ├── stateless_relabeler.h │ ├── tests │ │ ├── relabeler_tests.cpp │ │ ├── remote_tests.cpp │ │ ├── stateless_relabeler_tests.cpp │ │ └── tsdb │ │ │ └── chunkenc │ │ │ ├── bstream_tests.cpp │ │ │ └── xor_tests.cpp │ ├── textparse │ │ ├── README.md │ │ ├── escape.h │ │ ├── escape_tests.cpp │ │ ├── open_metrics │ │ │ ├── tokenizer.cpp │ │ │ ├── tokenizer.cxx │ │ │ ├── tokenizer.h │ │ │ └── tokenizer_tests.cpp │ │ ├── prometheus │ │ │ ├── tokenizer.cpp │ │ │ ├── tokenizer.cxx │ │ │ ├── tokenizer.h │ │ │ └── tokenizer_tests.cpp │ │ └── types.h │ ├── tsdb │ │ ├── chunkenc │ │ │ ├── bstream.h │ │ │ └── xor.h │ │ └── index │ │ │ ├── stream_writer.h │ │ │ ├── toc.h │ │ │ ├── toc_writer.h │ │ │ └── types.h │ └── value.h ├── scripts │ ├── bazel.mk │ ├── ci_get_go_test_flags.sh │ ├── ci_get_static_lib_target_name.sh │ ├── ci_run_unit_tests.sh │ ├── err_code_gen.sh │ └── test_coredump.sh ├── series_data │ ├── benchmarks │ │ ├── BUILD │ │ └── series_data_encoder_benchmark.cpp │ ├── chunk │ │ ├── data_chunk.h │ │ ├── finalized_chunk.h │ │ ├── outdated_chunk.h │ │ └── serialized_chunk.h │ ├── chunk_finalizer.h │ ├── common.h │ ├── concepts.h │ ├── data_storage.h │ ├── decoder.h │ ├── decoder │ │ ├── asc_integer.h │ │ ├── asc_integer_then_values_gorilla.h │ │ ├── constant.h │ │ ├── decorator │ │ │ ├── interval_decode_iterator.h │ │ │ └── stale_nan_deduplicate_iterator.h │ │ ├── gorilla.h │ │ ├── traits.h │ │ ├── two_double_constant.h │ │ ├── universal_decode_iterator.h │ │ └── values_gorilla.h │ ├── encoder.h │ ├── encoder │ │ ├── bit_sequence.h │ │ ├── encoder_variant.h │ │ ├── gorilla.h │ │ ├── numeric.h │ │ ├── sample.h │ │ ├── timestamp │ │ │ ├── encoder.h │ │ │ └── state.h │ │ ├── value │ │ │ ├── asc_integer.h │ │ │ ├── asc_integer_then_values_gorilla.h │ │ │ ├── constant_value.h │ │ │ ├── double_constant.h │ │ │ ├── float32_constant.h │ │ │ ├── two_double_constant.h │ │ │ ├── uint32_constant.h │ │ │ └── values_gorilla.h │ │ └── zig_zag_timestamp_gorilla.h │ ├── outdated_chunk_merger.h │ ├── outdated_sample_encoder.h │ ├── querier │ │ ├── instant_querier.h │ │ ├── querier.h │ │ └── query.h │ ├── serialization │ │ ├── deserializer.h │ │ └── serializer.h │ └── tests │ │ ├── data_storage_tests.cpp │ │ ├── decoder │ │ └── decorator │ │ │ ├── interval_decode_iterator_tests.cpp │ │ │ └── stale_nan_deduplicate_iterator.cpp │ │ ├── encoder │ │ ├── gorilla_tests.cpp │ │ ├── timestamp │ │ │ └── encoder_tests.cpp │ │ └── value │ │ │ ├── asc_integer_tests.cpp │ │ │ ├── double_constant_tests.cpp │ │ │ ├── float32_constant_tests.cpp │ │ │ ├── two_double_constant_tests.cpp │ │ │ ├── uint32_constant_tests.cpp │ │ │ └── values_gorilla_tests.cpp │ │ ├── encoder_tests.cpp │ │ ├── outdated_chunk_merger_tests.cpp │ │ ├── outdated_sample_encoder_tests.cpp │ │ ├── querier │ │ ├── instant_querier_test.cpp │ │ ├── querier_tests.cpp │ │ └── query_tests.cpp │ │ └── serialization │ │ └── serializer_deserializer_tests.cpp ├── series_index │ ├── prometheus │ │ └── tsdb │ │ │ └── index │ │ │ ├── index_writer.h │ │ │ ├── section_writer │ │ │ ├── label_indices_writer.h │ │ │ ├── postings_writer.h │ │ │ ├── series_writer.h │ │ │ └── symbols_writer.h │ │ │ └── types.h │ ├── queried_series.h │ ├── querier │ │ ├── label_names_querier.h │ │ ├── label_values_querier.h │ │ ├── querier.h │ │ ├── regexp │ │ │ ├── match_analyzer.h │ │ │ ├── regexp.h │ │ │ └── regexp_searcher.h │ │ ├── selector_querier.h │ │ └── set_operations.h │ ├── queryable_encoding_bimap.h │ ├── reverse_index.h │ ├── sorting_index.h │ ├── tests │ │ ├── prometheus │ │ │ └── tsdb │ │ │ │ └── index │ │ │ │ └── section_writer │ │ │ │ ├── label_indices_writer_tests.cpp │ │ │ │ ├── postings_writer_tests.cpp │ │ │ │ ├── series_writer_tests.cpp │ │ │ │ └── symbols_writer_tests.cpp │ │ ├── querier │ │ │ ├── label_names_querier_tests.cpp │ │ │ ├── label_values_querier_tests.cpp │ │ │ ├── printer.h │ │ │ ├── querier_tests.cpp │ │ │ ├── regexp │ │ │ │ └── regexp_searcher_tests.cpp │ │ │ ├── selector_querier_tests.cpp │ │ │ └── set_operations_tests.cpp │ │ ├── queryable_encoding_bimap_tests.cpp │ │ ├── reverse_index_tests.cpp │ │ ├── sorting_index_tests.cpp │ │ ├── trie │ │ │ ├── cedarpp_trie_tests.cpp │ │ │ └── regexp_searcher_test_cases.h │ │ └── trie_index_tests.cpp │ ├── trie │ │ ├── cedarpp_tree.h │ │ └── concepts.h │ └── trie_index.h ├── third_party │ ├── BUILD │ ├── cedar.BUILD │ ├── fastfloat │ │ ├── BUILD │ │ └── WORKSPACE │ ├── jemalloc.BUILD │ ├── lz4.BUILD │ ├── parallel_hashmap.BUILD │ ├── patches │ │ ├── cedar │ │ │ ├── BUILD │ │ │ └── cedarpp.h.patch │ │ ├── com_google_absl │ │ │ ├── BUILD │ │ │ └── no-werror.patch │ │ ├── google_benchmark │ │ │ ├── BUILD │ │ │ └── BUILD.bazel.patch │ │ ├── gtest │ │ │ ├── BUILD │ │ │ └── no-werror.patch │ │ ├── jemalloc │ │ │ ├── 0001-musl-noexcept-fix.patch │ │ │ ├── 0002-manual-init.patch │ │ │ └── BUILD │ │ ├── lz4 │ │ │ ├── BUILD │ │ │ ├── lz4frame.c.patch │ │ │ ├── lz4frame.h.patch │ │ │ └── lz4hc.c.patch │ │ ├── parallel_hashmap │ │ │ ├── BUILD │ │ │ └── phmap_base.h.patch │ │ ├── quasis_crypto │ │ │ ├── BUILD │ │ │ └── md5.hh.patch │ │ ├── re2 │ │ │ ├── BUILD │ │ │ └── no-werror.patch │ │ └── roaring │ │ │ ├── 0001-disable-test-dependencies.patch │ │ │ └── BUILD │ ├── protozero │ │ ├── basic_pbf_builder.hpp │ │ ├── basic_pbf_writer.hpp │ │ ├── buffer_fixed.hpp │ │ ├── buffer_string.hpp │ │ ├── buffer_tmpl.hpp │ │ ├── buffer_vector.hpp │ │ ├── byteswap.hpp │ │ ├── config.hpp │ │ ├── data_view.hpp │ │ ├── exception.hpp │ │ ├── iterators.hpp │ │ ├── pbf_builder.hpp │ │ ├── pbf_message.hpp │ │ ├── pbf_reader.hpp │ │ ├── pbf_writer.hpp │ │ ├── types.hpp │ │ ├── varint.hpp │ │ └── version.hpp │ ├── quasis_crypto.BUILD │ ├── roaring.BUILD │ ├── scope_exit.BUILD │ ├── simdutf.BUILD │ ├── uuid.h │ └── xxHash.BUILD ├── tools │ ├── block_converter │ │ ├── go.mod │ │ ├── go.sum │ │ └── main.go │ └── refill_reader │ │ ├── go.mod │ │ ├── go.sum │ │ └── main.go └── wal │ ├── benchmarks │ ├── BUILD │ └── scraper_benchmark.cpp │ ├── concepts.h │ ├── decoder.h │ ├── encoder.h │ ├── hashdex │ ├── basic_decoder.h │ ├── go_model.h │ ├── go_model_tests.cpp │ ├── metric.h │ ├── protobuf.h │ ├── protobuf_tests.cpp │ ├── scraper │ │ ├── parser.h │ │ ├── scraper.h │ │ └── scraper_tests.cpp │ └── test_fixture.h │ ├── heartbeat_metrics_inserter.h │ ├── output_decoder.h │ ├── tests │ ├── output_decoder_tests.cpp │ └── wal_tests.cpp │ └── wal.h ├── prompb ├── README.md ├── buf.lock ├── buf.yaml ├── custom.go ├── io │ └── prometheus │ │ └── client │ │ ├── metrics.pb.go │ │ └── metrics.proto ├── remote.pb.go ├── remote.proto ├── types.pb.go └── types.proto ├── promql ├── bench_test.go ├── engine.go ├── engine_internal_test.go ├── engine_test.go ├── functions.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 ├── 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 │ ├── test.go │ ├── test_test.go │ └── testdata │ │ ├── aggregators.test │ │ ├── at_modifier.test │ │ ├── collision.test │ │ ├── functions.test │ │ ├── histograms.test │ │ ├── literals.test │ │ ├── native_histograms.test │ │ ├── operators.test │ │ ├── selectors.test │ │ ├── staleness.test │ │ ├── subquery.test │ │ └── trig_functions.test ├── quantile.go ├── quantile_test.go ├── query_logger.go ├── query_logger_test.go ├── test.go ├── test_test.go ├── testdata │ ├── aggregators.test │ ├── at_modifier.test │ ├── collision.test │ ├── functions.test │ ├── histograms.test │ ├── literals.test │ ├── native_histograms.test │ ├── operators.test │ ├── selectors.test │ ├── staleness.test │ ├── subquery.test │ └── trig_functions.test ├── value.go └── value_test.go ├── rules ├── alerting.go ├── alerting_test.go ├── fixtures │ ├── rules.yaml │ ├── rules2.yaml │ ├── rules2_copy.yaml │ ├── rules_dependencies.yaml │ ├── rules_multiple.yaml │ ├── rules_multiple_groups.yaml │ └── rules_multiple_independent.yaml ├── group.go ├── group_test.go ├── manager.go ├── manager_test.go ├── origin.go ├── origin_test.go ├── recording.go ├── recording_test.go └── rule.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 ├── binary_replace.sh ├── check-go-mod-version.sh ├── compress_assets.sh ├── genproto.sh ├── golangci-lint.yml ├── npm-deps.sh ├── package_assets.sh ├── sync_repo_files.sh ├── tools.go └── ui_release.sh ├── storage ├── buffer.go ├── buffer_test.go ├── errors.go ├── fanout.go ├── fanout_test.go ├── generic.go ├── interface.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_managedidentity.yaml │ │ │ ├── azuread_good_oauth.yaml │ │ │ └── azuread_good_sdk.yaml │ ├── chunked.go │ ├── chunked_test.go │ ├── client.go │ ├── client_test.go │ ├── codec.go │ ├── codec_test.go │ ├── ewma.go │ ├── intern.go │ ├── intern_test.go │ ├── max_timestamp.go │ ├── metadata_watcher.go │ ├── metadata_watcher_test.go │ ├── otlptranslator │ │ ├── README.md │ │ ├── prometheus │ │ │ ├── normalize_label.go │ │ │ ├── normalize_name.go │ │ │ └── unit_to_ucum.go │ │ ├── prometheusremotewrite │ │ │ ├── helper.go │ │ │ ├── histograms.go │ │ │ ├── metrics_to_prw.go │ │ │ ├── metrics_to_prw_test.go │ │ │ ├── number_data_points.go │ │ │ ├── otlp_to_openmetrics_metadata.go │ │ │ └── timeseries.go │ │ └── update-copy.sh │ ├── queue_manager.go │ ├── queue_manager_test.go │ ├── read.go │ ├── read_handler.go │ ├── read_handler_test.go │ ├── read_test.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 ├── agent │ ├── db.go │ ├── db_test.go │ ├── op_interface.go │ ├── series.go │ └── series_test.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 ├── example_test.go ├── exemplar.go ├── exemplar_test.go ├── external.go ├── fileutil │ ├── dir.go │ ├── dir_unix.go │ ├── dir_windows.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 ├── head.go ├── head_append.go ├── head_bench_test.go ├── head_read.go ├── head_read_test.go ├── head_test.go ├── head_wal.go ├── index │ ├── index.go │ ├── index_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 ├── querier.go ├── querier_bench_test.go ├── querier_test.go ├── record │ ├── record.go │ └── record_test.go ├── repair.go ├── repair_test.go ├── testdata │ ├── 20kseries.json │ ├── index_format_v1 │ │ ├── chunks │ │ │ └── 000001 │ │ ├── index │ │ ├── meta.json │ │ └── tombstones │ └── repair_index_version │ │ └── 01BZJ9WJQPWHGNC2W4J9TA62KC │ │ ├── index │ │ └── meta.json ├── tombstones │ ├── tombstones.go │ └── tombstones_test.go ├── trigger.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 ├── util ├── almost │ └── almost.go ├── annotations │ └── annotations.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 ├── logging │ ├── dedupe.go │ ├── dedupe_test.go │ ├── file.go │ ├── file_test.go │ └── ratelimit.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 │ ├── logging.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 │ │ └── pp_api.go ├── federate.go ├── federate_test.go ├── op_federate.go ├── ui │ ├── .gitignore │ ├── .nvmrc │ ├── README.md │ ├── assets_embed.go │ ├── build_ui.sh │ ├── embed.go.tmpl │ ├── module │ │ ├── codemirror-promql │ │ │ ├── .eslintrc.json │ │ │ ├── .gitignore │ │ │ ├── .npmignore │ │ │ ├── README.md │ │ │ ├── build.sh │ │ │ ├── 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.json │ │ ├── public │ │ │ ├── apple-touch-icon.png │ │ │ ├── favicon-96x96.png │ │ │ ├── favicon.ico │ │ │ ├── favicon.svg │ │ │ ├── index.html │ │ │ ├── manifest.json │ │ │ ├── web-app-manifest-192x192.png │ │ │ └── web-app-manifest-512x512.png │ │ ├── src │ │ │ ├── App.test.tsx │ │ │ ├── App.tsx │ │ │ ├── Language.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 │ │ │ ├── i18n │ │ │ │ ├── index.ts │ │ │ │ └── locales │ │ │ │ │ └── ru.ts │ │ │ ├── images │ │ │ │ ├── prometheus_logo_grey.svg │ │ │ │ └── prompp_logo_line.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 │ │ │ │ │ ├── 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 ├── werf-giterminism.yaml ├── werf.yaml └── werf_cleanup.yaml /.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/CODEOWNERS: -------------------------------------------------------------------------------- 1 | .github/ @vladimirGuryanov @lazovskiy @vporoshok 2 | /pp/ @vporoshok -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: 🤔 Ask a question 4 | url: https://github.com/deckhouse/prompp/discussions/new?category=q-a 5 | about: Ask and discuss questions with other community members 6 | 7 | - name: 💬 Telegram channel 8 | url: https://t.me/prom_plus_plus 9 | about: Please ask and answer questions here 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *# 2 | .#* 3 | *.exe 4 | 5 | /prometheus 6 | /promtool 7 | /prompptool 8 | benchmark.txt 9 | /data 10 | /data-agent 11 | /cmd/prometheus/data 12 | /cmd/prometheus/data-agent 13 | /cmd/prometheus/debug 14 | /benchout 15 | /cmd/promtool/data 16 | /cmd/prompptool/data 17 | /opdata 18 | 19 | !/.travis.yml 20 | !/.promu.yml 21 | !/.golangci.yml 22 | /documentation/examples/remote_storage/remote_storage_adapter/remote_storage_adapter 23 | /documentation/examples/remote_storage/example_write_adapter/example_write_adapter 24 | 25 | npm_licenses.tar.bz2 26 | /web/ui/static/react 27 | 28 | /vendor 29 | /.build 30 | 31 | /**/node_modules 32 | 33 | # Ignore parser debug 34 | y.output 35 | 36 | .envrc 37 | /.idea/vcs.xml 38 | /.idea/prompp.iml 39 | /.idea/modules.xml 40 | 41 | devbuilder 42 | .vscode 43 | .cache 44 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Editor-based HTTP Client requests 5 | /httpRequests/ 6 | # Datasource local storage ignored files 7 | /dataSources/ 8 | /dataSources.local.xml 9 | -------------------------------------------------------------------------------- /.yamllint: -------------------------------------------------------------------------------- 1 | --- 2 | extends: default 3 | ignore: | 4 | ui/react-app/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 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Deckhouse is an Open Source project, and third-party contributions are warmly welcome. 4 | 5 | ## What to do 6 | 7 | - Contact us via [Telegram chat](https://t.me/prom_plus_plus) for any questions on developing Deckhouse Prom++ & contributing to this repo. 8 | - Open your [issues](https://github.com/deckhouse/prompp/issues) and [discussions](https://github.com/deckhouse/prompp/discussions) in this repo. 9 | - If you believe no preliminary discussion is required, submit your [PRs](https://github.com/deckhouse/prompp/pulls) with your code changes straight away. 10 | 11 | P.S. The [maintainers list](https://github.com/deckhouse/prompp/blob/pp/MAINTAINERS.md) might also be helpful to reach our core developers. 12 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 2.53.2-0.3.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.nonexistant: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deckhouse/prompp/6fccc6fb9288df50294898bacd9a1485b18f8c80/cmd/promtool/testdata/bad-sd-file-extension.nonexistant -------------------------------------------------------------------------------- /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: v1 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/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/deckhouse/prompp/6fccc6fb9288df50294898bacd9a1485b18f8c80/cmd/promtool/testdata/prometheus-config.good.yml -------------------------------------------------------------------------------- /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_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/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/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_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 | scrape_configs: 3 | - job_name: prometheus 4 | - job_name: service-x 5 | - job_name: prometheus 6 | -------------------------------------------------------------------------------- /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: l-$1 6 | -------------------------------------------------------------------------------- /config/testdata/labelname.bad.yml: -------------------------------------------------------------------------------- 1 | global: 2 | external_labels: 3 | not$allowed: value 4 | -------------------------------------------------------------------------------- /config/testdata/labelname2.bad.yml: -------------------------------------------------------------------------------- 1 | global: 2 | external_labels: 3 | 'not:allowed': 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/lowercase.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | relabel_configs: 4 | - action: lowercase 5 | source_labels: [__name__] 6 | -------------------------------------------------------------------------------- /config/testdata/lowercase2.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | relabel_configs: 4 | - action: lowercase 5 | source_labels: [__name__] 6 | target_label: 42lab 7 | -------------------------------------------------------------------------------- /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/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/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_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_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_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.json: -------------------------------------------------------------------------------- 1 | { 2 | "targets": ["1.2.3.4:9100"], 3 | "labels": { 4 | "some_valid_label": "foo", 5 | "oops:this-label-is-invalid": "bar" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /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 | not:valid_label: 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/uppercase2.bad.yml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: prometheus 3 | relabel_configs: 4 | - action: uppercase 5 | source_labels: [__name__] 6 | target_label: 42lab 7 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /consoles/index.html.example: -------------------------------------------------------------------------------- 1 | {{ template "head" . }} 2 | 3 | {{ template "prom_right_table_head" }} 4 | {{ template "prom_right_table_tail" }} 5 | 6 | {{ template "prom_content_head" . }} 7 |

Overview

8 |

These are example consoles for Prometheus.

9 | 10 |

These consoles expect exporters to have the following job labels:

11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
ExporterJob label
Node Exporternode
Prometheusprometheus
25 | 26 | {{ template "prom_content_tail" . }} 27 | 28 | {{ template "tail" }} 29 | -------------------------------------------------------------------------------- /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/deckhouse/prompp/6fccc6fb9288df50294898bacd9a1485b18f8c80/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/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-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/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 | ./example_write_adapter 11 | ``` 12 | 13 | ...and then add the following to your `prometheus.yml`: 14 | 15 | ```yaml 16 | remote_write: 17 | - url: "http://localhost:1234/receive" 18 | ``` 19 | 20 | Then start Prometheus: 21 | 22 | ``` 23 | ./prometheus 24 | ``` 25 | -------------------------------------------------------------------------------- /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-lib.git", 8 | "subdir": "grafonnet" 9 | } 10 | }, 11 | "version": "master" 12 | }, 13 | { 14 | "source": { 15 | "git": { 16 | "remote": "https://github.com/grafana/jsonnet-libs.git", 17 | "subdir": "grafana-builder" 18 | } 19 | }, 20 | "version": "master" 21 | } 22 | ], 23 | "legacyImports": false 24 | } 25 | -------------------------------------------------------------------------------- /documentation/prometheus-mixin/mixin.libsonnet: -------------------------------------------------------------------------------- 1 | (import 'config.libsonnet') + 2 | (import 'dashboards.libsonnet') + 3 | (import 'alerts.libsonnet') 4 | -------------------------------------------------------------------------------- /model/labels/labels_common_noncpp.go: -------------------------------------------------------------------------------- 1 | //go:build !stringlabels && !dedupelabels && !cpplabels 2 | 3 | package labels 4 | 5 | import ( 6 | "strings" 7 | 8 | "github.com/prometheus/prometheus/pp/go/cppbridge" 9 | ) 10 | 11 | // NewLabelsWithLSS init LabelsCpp with LabelSetSnapshot and ls id. 12 | func NewLabelsWithLSS(lss *cppbridge.LabelSetSnapshot, id uint32, length uint16) Labels { 13 | if lss == nil { 14 | return EmptyLabels() 15 | } 16 | 17 | builder := NewScratchBuilder(int(length)) 18 | _ = lss.RangeLabelSet(id, func(l cppbridge.Label) error { 19 | // copy string from cpp memory 20 | builder.Add(strings.Clone(l.Name), strings.Clone(l.Value)) 21 | 22 | return nil 23 | }) 24 | 25 | return builder.Labels() 26 | } 27 | -------------------------------------------------------------------------------- /model/labels/labels_common_nonslice_noncpp.go: -------------------------------------------------------------------------------- 1 | //go:build stringlabels || dedupelabels 2 | 3 | package labels 4 | 5 | import "github.com/prometheus/prometheus/pp/go/cppbridge" 6 | 7 | // NewLabelsWithLSS init LabelsCpp with LabelSetSnapshot and ls id. 8 | func NewLabelsWithLSS(lss *cppbridge.LabelSetSnapshot, id uint32, length uint16) Labels { 9 | if lss == nil { 10 | return EmptyLabels() 11 | } 12 | 13 | builder := NewScratchBuilder(int(length)) 14 | _ = lss.RangeLabelSet(id, func(l cppbridge.Label) error { 15 | builder.Add(l.Name, l.Value) 16 | 17 | return nil 18 | }) 19 | 20 | return builder.Labels() 21 | } 22 | -------------------------------------------------------------------------------- /model/rulefmt/testdata/bad_annotation.bad.yaml: -------------------------------------------------------------------------------- 1 | groups: 2 | - name: yolo 3 | rules: 4 | - alert: hola 5 | expr: 1 6 | annotations: 7 | ins-tance: localhost 8 | -------------------------------------------------------------------------------- /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/bad_lname.bad.yaml: -------------------------------------------------------------------------------- 1 | groups: 2 | - name: yolo 3 | rules: 4 | - record: hola 5 | expr: 1 6 | labels: 7 | ins-tance: localhost 8 | -------------------------------------------------------------------------------- /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/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` -------------------------------------------------------------------------------- /pp-pkg/handler/decoder/decoder.go: -------------------------------------------------------------------------------- 1 | package decoder 2 | 3 | import ( 4 | "context" 5 | 6 | "github.com/prometheus/prometheus/pp-pkg/handler/model" 7 | "github.com/prometheus/prometheus/pp/go/cppbridge" 8 | ) 9 | 10 | // Decoder implements decoders. 11 | type Decoder interface { 12 | DecodeToHashdex(ctx context.Context, segment *model.Segment) (cppbridge.HashdexContent, error) 13 | Discard() error 14 | Close() error 15 | } 16 | -------------------------------------------------------------------------------- /pp-pkg/handler/model/metadata.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | import "github.com/google/uuid" 4 | 5 | // Metadata request metadata. 6 | type Metadata struct { 7 | TenantID string 8 | BlockID uuid.UUID 9 | ShardID uint16 10 | ShardsLog uint8 11 | SegmentEncodingVersion uint8 12 | ProtocolVersion uint8 13 | MediaType string 14 | ProductName string 15 | AgentHostname string 16 | AgentUUID uuid.UUID 17 | RelabelerID string 18 | } 19 | -------------------------------------------------------------------------------- /pp-pkg/handler/model/refill.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | // 8 | // RefillProcessingStatus 9 | // 10 | 11 | // RefillProcessingStatus status of processing refill. 12 | type RefillProcessingStatus struct { 13 | Code int 14 | Message string 15 | } 16 | 17 | // Write to writer RefillProcessingStatus. 18 | func (s *RefillProcessingStatus) Write(writer http.ResponseWriter) error { 19 | writer.WriteHeader(s.Code) 20 | _, err := writer.Write([]byte(s.Message)) 21 | return err 22 | } 23 | -------------------------------------------------------------------------------- /pp-pkg/handler/model/utils.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | // ResizeBuffer resize slice and fill zero value. 4 | func ResizeBuffer(size int, buf *[]byte) { 5 | if cap(*buf) < size { 6 | *buf = append(*buf, make([]byte, size)...) 7 | } 8 | 9 | *buf = (*buf)[:size] 10 | (*buf)[0] = 0 11 | 12 | for i := 1; i < len(*buf); i *= 2 { 13 | copy((*buf)[i:], (*buf)[:i]) 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /pp-pkg/receiver/trigger.go: -------------------------------------------------------------------------------- 1 | package receiver 2 | 3 | type ReloadBlocksTriggerNotifier struct { 4 | c chan struct{} 5 | } 6 | 7 | func NewReloadBlocksTriggerNotifier() *ReloadBlocksTriggerNotifier { 8 | return &ReloadBlocksTriggerNotifier{c: make(chan struct{}, 1)} 9 | } 10 | 11 | func (tn *ReloadBlocksTriggerNotifier) Chan() <-chan struct{} { 12 | return tn.c 13 | } 14 | 15 | func (tn *ReloadBlocksTriggerNotifier) NotifyWritten() { 16 | select { 17 | case tn.c <- struct{}{}: 18 | default: 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /pp-pkg/receiver/upgrader.go: -------------------------------------------------------------------------------- 1 | package receiver 2 | 3 | import "github.com/prometheus/prometheus/pp/go/relabeler" 4 | 5 | type DistributorConfigureFunc func(distributor relabeler.Distributor) error 6 | 7 | func (fn DistributorConfigureFunc) Configure(distributor relabeler.Distributor) error { 8 | return fn(distributor) 9 | } 10 | 11 | type HeadConfigureFunc func(head relabeler.Head) error 12 | 13 | func (fn HeadConfigureFunc) Configure(head relabeler.Head) error { 14 | return fn(head) 15 | } 16 | -------------------------------------------------------------------------------- /pp/.bazelignore: -------------------------------------------------------------------------------- 1 | .git 2 | .cache 3 | bazel-bin 4 | bazel-pp 5 | bazel-out 6 | bazel-testlogs 7 | bazel-external 8 | -------------------------------------------------------------------------------- /pp/.bazelrc: -------------------------------------------------------------------------------- 1 | # This flag fixed bazel build error (tested on 7.* versions) 2 | build --noreuse_sandbox_directories 3 | build --fission=yes 4 | build --flag_alias=march=//bazel/toolchain:march 5 | build --flag_alias=asan=//bazel/toolchain:asan 6 | -------------------------------------------------------------------------------- /pp/.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | BasedOnStyle: Chromium 3 | ColumnLimit: 160 4 | AttributeMacros: 5 | - __capability 6 | - __attribute__ 7 | -------------------------------------------------------------------------------- /pp/.clangd: -------------------------------------------------------------------------------- 1 | # Work around https://github.com/clangd/clangd/issues/1004 by ignoring that bazel flag. 2 | CompileFlags: 3 | Remove: 4 | - "-fno-canonical-system-headers" 5 | Add: 6 | - "-std=c++2b" 7 | - "-ferror-limit=0" 8 | - "-frelaxed-template-template-args" 9 | -------------------------------------------------------------------------------- /pp/.gitignore: -------------------------------------------------------------------------------- 1 | data/ 2 | out/ 3 | *.a 4 | performance_tests/test_data/large/* 5 | !performance_tests/test_data/large/dummy_wal.* 6 | performance_tests/test_data/small/* 7 | !performance_tests/test_data/small/dummy_wal.* 8 | bazel-* 9 | .vscode 10 | .cache 11 | .bash_history 12 | MODULE.bazel 13 | MODULE.bazel.lock 14 | -------------------------------------------------------------------------------- /pp/MODULE.bazel: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Bazel now uses Bzlmod by default to manage external dependencies. 3 | # Please consider migrating your external dependencies from WORKSPACE to MODULE.bazel. 4 | # 5 | # For more details, please check https://github.com/bazelbuild/bazel/issues/18958 6 | ############################################################################### 7 | register_toolchains( 8 | "//bazel/toolchain:cc_toolchain_for_g++-13_toolchain_aarch64", 9 | "//bazel/toolchain:cc_toolchain_for_g++-13_toolchain_x86_64", 10 | ) 11 | -------------------------------------------------------------------------------- /pp/bare_bones/benchmarks/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | cc_binary( 4 | name = "stream_v_byte_sequence", 5 | srcs = ["stream_v_byte_benchmark.cpp"], 6 | malloc = "@jemalloc", 7 | deps = [ 8 | "//:bare_bones_headers", 9 | "@google_benchmark//:benchmark_main", 10 | ], 11 | ) 12 | -------------------------------------------------------------------------------- /pp/bare_bones/compiler.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "preprocess.h" 4 | 5 | namespace BareBones::compiler { 6 | 7 | template 8 | static PROMPP_ALWAYS_INLINE void do_not_optimize(const Tp& value) { 9 | __asm__ __volatile__("" ::"m"(value)); 10 | } 11 | 12 | }; // namespace BareBones::compiler 13 | -------------------------------------------------------------------------------- /pp/bare_bones/iterator.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace BareBones::iterator { 6 | 7 | template 8 | class OperationIterator { 9 | public: 10 | using difference_type = ptrdiff_t; 11 | 12 | explicit OperationIterator(Operation& operation) : operation_(&operation) {} 13 | 14 | Operation& operator*() const noexcept { return *operation_; } 15 | OperationIterator& operator++() noexcept { return *this; } 16 | OperationIterator operator++(int) const noexcept { return *this; } 17 | 18 | private: 19 | Operation* operation_; 20 | }; 21 | 22 | }; // namespace BareBones::iterator -------------------------------------------------------------------------------- /pp/bare_bones/numeric.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace BareBones::numeric { 7 | template 8 | consteval auto select_integral_type() { 9 | if constexpr (sizeof(T) <= sizeof(std::uint8_t)) { 10 | return std::uint8_t{}; 11 | } else if constexpr (sizeof(T) <= sizeof(std::uint16_t)) { 12 | return std::uint16_t{}; 13 | } else if constexpr (sizeof(T) <= sizeof(std::uint32_t)) { 14 | return std::uint32_t{}; 15 | } else { 16 | static_assert(sizeof(T) <= sizeof(std::uint64_t), "T is too big to be covered by an integral type!"); 17 | return std::uint64_t{}; 18 | } 19 | } 20 | template 21 | using integral_type_for = decltype(select_integral_type()); 22 | } // namespace BareBones::numeric -------------------------------------------------------------------------------- /pp/bare_bones/tests/coredump_test_separate.cpp: -------------------------------------------------------------------------------- 1 | #include "bare_bones/exception.h" 2 | #include "bare_bones/vector.h" 3 | 4 | int main() { 5 | prompp_enable_coredumps_on_exception(1); 6 | BareBones::Vector vec; 7 | return vec[4]; 8 | } 9 | -------------------------------------------------------------------------------- /pp/bare_bones/utf8.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace BareBones::utf8 { 4 | 5 | static constexpr unsigned char kInvalidChar = 0xC0; 6 | 7 | } -------------------------------------------------------------------------------- /pp/entrypoint/.gitignore: -------------------------------------------------------------------------------- 1 | init/ 2 | temp/ 3 | result/ 4 | -------------------------------------------------------------------------------- /pp/entrypoint/common.h: -------------------------------------------------------------------------------- 1 | #ifdef __cplusplus 2 | extern "C" { 3 | #endif 4 | 5 | /** 6 | * @brief Free memory allocated for response as []byte 7 | * 8 | * @param args *[]byte 9 | */ 10 | void prompp_free_bytes(void* args); 11 | 12 | /** 13 | * @brief Return information about using memory by core 14 | * 15 | * @param res { 16 | * in_use uint64 // bytes in use 17 | * } 18 | */ 19 | void prompp_mem_info(void* res); 20 | 21 | /** 22 | * @brief Dump jemalloc memory profile to file 23 | * 24 | * @param args { 25 | * filename string 26 | * } 27 | * @param res { 28 | * int error 29 | * } 30 | */ 31 | void prompp_dump_memory_profile(void* args, void* res); 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | -------------------------------------------------------------------------------- /pp/entrypoint/entrypoint.h.template: -------------------------------------------------------------------------------- 1 | #ifdef __cplusplus 2 | extern "C" { 3 | #endif 4 | 5 | /** 6 | * @brief return determined flavor 7 | * 8 | * @param res { 9 | * flavor string 10 | * } 11 | */ 12 | void prompp_get_flavor(void* res); 13 | 14 | #ifdef __cplusplus 15 | } 16 | #endif 17 | -------------------------------------------------------------------------------- /pp/entrypoint/exception.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include "bare_bones/exception.h" 8 | #include "bare_bones/preprocess.h" 9 | 10 | namespace entrypoint { 11 | 12 | PROMPP_ALWAYS_INLINE void handle_current_exception(std::ostream& out, const std::source_location location = std::source_location::current()) { 13 | out << location.function_name() << ": "; 14 | 15 | try { 16 | std::rethrow_exception(std::current_exception()); 17 | } catch (const BareBones::Exception& e) { 18 | out << e.message() << '\n' << e.stacktrace(); 19 | } catch (const std::exception& e) { 20 | out << "caught a std::exception, what: " << e.what(); 21 | } catch (...) { 22 | out << "caught an unknown exception"; 23 | } 24 | } 25 | 26 | } // namespace entrypoint 27 | -------------------------------------------------------------------------------- /pp/entrypoint/hashdex.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "wal/hashdex/basic_decoder.h" 6 | #include "wal/hashdex/go_model.h" 7 | #include "wal/hashdex/protobuf.h" 8 | #include "wal/hashdex/scraper/scraper.h" 9 | 10 | /** 11 | * used for indexing HashdexVariant. 12 | */ 13 | enum HashdexType : uint8_t { 14 | kProtobuf = 0, 15 | kGoModel, 16 | kDecoder, 17 | kPrometheusScraper, 18 | kOpenMetricsScraper, 19 | }; 20 | 21 | using HashdexVariant = std::variant; 26 | -------------------------------------------------------------------------------- /pp/entrypoint/head/data_storage.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "series_data/data_storage.h" 4 | 5 | namespace entrypoint::head { 6 | 7 | using DataStoragePtr = std::unique_ptr; 8 | 9 | static_assert(sizeof(DataStoragePtr) == sizeof(void*)); 10 | 11 | } // namespace entrypoint::head 12 | -------------------------------------------------------------------------------- /pp/entrypoint/head/series_data.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "series_data/encoder.h" 6 | #include "series_data/outdated_chunk_merger.h" 7 | #include "series_data/outdated_sample_encoder.h" 8 | 9 | namespace entrypoint::head { 10 | 11 | using Encoder = series_data::Encoder<>; 12 | using OutdatedChunkMerger = series_data::OutdatedChunkMerger; 13 | 14 | struct SeriesDataEncoderWrapper { 15 | Encoder encoder; 16 | 17 | explicit SeriesDataEncoderWrapper(series_data::DataStorage& data_storage) : encoder{data_storage} {} 18 | }; 19 | 20 | using SeriesDataEncoderWrapperPtr = std::unique_ptr; 21 | 22 | static_assert(sizeof(SeriesDataEncoderWrapperPtr) == sizeof(void*)); 23 | 24 | } // namespace entrypoint::head -------------------------------------------------------------------------------- /pp/entrypoint/series_data_decode_iterator.h: -------------------------------------------------------------------------------- 1 | #ifdef __cplusplus 2 | extern "C" { 3 | #endif 4 | 5 | void prompp_series_data_decode_iterator_next(void* args, void* res); 6 | void prompp_series_data_decode_iterator_sample(void* args, void* res); 7 | void prompp_series_data_decode_iterator_dtor(void* args); 8 | 9 | #ifdef __cplusplus 10 | } // extern "C" 11 | #endif 12 | -------------------------------------------------------------------------------- /pp/go/.gitignore: -------------------------------------------------------------------------------- 1 | *dbg*.a 2 | *asan*.a 3 | -------------------------------------------------------------------------------- /pp/go/cppbridge/common.go: -------------------------------------------------------------------------------- 1 | package cppbridge 2 | 3 | // GetFlavor returns recognized architecture flavor 4 | // 5 | //revive:disable:confusing-naming // wrapper 6 | func GetFlavor() string { 7 | return getFlavor() 8 | } 9 | 10 | // MemInfo stats from C++ allocator 11 | type MemInfo struct { 12 | InUse uint64 13 | Allocated uint64 14 | } 15 | 16 | // GetMemInfo returns current C++ allocator stats 17 | func GetMemInfo() MemInfo { 18 | return memInfo() 19 | } 20 | 21 | // DumpMemoryProfile Dump C++ allocated memory profile to file 22 | func DumpMemoryProfile(filename string) bool { 23 | return dumpMemoryProfile(filename) == 0 24 | } 25 | -------------------------------------------------------------------------------- /pp/go/cppbridge/fastcgo/runtime_go1.9.go: -------------------------------------------------------------------------------- 1 | //go:build go1.9 2 | // +build go1.9 3 | 4 | package fastcgo 5 | 6 | type stack struct { 7 | lo uintptr 8 | hi uintptr 9 | } 10 | 11 | type gobuf struct { 12 | sp uintptr 13 | pc uintptr 14 | g uintptr 15 | ctxt uintptr 16 | ret uintptr 17 | lr uintptr 18 | bp uintptr 19 | } 20 | 21 | type m struct { 22 | g0 *g 23 | } 24 | 25 | type g struct { 26 | stack stack 27 | stackguard0 uintptr 28 | stackguard1 uintptr 29 | 30 | _panic uintptr 31 | _defer uintptr 32 | m *m 33 | sched gobuf 34 | } 35 | -------------------------------------------------------------------------------- /pp/go/cppbridge/labels.go: -------------------------------------------------------------------------------- 1 | package cppbridge 2 | 3 | // Labels used for data exchenge between Go and C++ 4 | type Labels []Label 5 | 6 | // Label is a key/value pair of strings. 7 | type Label struct { 8 | Name string 9 | Value string 10 | } 11 | -------------------------------------------------------------------------------- /pp/go/frames/consts.go: -------------------------------------------------------------------------------- 1 | package frames 2 | 3 | // Protocol versions 4 | const ( 5 | UnknownProtocolVersion uint8 = iota 6 | ProtocolVersion1 7 | ProtocolVersion2 8 | ProtocolVersion3 9 | ProtocolVersion4 10 | ) 11 | 12 | const ( 13 | // constant size of type 14 | sizeOfTypeFrame = 1 15 | sizeOfUint8 = 1 16 | sizeOfUint16 = 2 17 | sizeOfUint32 = 4 18 | sizeOfUint64 = 8 19 | sizeOfUUID = 16 20 | 21 | // default version 22 | defaultVersion uint8 = ProtocolVersion4 23 | // magic byte for header 24 | magicByte byte = 165 25 | ) 26 | 27 | // Content versions 28 | const ( 29 | UnknownContentVersion uint8 = iota 30 | ContentVersion1 31 | ContentVersion2 32 | ) 33 | -------------------------------------------------------------------------------- /pp/go/frames/types.go: -------------------------------------------------------------------------------- 1 | package frames 2 | 3 | import "fmt" 4 | 5 | // TypeFrame - type of frame. 6 | type TypeFrame uint8 7 | 8 | // Validate - validate type frame. 9 | func (tf TypeFrame) Validate() error { 10 | if tf < AuthType || tf > FinalType { 11 | return fmt.Errorf("%w: %d", ErrUnknownFrameType, tf) 12 | } 13 | 14 | return nil 15 | } 16 | 17 | // Frame types 18 | const ( 19 | UnknownType TypeFrame = iota 20 | AuthType 21 | ResponseType 22 | RefillType 23 | TitleType 24 | DestinationNamesType 25 | SnapshotType 26 | SegmentType 27 | DrySegmentType 28 | StatusType 29 | RejectStatusType 30 | RefillShardEOFType 31 | FinalType 32 | ) 33 | -------------------------------------------------------------------------------- /pp/go/model/labelmatcher.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | const ( 4 | // MatcherTypeExactMatch - exact match. 5 | MatcherTypeExactMatch uint8 = iota 6 | // MatcherTypeExactNotMatch - exact not match. 7 | MatcherTypeExactNotMatch 8 | // MatcherTypeRegexpMatch - regexp match. 9 | MatcherTypeRegexpMatch 10 | // MatcherTypeRegexpNotMatch - regexp not match. 11 | MatcherTypeRegexpNotMatch 12 | ) 13 | 14 | // LabelMatcher - label matcher. 15 | type LabelMatcher struct { 16 | Name string 17 | Value string 18 | MatcherType uint8 19 | } 20 | -------------------------------------------------------------------------------- /pp/go/model/timeseries.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | // TimeSeries represents samples and labels for a single time series. 4 | type TimeSeries struct { 5 | LabelSet LabelSet 6 | Timestamp uint64 7 | Value float64 8 | } 9 | -------------------------------------------------------------------------------- /pp/go/relabeler/block/noop.go: -------------------------------------------------------------------------------- 1 | package block 2 | 3 | import "time" 4 | 5 | type DelayedNoOpBlockWriter struct { 6 | delay time.Duration 7 | } 8 | 9 | func NewDelayedNoOpBlockWriter(delay time.Duration) *DelayedNoOpBlockWriter { 10 | return &DelayedNoOpBlockWriter{delay: delay} 11 | } 12 | 13 | func (w *DelayedNoOpBlockWriter) Write(_ Block) error { 14 | <-time.After(w.delay) 15 | return nil 16 | } 17 | -------------------------------------------------------------------------------- /pp/go/relabeler/head/catalog/record_test.go: -------------------------------------------------------------------------------- 1 | package catalog 2 | 3 | import ( 4 | "github.com/stretchr/testify/require" 5 | "testing" 6 | ) 7 | 8 | func TestReferenceCounter_IncDecValue(t *testing.T) { 9 | r := NewRecord() 10 | require.Equal(t, int64(0), r.ReferenceCount()) 11 | release := r.Acquire() 12 | require.Equal(t, int64(1), r.ReferenceCount()) 13 | release() 14 | require.Equal(t, int64(0), r.ReferenceCount()) 15 | release() 16 | require.Equal(t, int64(0), r.ReferenceCount()) 17 | } 18 | -------------------------------------------------------------------------------- /pp/go/relabeler/head/catalog/testdata/headv1.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deckhouse/prompp/6fccc6fb9288df50294898bacd9a1485b18f8c80/pp/go/relabeler/head/catalog/testdata/headv1.log -------------------------------------------------------------------------------- /pp/go/relabeler/head/catalog/testdata/headv2.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deckhouse/prompp/6fccc6fb9288df50294898bacd9a1485b18f8c80/pp/go/relabeler/head/catalog/testdata/headv2.log -------------------------------------------------------------------------------- /pp/go/relabeler/head/catalog/testdata/headv3.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deckhouse/prompp/6fccc6fb9288df50294898bacd9a1485b18f8c80/pp/go/relabeler/head/catalog/testdata/headv3.log -------------------------------------------------------------------------------- /pp/go/relabeler/logger.go: -------------------------------------------------------------------------------- 1 | package relabeler 2 | 3 | func noop(string, ...interface{}) {} 4 | 5 | // These variables are set by the common log package. 6 | var ( 7 | Errorf = noop 8 | Warnf = noop 9 | Infof = noop 10 | Debugf = noop 11 | ) 12 | -------------------------------------------------------------------------------- /pp/go/relabeler/logger/logger.go: -------------------------------------------------------------------------------- 1 | package logger 2 | 3 | func noop(string, ...interface{}) {} 4 | 5 | // These variables are set by the common log package. 6 | var ( 7 | Errorf = noop 8 | Warnf = noop 9 | Infof = noop 10 | Debugf = noop 11 | ) 12 | 13 | // Unset logger funcs to NoOp 14 | func Unset() { 15 | Errorf = noop 16 | Warnf = noop 17 | Infof = noop 18 | Debugf = noop 19 | } 20 | -------------------------------------------------------------------------------- /pp/go/relabeler/remotewriter/README.md: -------------------------------------------------------------------------------- 1 | 1. Create cursor. 2 | 2. Create client. 3 | 3. Loop: 4 | 1. create batch. (readTimeout) 5 | 1. read next segment. 6 | 1. if permanent error - batch completed + end of block is reached. 7 | 2. if not permanent error - if batch is fulfilled or deadline reached - batch is completed. 8 | 1. recalculate number of output shards. 9 | 3. if no error, and batch is not full, wait for 5 sec and repeat 10 | 2. try go (write cache). (retry+backoff) 11 | 3. encode protobuf. 12 | 4. send. (retry+backoff) 13 | 1. if outdated 14 | 1. return permanent error 15 | 2. on error -> non permanent error 16 | 3. on success -> nil 17 | 5. try ack. 18 | 6. check end of block 19 | -------------------------------------------------------------------------------- /pp/go/relabeler/remotewriter/errors.go: -------------------------------------------------------------------------------- 1 | package remotewriter 2 | 3 | import ( 4 | "errors" 5 | "io" 6 | ) 7 | 8 | var ( 9 | ErrShardIsCorrupted = errors.New("shard is corrupted") 10 | ErrEndOfBlock = errors.New("end of block") 11 | ErrEmptyReadResult = errors.New("empty read result") 12 | ) 13 | 14 | // CloseAll closes all given closers. 15 | func CloseAll(closers ...io.Closer) error { 16 | var err error 17 | for _, closer := range closers { 18 | if closer != nil { 19 | err = errors.Join(err, closer.Close()) 20 | } 21 | } 22 | return err 23 | } 24 | -------------------------------------------------------------------------------- /pp/go/relabeler/remotewriter/remotewriter_test.go: -------------------------------------------------------------------------------- 1 | package remotewriter 2 | 3 | import ( 4 | "github.com/jonboulle/clockwork" 5 | "github.com/prometheus/prometheus/pp/go/relabeler/head/ready" 6 | "github.com/prometheus/client_golang/prometheus" 7 | "testing" 8 | ) 9 | 10 | func TestRemoteWriter_Run(t *testing.T) { 11 | rw := New("", nil, clockwork.NewFakeClock(), ready.NoOpNotifier{}, prometheus.DefaultRegisterer) 12 | _ = rw 13 | } 14 | -------------------------------------------------------------------------------- /pp/go/relabeler/remotewriter/writer.go: -------------------------------------------------------------------------------- 1 | package remotewriter 2 | 3 | import ( 4 | "context" 5 | 6 | "github.com/prometheus/prometheus/pp/go/cppbridge" 7 | "github.com/prometheus/prometheus/storage/remote" 8 | ) 9 | 10 | type protobufWriter struct { 11 | client remote.WriteClient 12 | } 13 | 14 | func newProtobufWriter(client remote.WriteClient) *protobufWriter { 15 | return &protobufWriter{ 16 | client: client, 17 | } 18 | } 19 | 20 | func (w *protobufWriter) Write(ctx context.Context, protobuf *cppbridge.SnappyProtobufEncodedData) error { 21 | return protobuf.Do(func(buf []byte) error { 22 | if len(buf) == 0 { 23 | return nil 24 | } 25 | 26 | return w.client.Store(ctx, buf, 0) 27 | }) 28 | } 29 | 30 | func (w *protobufWriter) Close() error { 31 | return nil 32 | } 33 | -------------------------------------------------------------------------------- /pp/go/util/closer.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | type Closer struct { 4 | close chan struct{} 5 | closed chan struct{} 6 | } 7 | 8 | func NewCloser() *Closer { 9 | return &Closer{ 10 | close: make(chan struct{}), 11 | closed: make(chan struct{}), 12 | } 13 | } 14 | 15 | func (c *Closer) Done() { 16 | close(c.closed) 17 | } 18 | 19 | func (c *Closer) Signal() <-chan struct{} { 20 | return c.close 21 | } 22 | 23 | func (c *Closer) Close() error { 24 | close(c.close) 25 | <-c.closed 26 | return nil 27 | } 28 | -------------------------------------------------------------------------------- /pp/go/util/fn_writer.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | // FnWriter is a helper functional wrapper to create unusuall writers 4 | type FnWriter func([]byte) (int, error) 5 | 6 | // Write implements io.Writer interface 7 | func (fn FnWriter) Write(p []byte) (int, error) { 8 | return fn(p) 9 | } 10 | -------------------------------------------------------------------------------- /pp/go/util/offset_reader.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import "io" 4 | 5 | // OffsetReader is a wrapper of io.ReaderAt to implement io.Reader interface 6 | type OffsetReader struct { 7 | r io.ReaderAt 8 | off int64 9 | } 10 | 11 | // NewOffsetReader wraps io.ReaderAt with offset 12 | func NewOffsetReader(r io.ReaderAt, off int64) *OffsetReader { 13 | return &OffsetReader{ 14 | r: r, 15 | off: off, 16 | } 17 | } 18 | 19 | // Read implements io.Reader interface 20 | func (or *OffsetReader) Read(p []byte) (int, error) { 21 | n, err := or.r.ReadAt(p, or.off) 22 | or.off += int64(n) 23 | return n, err 24 | } 25 | -------------------------------------------------------------------------------- /pp/go/util/optional/optional.go: -------------------------------------------------------------------------------- 1 | package optional 2 | 3 | type Optional[T any] struct { 4 | isSet bool 5 | value T 6 | } 7 | 8 | func (o *Optional[T]) IsNil() bool { 9 | return !o.isSet 10 | } 11 | 12 | func (o *Optional[T]) Value() T { 13 | return o.value 14 | } 15 | 16 | func (o *Optional[T]) RawValue() *T { 17 | if o.isSet { 18 | return &o.value 19 | } 20 | return nil 21 | } 22 | 23 | func (o *Optional[T]) Set(value T) { 24 | o.isSet = true 25 | o.value = value 26 | } 27 | 28 | func WithRawValue[T any](rawValue *T) Optional[T] { 29 | o := Optional[T]{} 30 | if rawValue != nil { 31 | o.isSet = true 32 | o.value = *rawValue 33 | } 34 | return o 35 | } 36 | -------------------------------------------------------------------------------- /pp/go/util/varint.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | // VarintLen returns how many bytes needed to store x as varint 4 | func VarintLen(x uint64) (n int64) { 5 | for x >= 0x80 { 6 | x >>= 7 7 | n++ 8 | } 9 | return n + 1 10 | } 11 | -------------------------------------------------------------------------------- /pp/integration_tests/configuration.cpp: -------------------------------------------------------------------------------- 1 | #include "configuration.h" 2 | 3 | #include 4 | #include 5 | 6 | namespace Configuration { 7 | 8 | std::string get_path_to_test_data() { 9 | if (auto val = std::getenv("INTEGRATION_TESTS_PATH_TO_TEST_DATA"); val != nullptr) { 10 | return val; 11 | } else { 12 | throw std::runtime_error("Environment variable INTEGRATION_TESTS_PATH_TO_TEST_DATA is not set"); 13 | } 14 | } 15 | 16 | std::string get_input_data_ordering() { 17 | if (auto val = std::getenv("INTEGRATION_TESTS_INPUT_DATA_ORDERING"); val != nullptr) { 18 | return val; 19 | } else { 20 | throw std::runtime_error("Environment variable INTEGRATION_TESTS_INPUT_DATA_ORDERING is not set"); 21 | } 22 | } 23 | 24 | } // namespace Configuration 25 | -------------------------------------------------------------------------------- /pp/integration_tests/configuration.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Configuration { 6 | 7 | std::string get_path_to_test_data(); 8 | std::string get_input_data_ordering(); 9 | 10 | } // namespace Configuration 11 | -------------------------------------------------------------------------------- /pp/integration_tests/test_file_name_suffix.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | inline std::string test_file_name_suffix(const std::string ordering_type) { 7 | if (ordering_type == "TS_LS") { 8 | return "ts_ls.bin.lz4"; 9 | } else if (ordering_type == "LS_TS") { 10 | return "ls_ts.bin.lz4"; 11 | } else if (ordering_type == "LS") { 12 | return "ls_Rts.bin.lz4"; 13 | } else if (ordering_type == "TS") { 14 | return "ts_Rls.bin.lz4"; 15 | } else if (ordering_type == "R") { 16 | return "R.bin.lz4"; 17 | } else { 18 | throw std::runtime_error("Unknown ordering type"); 19 | } 20 | } -------------------------------------------------------------------------------- /pp/performance_tests/benchmarks/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | cc_binary( 4 | name = "generate_reverse_index", 5 | srcs = ["generate_reverse_index_benchmark.cpp"], 6 | malloc = "@jemalloc", 7 | deps = [ 8 | "//:performance_tests_headers", 9 | "@google_benchmark//:benchmark_main", 10 | ], 11 | ) 12 | -------------------------------------------------------------------------------- /pp/performance_tests/chunk_recoder_test.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "performance_tests/test_with_input_only.h" 4 | 5 | namespace performance_tests { 6 | 7 | struct ChunkRecoder : TestWithInputOnly { 8 | std::string input_file_base_name() const final { return "dummy_wal"; } 9 | bool has_output() const final { return false; } 10 | std::string output_file_base_name() const final { return ""; } 11 | void execute(const Config& config, Metrics& metrics) const final; 12 | }; 13 | 14 | } // namespace performance_tests 15 | -------------------------------------------------------------------------------- /pp/performance_tests/config.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | class Config { 7 | static inline const std::string NO_VALUE = ""; 8 | std::unordered_map params_; 9 | 10 | public: 11 | Config() = default; 12 | Config(const Config&) = delete; 13 | Config& operator=(const Config&) = delete; 14 | Config(Config&&) = delete; 15 | Config& operator=(Config&&) = delete; 16 | ~Config() = default; 17 | 18 | void parameter(const std::string& name); 19 | void load(char** args, int n); 20 | const std::string& get_value_of(const std::string& param) const; 21 | }; 22 | -------------------------------------------------------------------------------- /pp/performance_tests/full_load_lss_test.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "test_with_input_only.h" 4 | 5 | struct full_load_lss : public TestWithInputOnly { 6 | std::string input_file_base_name() const final { return "lss_full"; } 7 | bool has_output() const final { return false; } 8 | std::string output_file_base_name() const final { return ""; } 9 | void execute(const Config& config, Metrics& metrics) const final; 10 | }; 11 | -------------------------------------------------------------------------------- /pp/performance_tests/full_save_lss_test.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "test_with_input_and_output.h" 4 | 5 | struct full_save_lss : TestWithInputAndOutput { 6 | std::string input_file_base_name() const final { return "lss_wal"; } 7 | bool has_output() const final { return true; } 8 | std::string output_file_base_name() const final { return "lss_full"; } 9 | void execute(const Config& config, Metrics& metrics) const final; 10 | }; 11 | -------------------------------------------------------------------------------- /pp/performance_tests/load_gorilla_from_wal_and_calculate_hash_over_label_set_names_test.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "load_gorilla_from_wal_and_process_data.h" 4 | 5 | struct load_gorilla_from_wal_and_calculate_hash_over_label_set_names : load_gorilla_from_wal_and_process_data { 6 | std::chrono::nanoseconds process_data(PromPP::WAL::Reader& wal) const final; 7 | void write_metrics(Metrics&) const final; 8 | 9 | private: 10 | mutable std::chrono::nanoseconds period_ = std::chrono::nanoseconds::zero(); 11 | }; 12 | -------------------------------------------------------------------------------- /pp/performance_tests/load_gorilla_from_wal_and_calculate_hash_over_label_sets_test.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "load_gorilla_from_wal_and_process_data.h" 4 | 5 | struct load_gorilla_from_wal_and_calculate_hash_over_label_sets : load_gorilla_from_wal_and_process_data { 6 | std::chrono::nanoseconds process_data(PromPP::WAL::Reader& wal) const final; 7 | void write_metrics(Metrics&) const final; 8 | 9 | private: 10 | mutable std::chrono::nanoseconds period_ = std::chrono::nanoseconds::zero(); 11 | }; 12 | -------------------------------------------------------------------------------- /pp/performance_tests/load_gorilla_from_wal_and_iterate_over_label_name_and_value_ids_test.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "load_gorilla_from_wal_and_process_data.h" 4 | 5 | struct load_gorilla_from_wal_and_iterate_over_label_name_and_value_ids : load_gorilla_from_wal_and_process_data { 6 | std::chrono::nanoseconds process_data(PromPP::WAL::Reader& wal) const final; 7 | void write_metrics(Metrics&) const final; 8 | 9 | private: 10 | mutable std::chrono::nanoseconds period_ = std::chrono::nanoseconds::zero(); 11 | }; 12 | -------------------------------------------------------------------------------- /pp/performance_tests/load_gorilla_from_wal_and_iterate_over_label_names_and_values_test.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "load_gorilla_from_wal_and_process_data.h" 4 | 5 | struct load_gorilla_from_wal_and_iterate_over_label_names_and_values : load_gorilla_from_wal_and_process_data { 6 | std::chrono::nanoseconds process_data(PromPP::WAL::Reader& wal) const final; 7 | void write_metrics(Metrics&) const final; 8 | 9 | private: 10 | mutable std::chrono::nanoseconds period_ = std::chrono::nanoseconds::zero(); 11 | }; 12 | -------------------------------------------------------------------------------- /pp/performance_tests/load_gorilla_from_wal_and_iterate_over_label_set_ids_test.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "load_gorilla_from_wal_and_process_data.h" 4 | 5 | struct load_gorilla_from_wal_and_iterate_over_label_set_ids : load_gorilla_from_wal_and_process_data { 6 | std::chrono::nanoseconds process_data(PromPP::WAL::Reader& wal) const final; 7 | void write_metrics(Metrics&) const final; 8 | 9 | private: 10 | mutable std::chrono::nanoseconds period_ = std::chrono::nanoseconds::zero(); 11 | }; 12 | -------------------------------------------------------------------------------- /pp/performance_tests/load_gorilla_from_wal_and_iterate_over_label_set_names_test.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "load_gorilla_from_wal_and_process_data.h" 4 | 5 | struct load_gorilla_from_wal_and_iterate_over_label_set_names : load_gorilla_from_wal_and_process_data { 6 | std::chrono::nanoseconds process_data(PromPP::WAL::Reader& wal) const final; 7 | void write_metrics(Metrics&) const final; 8 | 9 | private: 10 | mutable std::chrono::nanoseconds period_ = std::chrono::nanoseconds::zero(); 11 | }; 12 | -------------------------------------------------------------------------------- /pp/performance_tests/load_gorilla_from_wal_and_iterate_over_sample_label_name_ids_test.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "load_gorilla_from_wal_and_process_data.h" 4 | 5 | struct load_gorilla_from_wal_and_iterate_over_sample_label_name_ids : public load_gorilla_from_wal_and_process_data { 6 | std::chrono::nanoseconds process_data(PromPP::WAL::Reader& wal) const final; 7 | void write_metrics(Metrics&) const final; 8 | 9 | private: 10 | mutable std::chrono::nanoseconds period_ = std::chrono::nanoseconds::zero(); 11 | }; 12 | -------------------------------------------------------------------------------- /pp/performance_tests/load_gorilla_from_wal_and_iterate_over_series_label_name_ids_test.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "load_gorilla_from_wal_and_process_data.h" 4 | 5 | struct load_gorilla_from_wal_and_iterate_over_series_label_name_ids : load_gorilla_from_wal_and_process_data { 6 | std::chrono::nanoseconds process_data(PromPP::WAL::Reader& wal) const final; 7 | void write_metrics(Metrics&) const final; 8 | 9 | private: 10 | mutable std::chrono::nanoseconds period_ = std::chrono::nanoseconds::zero(); 11 | }; 12 | -------------------------------------------------------------------------------- /pp/performance_tests/load_gorilla_from_wal_and_make_remote_write_from_it_test.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "load_gorilla_from_wal_and_process_data.h" 4 | 5 | struct load_gorilla_from_wal_and_make_remote_write_from_it : load_gorilla_from_wal_and_process_data { 6 | std::chrono::nanoseconds process_data(PromPP::WAL::Reader& wal) const final; 7 | void write_metrics(Metrics&) const final; 8 | 9 | private: 10 | mutable std::chrono::nanoseconds period_ = std::chrono::nanoseconds::zero(); 11 | mutable size_t protobuf_buffer_total_size = 0; 12 | }; 13 | -------------------------------------------------------------------------------- /pp/performance_tests/load_gorilla_from_wal_and_process_data.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "test_with_input_only.h" 6 | #include "wal/wal.h" 7 | 8 | struct load_gorilla_from_wal_and_process_data : public TestWithInputOnly { 9 | std::string input_file_base_name() const final { return "wal"; } 10 | bool has_output() const final { return false; } 11 | std::string output_file_base_name() const final { return ""; } 12 | void execute(const Config& config, Metrics& metrics) const final; 13 | 14 | private: 15 | virtual std::chrono::nanoseconds process_data(PromPP::WAL::Reader& wal) const = 0; 16 | virtual void write_metrics(Metrics&) const = 0; 17 | }; 18 | -------------------------------------------------------------------------------- /pp/performance_tests/load_lss_from_wal_test.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "test_with_input_only.h" 4 | 5 | struct load_lss_from_wal : TestWithInputOnly { 6 | std::string input_file_base_name() const final { return "lss_wal"; } 7 | bool has_output() const final { return false; } 8 | std::string output_file_base_name() const final { return ""; } 9 | void execute(const Config& config, Metrics& metrics) const; 10 | }; 11 | -------------------------------------------------------------------------------- /pp/performance_tests/load_ordered_indexing_table_in_loop_test.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "test_with_input_only.h" 4 | 5 | struct load_ordered_indexing_table_in_loop : TestWithInputOnly { 6 | std::string input_file_base_name() const final { return "lss_full"; } 7 | bool has_output() const final { return false; } 8 | std::string output_file_base_name() const final { return ""; } 9 | void execute(const Config& config, Metrics& metrics) const final; 10 | }; 11 | -------------------------------------------------------------------------------- /pp/performance_tests/load_protobuf_non_naned_wal_and_process_it_with_stale_nans.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "test_with_input_only.h" 4 | 5 | struct load_protobuf_non_naned_wal_and_process_it_with_stale_nans : TestWithInputOnly { 6 | std::string input_file_base_name() const final { return "dummy_wal_for_stale_nan_test"; } 7 | bool has_output() const final { return false; } 8 | std::string output_file_base_name() const final { return ""; } 9 | void execute(const Config& config, Metrics& metrics) const final; 10 | }; 11 | -------------------------------------------------------------------------------- /pp/performance_tests/load_protobuf_wal_and_save_gorilla_to_sharded_wal_test.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "test_with_input_only.h" 4 | 5 | struct load_protobuf_wal_and_save_gorilla_to_sharded_wal : TestWithInputOnly { 6 | std::string input_file_base_name() const final { return "protobuf_wal"; } 7 | bool has_output() const final { return false; } 8 | std::string output_file_base_name() const final { return ""; } 9 | void execute(const Config& config, Metrics& metrics) const final; 10 | 11 | private: 12 | std::vector numbers_of_shards_ = {1, 2, 4, 8, 16, 32, 64, 128, 256}; 13 | }; 14 | -------------------------------------------------------------------------------- /pp/performance_tests/load_protobuf_wal_and_save_gorilla_to_wal_test.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "test_with_input_and_output.h" 4 | 5 | struct load_protobuf_wal_and_save_gorilla_to_wal : TestWithInputAndOutput { 6 | std::string input_file_base_name() const final { return "protobuf_wal"; } 7 | bool has_output() const final { return true; } 8 | std::string output_file_base_name() const final { return "wal"; } 9 | void execute(const Config& config, Metrics& metrics) const final; 10 | }; 11 | -------------------------------------------------------------------------------- /pp/performance_tests/load_protobuf_wal_and_save_gorilla_to_wal_with_redundants_test.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "test_with_input_and_output.h" 4 | 5 | struct load_protobuf_wal_and_save_gorilla_to_wal_with_redundants : TestWithInputAndOutput { 6 | std::string input_file_base_name() const final { return "protobuf_wal"; } 7 | bool has_output() const final { return true; } 8 | std::string output_file_base_name() const final { return "wal"; } 9 | void execute(const Config& config, Metrics& metrics) const final; 10 | }; 11 | -------------------------------------------------------------------------------- /pp/performance_tests/log.cpp: -------------------------------------------------------------------------------- 1 | #include "log.h" 2 | 3 | Logger logger_instance() { 4 | return Logger(); 5 | } 6 | 7 | // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables): static variable for main logger. 8 | static Logger global_logger = logger_instance(); 9 | 10 | Logger::Logger() : should_be_quiet_(false) { 11 | std::cout.sync_with_stdio(false); 12 | } 13 | 14 | void Logger::configure(const Config& config) { 15 | if (config.get_value_of("quiet") == "true") { 16 | global_logger.should_be_quiet_ = true; 17 | } 18 | } 19 | 20 | void Logger::init(const Config& config) { 21 | global_logger.configure(config); 22 | } 23 | 24 | Logger& log() { 25 | return global_logger; 26 | } 27 | -------------------------------------------------------------------------------- /pp/performance_tests/metrics.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "config.h" 6 | #include "metric.h" 7 | 8 | class Metrics { 9 | std::ofstream output_; 10 | bool should_be_quiet_; 11 | 12 | public: 13 | explicit Metrics(const Config& config); 14 | Metrics(const Metrics&) = delete; 15 | Metrics& operator=(const Metrics&) = delete; 16 | Metrics(Metrics&&) = delete; 17 | Metrics& operator=(Metrics&&) = delete; 18 | ~Metrics() = default; 19 | 20 | Metrics& operator<<(const Metric& metric); 21 | }; 22 | -------------------------------------------------------------------------------- /pp/performance_tests/save_gorilla_to_wal_test.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "test_with_input_and_output.h" 4 | 5 | struct save_gorilla_to_wal : TestWithInputAndOutput { 6 | std::string input_file_base_name() const final { return "dummy_wal"; } 7 | bool has_output() const final { return true; } 8 | std::string output_file_base_name() const final { return "wal"; } 9 | void execute(const Config& config, Metrics& metrics) const final; 10 | }; 11 | -------------------------------------------------------------------------------- /pp/performance_tests/save_lss_to_wal_test.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "test_with_input_and_output.h" 4 | 5 | struct save_lss_to_wal : TestWithInputAndOutput { 6 | std::string input_file_base_name() const final { return "dummy_wal"; } 7 | bool has_output() const final { return true; } 8 | std::string output_file_base_name() const final { return "lss_wal"; } 9 | void execute(const Config& config, Metrics& metrics) const final; 10 | }; 11 | -------------------------------------------------------------------------------- /pp/performance_tests/series_data_encoder_test.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "performance_tests/test_with_input_only.h" 4 | 5 | namespace performance_tests { 6 | 7 | struct SeriesDataEncoder : TestWithInputOnly { 8 | std::string input_file_base_name() const final { return "dummy_wal"; } 9 | bool has_output() const final { return false; } 10 | std::string output_file_base_name() const final { return ""; } 11 | void execute(const Config& config, Metrics& metrics) const final; 12 | }; 13 | 14 | } // namespace performance_tests 15 | -------------------------------------------------------------------------------- /pp/performance_tests/series_index/generate_cedarpp_series_index_test.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "performance_tests/test_with_input_only.h" 4 | 5 | namespace performance_tests::series_index { 6 | 7 | struct GenerateCedarppSeriesIndex : TestWithInputOnly { 8 | std::string input_file_base_name() const final { return "dummy_wal"; } 9 | bool has_output() const final { return false; } 10 | std::string output_file_base_name() const final { return ""; } 11 | void execute(const Config& config, Metrics& metrics) const final; 12 | }; 13 | 14 | } // namespace performance_tests::series_index 15 | -------------------------------------------------------------------------------- /pp/performance_tests/series_index/generate_queryable_encoding_bimap_test.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "performance_tests/test_with_input_only.h" 4 | 5 | namespace performance_tests::series_index { 6 | 7 | struct GenerateQueryableEncodingBimap : TestWithInputOnly { 8 | std::string input_file_base_name() const final { return "dummy_wal"; } 9 | bool has_output() const final { return false; } 10 | std::string output_file_base_name() const final { return ""; } 11 | void execute(const Config& config, Metrics& metrics) const final; 12 | }; 13 | 14 | } // namespace performance_tests::series_index 15 | -------------------------------------------------------------------------------- /pp/performance_tests/series_index/generate_series_reverse_index_test.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "performance_tests/test_with_input_only.h" 4 | 5 | namespace performance_tests::series_index { 6 | 7 | struct GenerateSeriesReverseIndex : TestWithInputOnly { 8 | std::string input_file_base_name() const final { return "dummy_wal"; } 9 | bool has_output() const final { return false; } 10 | std::string output_file_base_name() const final { return ""; } 11 | void execute(const Config& config, Metrics& metrics) const final; 12 | }; 13 | 14 | } // namespace performance_tests::series_index 15 | -------------------------------------------------------------------------------- /pp/performance_tests/test.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "config.h" 6 | #include "metrics.h" 7 | 8 | struct Test { 9 | Test() = default; 10 | Test(const Test&) = delete; 11 | Test& operator=(const Test&) = delete; 12 | Test(Test&&) = delete; 13 | Test& operator=(Test&&) = delete; 14 | 15 | virtual void run(const Config&, Metrics& metrics) const = 0; 16 | std::string name() const; 17 | std::string test_data_file_name_suffix(const Config&) const; 18 | std::string input_file_name(const Config&) const; 19 | std::string output_file_name(const Config&) const; 20 | 21 | virtual ~Test() = default; 22 | 23 | protected: 24 | virtual std::string input_file_base_name() const = 0; 25 | virtual bool has_output() const = 0; 26 | virtual std::string output_file_base_name() const = 0; 27 | }; 28 | -------------------------------------------------------------------------------- /pp/performance_tests/test_with_input_and_output.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "metrics.h" 4 | #include "test.h" 5 | 6 | struct TestWithInputAndOutput : Test { 7 | void run(const Config&, Metrics& metrics) const final; 8 | 9 | protected: 10 | std::string input_file_full_name(const Config& config) const; 11 | std::string output_file_full_name(const Config& config) const; 12 | virtual void execute(const Config& config, Metrics& metrics) const = 0; 13 | std::string output_file_base_name() const override = 0; 14 | }; 15 | -------------------------------------------------------------------------------- /pp/performance_tests/test_with_input_only.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "test.h" 4 | 5 | struct TestWithInputOnly : Test { 6 | void run(const Config&, Metrics& metrics) const final; 7 | 8 | protected: 9 | std::string input_file_full_name(const Config& config) const; 10 | virtual void execute(const Config& config, Metrics& metrics) const = 0; 11 | }; 12 | -------------------------------------------------------------------------------- /pp/performance_tests/tests_database.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include "test.h" 7 | 8 | class TestsDatabase { 9 | std::vector> tests_; 10 | std::unordered_map mapping_between_test_name_and_test_number; 11 | 12 | public: 13 | TestsDatabase() = default; 14 | TestsDatabase(const TestsDatabase&) = delete; 15 | TestsDatabase& operator=(const TestsDatabase&) = delete; 16 | TestsDatabase(TestsDatabase&&) = delete; 17 | TestsDatabase& operator=(TestsDatabase&&) = delete; 18 | ~TestsDatabase() = default; 19 | 20 | void add(std::unique_ptr&& test); 21 | 22 | std::string query(const Config& config) const; 23 | void run(const Config& config) const; 24 | }; 25 | -------------------------------------------------------------------------------- /pp/performance_tests/write_protobuf_non_naned_wal_test.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "test_with_input_and_output.h" 4 | 5 | struct write_protobuf_non_naned_wal : public TestWithInputAndOutput { 6 | std::string input_file_base_name() const final { return "dummy_wal"; } 7 | bool has_output() const final { return true; } 8 | std::string output_file_base_name() const final { return "dummy_wal_for_stale_nan_test"; } 9 | void execute(const Config& config, Metrics& metrics) const final; 10 | }; 11 | -------------------------------------------------------------------------------- /pp/performance_tests/write_protobuf_wal_test.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "test_with_input_and_output.h" 4 | 5 | struct write_protobuf_wal : TestWithInputAndOutput { 6 | std::string input_file_base_name() const final { return "dummy_wal"; } 7 | bool has_output() const final { return true; } 8 | std::string output_file_base_name() const final { return "protobuf_wal"; } 9 | void execute(const Config& config, Metrics& metrics) const final; 10 | }; 11 | -------------------------------------------------------------------------------- /pp/primitives/hash.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "bare_bones/xxhash.h" 4 | 5 | namespace PromPP::Primitives::hash { 6 | 7 | template 8 | size_t hash_of_label_set(const LabelSet& label_set) noexcept { 9 | BareBones::XXHash hash; 10 | for (const auto& [label_name, label_value] : label_set) { 11 | hash.extend(static_cast(label_name), static_cast(label_value)); 12 | } 13 | return static_cast(hash); 14 | } 15 | 16 | template 17 | size_t hash_of_string_list(const StringList& strings) noexcept { 18 | BareBones::XXHash hash; 19 | for (const auto& string : strings) { 20 | hash.extend(static_cast(string)); 21 | } 22 | return static_cast(hash); 23 | } 24 | 25 | } // namespace PromPP::Primitives::hash -------------------------------------------------------------------------------- /pp/prometheus/tsdb/index/toc.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "bare_bones/preprocess.h" 4 | #include "types.h" 5 | 6 | namespace PromPP::Prometheus::tsdb::index { 7 | 8 | struct PROMPP_ATTRIBUTE_PACKED Toc { 9 | using Reference = uint64_t; 10 | 11 | Reference symbols{}; 12 | Reference series{}; 13 | Reference label_indices{}; 14 | Reference label_indices_table{}; 15 | Reference postings{}; 16 | Reference postings_offset_table{}; 17 | }; 18 | 19 | } // namespace PromPP::Prometheus::tsdb::index -------------------------------------------------------------------------------- /pp/prometheus/tsdb/index/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace PromPP::Prometheus::tsdb::index { 6 | 7 | using SymbolReference = uint32_t; 8 | using SeriesReference = uint32_t; 9 | 10 | inline constexpr uint32_t kMagic = 0xBAAAD700; 11 | inline constexpr uint8_t kFormatVersion = 2; 12 | inline constexpr uint32_t kSeriesAlignment = 16; 13 | 14 | } // namespace PromPP::Prometheus::tsdb::index 15 | -------------------------------------------------------------------------------- /pp/prometheus/value.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace PromPP::Prometheus { 7 | 8 | constexpr auto kNormalNan = std::bit_cast(0x7ff0000000000001ULL); 9 | constexpr auto kStaleNan = std::bit_cast(0x7ff0000000000002ULL); 10 | 11 | constexpr bool is_stale_nan(double value) noexcept { 12 | return std::bit_cast(value) == std::bit_cast(kStaleNan); 13 | } 14 | 15 | constexpr std::string_view kMetricLabelName = "__name__"; 16 | 17 | } // namespace PromPP::Prometheus -------------------------------------------------------------------------------- /pp/scripts/ci_get_static_lib_target_name.sh: -------------------------------------------------------------------------------- 1 | # This script returns target name for making 2 | # static lib with C bindings, depending on 3 | # OPT and SANITIZERS env variables. 4 | # Supported OPT env var values: dbg, opt 5 | # Supported SANITIZERS env var values: with_sanitizers, no_sanitizers 6 | result="" 7 | need_underscore=0 8 | if [ "$OPT" = "dbg" ]; then 9 | result="dbg" 10 | need_underscore=1 11 | fi 12 | if [ "$SANITIZERS" = "with_sanitizers" ]; then 13 | if [ "$need_underscore" = "1" ]; then 14 | result="${result}_" 15 | fi 16 | result="${result}asan" 17 | fi 18 | echo "$result" 19 | -------------------------------------------------------------------------------- /pp/scripts/ci_run_unit_tests.sh: -------------------------------------------------------------------------------- 1 | if [ "$SANITIZERS" = "with_sanitizers" ]; then 2 | printf "Run unit test with sanitizers\n" 3 | SANITIZERS_MODE_FLAG='--asan --strip=never --platform_suffix=asan' 4 | else 5 | printf "Run unit test without sanitizers\n" 6 | SANITIZERS_MODE_FLAG='' 7 | fi 8 | 9 | TEST_PACKAGES=( 10 | "//:*" 11 | ) 12 | 13 | QUERY_COMMAND='' 14 | for TEST_PACKAGE in "${TEST_PACKAGES[@]}"; do 15 | if [ "${QUERY_COMMAND}" != "" ]; then 16 | QUERY_COMMAND+=" union " 17 | fi 18 | QUERY_COMMAND+=$(printf "tests(%s)" "${TEST_PACKAGE}") 19 | done 20 | 21 | bazel query "${QUERY_COMMAND}" | \ 22 | xargs bazel test --compilation_mode="${OPT}" --local_resources=cpu=HOST_CPUS*0.2 --test_output=errors \ 23 | --test_timeout=60 --flaky_test_attempts=5 ${SANITIZERS_MODE_FLAG} 24 | -------------------------------------------------------------------------------- /pp/scripts/err_code_gen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | if [ "$#" -lt 2 ]; then 3 | echo -e "Usage: $0 \nFor proper work there git command should be available, and you should call this script inside git repository dir." 4 | exit 0 5 | fi 6 | 7 | result=$(echo "$1:$2:$(git rev-parse HEAD)" | md5sum | awk '{print $1}') 8 | echo ${result::16} 9 | 10 | -------------------------------------------------------------------------------- /pp/series_data/benchmarks/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | cc_binary( 4 | name = "series_data_encoder", 5 | srcs = ["series_data_encoder_benchmark.cpp"], 6 | malloc = "@jemalloc", 7 | deps = [ 8 | "//:series_data", 9 | "@google_benchmark//:benchmark_main", 10 | ], 11 | ) -------------------------------------------------------------------------------- /pp/series_data/encoder/value/constant_value.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "bare_bones/gorilla.h" 6 | #include "bare_bones/preprocess.h" 7 | 8 | namespace series_data::encoder::value { 9 | 10 | struct PROMPP_ATTRIBUTE_PACKED ConstantValue { 11 | double value{BareBones::Encoding::Gorilla::STALE_NAN}; 12 | uint8_t count{}; 13 | 14 | [[nodiscard]] PROMPP_ALWAYS_INLINE bool has_value() const noexcept { return count > 0; } 15 | [[nodiscard]] PROMPP_ALWAYS_INLINE bool is_stalenan() const noexcept { return BareBones::Encoding::Gorilla::isstalenan(value); } 16 | }; 17 | 18 | } // namespace series_data::encoder::value 19 | -------------------------------------------------------------------------------- /pp/third_party/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | cc_library( 4 | name = "protozero", 5 | hdrs = glob(["protozero/*.hpp"]), 6 | ) 7 | 8 | cc_library( 9 | name = "uuid", 10 | hdrs = ["uuid.h"], 11 | ) 12 | 13 | cc_library( 14 | name = "third_party", 15 | deps = [ 16 | ":protozero", 17 | ":uuid", 18 | ], 19 | ) 20 | -------------------------------------------------------------------------------- /pp/third_party/cedar.BUILD: -------------------------------------------------------------------------------- 1 | cc_library( 2 | name = "cedar", 3 | hdrs = ["cedar.h", "cedarpp.h"], 4 | include_prefix = "cedar", 5 | deps = [ 6 | "@scope_exit", 7 | ], 8 | visibility = ["//visibility:public"], 9 | ) -------------------------------------------------------------------------------- /pp/third_party/fastfloat/BUILD: -------------------------------------------------------------------------------- 1 | cc_library( 2 | name = "fastfloat", 3 | hdrs = ["@fastfloat_header//file"], 4 | strip_include_prefix = "file", 5 | visibility = ["//visibility:public"], 6 | ) 7 | -------------------------------------------------------------------------------- /pp/third_party/fastfloat/WORKSPACE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deckhouse/prompp/6fccc6fb9288df50294898bacd9a1485b18f8c80/pp/third_party/fastfloat/WORKSPACE -------------------------------------------------------------------------------- /pp/third_party/lz4.BUILD: -------------------------------------------------------------------------------- 1 | # Description: 2 | # LZ4 library 3 | 4 | licenses(["notice"]) # BSD license 5 | 6 | exports_files(["LICENSE"]) 7 | 8 | cc_library( 9 | name = "lz4", 10 | srcs = [ 11 | "lib/lz4.c", 12 | "lib/lz4frame.c", 13 | "lib/lz4hc.c", 14 | ], 15 | hdrs = [ 16 | "lib/lz4.h", 17 | "lib/lz4frame.h", 18 | "lib/lz4hc.h", 19 | "lib/xxhash.h", 20 | ], 21 | defines = [ 22 | "XXH_PRIVATE_API", 23 | ], 24 | includes = [ 25 | "lib", 26 | ], 27 | textual_hdrs = [ 28 | "lib/xxhash.c", 29 | "lib/lz4.c", 30 | ], 31 | visibility = ["//visibility:public"], 32 | ) 33 | -------------------------------------------------------------------------------- /pp/third_party/parallel_hashmap.BUILD: -------------------------------------------------------------------------------- 1 | cc_library( 2 | name = "parallel_hashmap", 3 | hdrs = glob(["parallel_hashmap/*.h"]), 4 | includes = ["."], 5 | visibility = ["//visibility:public"], 6 | ) 7 | -------------------------------------------------------------------------------- /pp/third_party/patches/cedar/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deckhouse/prompp/6fccc6fb9288df50294898bacd9a1485b18f8c80/pp/third_party/patches/cedar/BUILD -------------------------------------------------------------------------------- /pp/third_party/patches/com_google_absl/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deckhouse/prompp/6fccc6fb9288df50294898bacd9a1485b18f8c80/pp/third_party/patches/com_google_absl/BUILD -------------------------------------------------------------------------------- /pp/third_party/patches/com_google_absl/no-werror.patch: -------------------------------------------------------------------------------- 1 | --- absl/copts/configure_copts.bzl 2 | +++ absl/copts/configure_copts.bzl 3 | @@ -27,7 +27,7 @@ ABSL_DEFAULT_COPTS = select({ 4 | "//absl:clang_compiler": ABSL_LLVM_FLAGS, 5 | "//absl:gcc_compiler": ABSL_GCC_FLAGS, 6 | "//conditions:default": ABSL_GCC_FLAGS, 7 | -}) 8 | +}) + ["-Wno-error"] 9 | 10 | ABSL_TEST_COPTS = select({ 11 | "//absl:msvc_compiler": ABSL_MSVC_TEST_FLAGS, 12 | @@ -35,7 +35,7 @@ ABSL_TEST_COPTS = select({ 13 | "//absl:clang_compiler": ABSL_LLVM_TEST_FLAGS, 14 | "//absl:gcc_compiler": ABSL_GCC_TEST_FLAGS, 15 | "//conditions:default": ABSL_GCC_TEST_FLAGS, 16 | -}) 17 | +}) + ["-Wno-error"] 18 | 19 | ABSL_DEFAULT_LINKOPTS = select({ 20 | "//absl:msvc_compiler": ABSL_MSVC_LINKOPTS, 21 | -------------------------------------------------------------------------------- /pp/third_party/patches/google_benchmark/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deckhouse/prompp/6fccc6fb9288df50294898bacd9a1485b18f8c80/pp/third_party/patches/google_benchmark/BUILD -------------------------------------------------------------------------------- /pp/third_party/patches/google_benchmark/BUILD.bazel.patch: -------------------------------------------------------------------------------- 1 | --- BUILD.bazel 2 | +++ BUILD.bazel 3 | @@ -68,7 +68,7 @@ cc_library( 4 | }), 5 | defines = [ 6 | "BENCHMARK_STATIC_DEFINE", 7 | - "BENCHMARK_VERSION=\\\"" + (module_version() if module_version() != None else "") + "\\\"", 8 | + "BENCHMARK_VERSION=\\\"" + "" + "\\\"", 9 | ] + select({ 10 | ":perfcounters": ["HAVE_LIBPFM"], 11 | "//conditions:default": [], 12 | -------------------------------------------------------------------------------- /pp/third_party/patches/gtest/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deckhouse/prompp/6fccc6fb9288df50294898bacd9a1485b18f8c80/pp/third_party/patches/gtest/BUILD -------------------------------------------------------------------------------- /pp/third_party/patches/gtest/no-werror.patch: -------------------------------------------------------------------------------- 1 | --- BUILD.bazel 2 | +++ BUILD.bazel 3 | @@ -101,7 +101,7 @@ cc_library( 4 | copts = select({ 5 | ":qnx": [], 6 | ":windows": [], 7 | - "//conditions:default": ["-pthread"], 8 | + "//conditions:default": ["-pthread", "-Wno-error"], 9 | }), 10 | defines = select({ 11 | ":has_absl": ["GTEST_HAS_ABSL=1"], 12 | -------------------------------------------------------------------------------- /pp/third_party/patches/jemalloc/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deckhouse/prompp/6fccc6fb9288df50294898bacd9a1485b18f8c80/pp/third_party/patches/jemalloc/BUILD -------------------------------------------------------------------------------- /pp/third_party/patches/lz4/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deckhouse/prompp/6fccc6fb9288df50294898bacd9a1485b18f8c80/pp/third_party/patches/lz4/BUILD -------------------------------------------------------------------------------- /pp/third_party/patches/lz4/lz4frame.c.patch: -------------------------------------------------------------------------------- 1 | --- lib/lz4frame.c 2 | +++ lib/lz4frame.c 3 | @@ -1097,6 +1097,11 @@ void LZ4F_resetDecompressionContext(LZ4F_dctx* dctx) 4 | dctx->dictSize = 0; 5 | } 6 | 7 | +size_t LZ4F_allocated_memory(LZ4F_dctx* dctx) 8 | +{ 9 | + return sizeof(*dctx) + dctx->tmpInSize + dctx->tmpOutSize; 10 | +} 11 | + 12 | 13 | /*! LZ4F_decodeHeader() : 14 | * input : `src` points at the **beginning of the frame** 15 | -------------------------------------------------------------------------------- /pp/third_party/patches/lz4/lz4frame.h.patch: -------------------------------------------------------------------------------- 1 | --- lib/lz4frame.h 2 | +++ lib/lz4frame_patched.h 3 | @@ -74,7 +74,7 @@ extern "C" { 4 | #elif defined(LZ4_DLL_IMPORT) && (LZ4_DLL_IMPORT==1) 5 | # define LZ4FLIB_API __declspec(dllimport) 6 | #elif defined(__GNUC__) && (__GNUC__ >= 4) 7 | -# define LZ4FLIB_API __attribute__ ((__visibility__ ("default"))) 8 | +# define LZ4FLIB_API 9 | #else 10 | # define LZ4FLIB_API 11 | #endif 12 | 13 | --- lib/lz4frame.h 14 | +++ lib/lz4frame.h 15 | @@ -467,7 +467,7 @@ LZ4FLIB_API size_t LZ4F_decompress(LZ4F_dctx* dctx, 16 | * and start a new one using same context resources. */ 17 | LZ4FLIB_API void LZ4F_resetDecompressionContext(LZ4F_dctx* dctx); /* always successful */ 18 | 19 | - 20 | +size_t LZ4F_allocated_memory(LZ4F_dctx* dctx); 21 | 22 | #if defined (__cplusplus) 23 | } 24 | -------------------------------------------------------------------------------- /pp/third_party/patches/lz4/lz4hc.c.patch: -------------------------------------------------------------------------------- 1 | --- lib/lz4hc.c 2 | +++ lib/lz4hc_patched.c 3 | @@ -886,8 +886,8 @@ int LZ4_sizeofStateHC(void) { return (int)sizeof(LZ4_streamHC_t); } 4 | * while actually aligning LZ4_streamHC_t on 4 bytes. */ 5 | static size_t LZ4_streamHC_t_alignment(void) 6 | { 7 | - struct { char c; LZ4_streamHC_t t; } t_a; 8 | - return sizeof(t_a) - sizeof(t_a.t); 9 | + struct alignment_check_struct { char c; LZ4_streamHC_t t; }; 10 | + return offsetof(struct alignment_check_struct, t); 11 | } 12 | #endif 13 | 14 | -------------------------------------------------------------------------------- /pp/third_party/patches/parallel_hashmap/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deckhouse/prompp/6fccc6fb9288df50294898bacd9a1485b18f8c80/pp/third_party/patches/parallel_hashmap/BUILD -------------------------------------------------------------------------------- /pp/third_party/patches/parallel_hashmap/phmap_base.h.patch: -------------------------------------------------------------------------------- 1 | --- parallel_hashmap/phmap_base.h 2 | +++ parallel_hashmap/phmap_base.h 3 | @@ -238,7 +238,7 @@ struct negation : std::integral_constant {}; 4 | 5 | template 6 | struct is_trivially_destructible 7 | - : std::integral_constant::value && 9 | std::is_destructible::value> {}; 10 | 11 | template 12 | -------------------------------------------------------------------------------- /pp/third_party/patches/quasis_crypto/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deckhouse/prompp/6fccc6fb9288df50294898bacd9a1485b18f8c80/pp/third_party/patches/quasis_crypto/BUILD -------------------------------------------------------------------------------- /pp/third_party/patches/re2/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deckhouse/prompp/6fccc6fb9288df50294898bacd9a1485b18f8c80/pp/third_party/patches/re2/BUILD -------------------------------------------------------------------------------- /pp/third_party/patches/re2/no-werror.patch: -------------------------------------------------------------------------------- 1 | --- BUILD.bazel 2 | +++ BUILD.bazel 3 | @@ -61,7 +61,9 @@ cc_library( 4 | "@platforms//os:wasi": [], 5 | "@platforms//os:windows": [], 6 | "//conditions:default": ["-pthread"], 7 | - }), 8 | + }) + [ 9 | + "-Wno-error" 10 | + ], 11 | linkopts = select({ 12 | # macOS doesn't need `-pthread' when linking and it appears that 13 | # older versions of Clang will warn about the unused command line 14 | -------------------------------------------------------------------------------- /pp/third_party/patches/roaring/0001-disable-test-dependencies.patch: -------------------------------------------------------------------------------- 1 | --- a/tools/cmake/FindCTargets.cmake 2 | +++ b/tools/cmake/FindCTargets.cmake 3 | @@ -5,4 +5,6 @@ 4 | set(BUILD_STATIC_LIB ON) 5 | +if(ENABLE_ROARING_TESTS) 6 | import_dependency(cmocka clibs/cmocka f5e2cd7) 7 | add_dependency(cmocka) 8 | +endif() 9 | -------------------------------------------------------------------------------- /pp/third_party/patches/roaring/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deckhouse/prompp/6fccc6fb9288df50294898bacd9a1485b18f8c80/pp/third_party/patches/roaring/BUILD -------------------------------------------------------------------------------- /pp/third_party/quasis_crypto.BUILD: -------------------------------------------------------------------------------- 1 | cc_library( 2 | name = "quasis_crypto", 3 | hdrs = glob(["*.hh"]), 4 | include_prefix = "quasis_crypto", 5 | visibility = ["//visibility:public"], 6 | ) 7 | -------------------------------------------------------------------------------- /pp/third_party/roaring.BUILD: -------------------------------------------------------------------------------- 1 | load("@rules_foreign_cc//foreign_cc:cmake.bzl", "cmake") 2 | 3 | filegroup( 4 | name = "src", 5 | srcs = glob([ 6 | "**", 7 | ]), 8 | visibility = ["//visibility:public"], 9 | ) 10 | 11 | cmake( 12 | name = "roaring", 13 | lib_source = ":src", 14 | generate_args = [ 15 | "-DENABLE_ROARING_TESTS=OFF", 16 | ], 17 | copts = [ 18 | "-Wno-error" 19 | ], 20 | build_args = ["-j `nproc`"], 21 | out_static_libs = [ 22 | "libroaring.a", 23 | ], 24 | visibility = ["//visibility:public"], 25 | ) 26 | -------------------------------------------------------------------------------- /pp/third_party/scope_exit.BUILD: -------------------------------------------------------------------------------- 1 | cc_library( 2 | name = "scope_exit", 3 | srcs = [ 4 | "_scope_guard_common.h", 5 | ], 6 | hdrs = [ 7 | "scope_exit.h", 8 | ], 9 | includes = ["."], 10 | visibility = ["//visibility:public"], 11 | ) 12 | -------------------------------------------------------------------------------- /pp/third_party/simdutf.BUILD: -------------------------------------------------------------------------------- 1 | cc_library( 2 | name = "simdutf", 3 | srcs = ["simdutf.cpp"], 4 | hdrs = ["simdutf.h"], 5 | include_prefix = "simdutf", 6 | visibility = ["//visibility:public"], 7 | ) 8 | -------------------------------------------------------------------------------- /pp/third_party/xxHash.BUILD: -------------------------------------------------------------------------------- 1 | cc_library( 2 | name = "xxHash", 3 | hdrs = ["xxhash.h"], 4 | include_prefix = "xxHash", 5 | visibility = ["//visibility:public"], 6 | ) -------------------------------------------------------------------------------- /pp/wal/benchmarks/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | cc_binary( 4 | name = "scraper", 5 | srcs = ["scraper_benchmark.cpp"], 6 | malloc = "@jemalloc", 7 | deps = [ 8 | "//:wal", 9 | "@google_benchmark//:benchmark_main", 10 | ], 11 | ) 12 | -------------------------------------------------------------------------------- /pp/wal/concepts.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace PromPP::WAL::concepts { 4 | 5 | template 6 | concept has_field_segment_id = requires(const T& t) { 7 | { t.segment_id }; 8 | }; 9 | 10 | } // namespace PromPP::WAL::concepts 11 | -------------------------------------------------------------------------------- /pp/wal/hashdex/metric.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "primitives/timeseries.h" 4 | #include "prometheus/metric.h" 5 | 6 | namespace PromPP::WAL::hashdex { 7 | 8 | struct Metric { 9 | Primitives::TimeseriesSemiview timeseries{}; 10 | uint64_t hash{}; 11 | 12 | bool operator==(const Metric&) const noexcept = default; 13 | }; 14 | 15 | #pragma pack(push, 1) 16 | 17 | struct Metadata { 18 | std::string_view metric_name{}; 19 | std::string_view text{}; 20 | Prometheus::MetadataType type{}; 21 | 22 | bool operator==(const Metadata&) const noexcept = default; 23 | }; 24 | 25 | #pragma pack(pop) 26 | 27 | } // namespace PromPP::WAL::hashdex -------------------------------------------------------------------------------- /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.lock: -------------------------------------------------------------------------------- 1 | # Generated by buf. DO NOT EDIT. 2 | version: v1 3 | deps: 4 | - remote: buf.build 5 | owner: gogo 6 | repository: protobuf 7 | branch: main 8 | commit: 4df00b267f944190a229ce3695781e99 9 | digest: b1-sjLgsg7CzrkOrIjBDh3s-l0aMjE6oqTj85-OsoopKAw= 10 | create_time: 2021-08-10T00:14:28.345069Z 11 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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_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 | -------------------------------------------------------------------------------- /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/compress_assets.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # compress static assets 4 | 5 | set -euo pipefail 6 | 7 | cd web/ui 8 | cp embed.go.tmpl embed.go 9 | 10 | GZIP_OPTS="-fk" 11 | # gzip option '-k' may not always exist in the latest gzip available on different distros. 12 | if ! gzip -k -h &>/dev/null; then GZIP_OPTS="-f"; fi 13 | 14 | find static -type f -name '*.gz' -delete 15 | find static -type f -exec gzip $GZIP_OPTS '{}' \; -print0 | xargs -0 -I % echo %.gz | sort | xargs echo //go:embed >> embed.go 16 | echo var EmbedFS embed.FS >> embed.go 17 | -------------------------------------------------------------------------------- /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_managedidentity.yaml: -------------------------------------------------------------------------------- 1 | cloud: AzurePublic 2 | managed_identity: 3 | client_id: 00000000-0000-0000-0000-000000000000 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 | -------------------------------------------------------------------------------- /tsdb/.gitignore: -------------------------------------------------------------------------------- 1 | benchout/ 2 | -------------------------------------------------------------------------------- /tsdb/agent/op_interface.go: -------------------------------------------------------------------------------- 1 | package agent 2 | 3 | // RemoteWrite implement remote write. 4 | type RemoteWrite interface { 5 | // LowestSentTimestamp returns the lowest sent timestamp across all queues. 6 | LowestSentTimestamp() int64 7 | } 8 | -------------------------------------------------------------------------------- /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/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/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/testdata/index_format_v1/chunks/000001: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deckhouse/prompp/6fccc6fb9288df50294898bacd9a1485b18f8c80/tsdb/testdata/index_format_v1/chunks/000001 -------------------------------------------------------------------------------- /tsdb/testdata/index_format_v1/index: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deckhouse/prompp/6fccc6fb9288df50294898bacd9a1485b18f8c80/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/deckhouse/prompp/6fccc6fb9288df50294898bacd9a1485b18f8c80/tsdb/testdata/index_format_v1/tombstones -------------------------------------------------------------------------------- /tsdb/testdata/repair_index_version/01BZJ9WJQPWHGNC2W4J9TA62KC/index: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deckhouse/prompp/6fccc6fb9288df50294898bacd9a1485b18f8c80/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 | -------------------------------------------------------------------------------- /tsdb/trigger.go: -------------------------------------------------------------------------------- 1 | package tsdb 2 | 3 | type ReloadBlocksExternalTrigger interface { 4 | Chan() <-chan struct{} 5 | } 6 | 7 | type noOpReloadBlocksExternalTrigger struct { 8 | c chan struct{} 9 | } 10 | 11 | func (t *noOpReloadBlocksExternalTrigger) Chan() <-chan struct{} { 12 | return t.c 13 | } 14 | 15 | func newNoOnReloadBlocksExternalTrigger() *noOpReloadBlocksExternalTrigger { 16 | return &noOpReloadBlocksExternalTrigger{c: make(chan struct{})} 17 | } 18 | -------------------------------------------------------------------------------- /web/ui/.gitignore: -------------------------------------------------------------------------------- 1 | *.gz 2 | embed.go 3 | -------------------------------------------------------------------------------- /web/ui/.nvmrc: -------------------------------------------------------------------------------- 1 | v20.5.1 2 | -------------------------------------------------------------------------------- /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/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/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/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/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/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/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/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deckhouse/prompp/6fccc6fb9288df50294898bacd9a1485b18f8c80/web/ui/react-app/public/apple-touch-icon.png -------------------------------------------------------------------------------- /web/ui/react-app/public/favicon-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deckhouse/prompp/6fccc6fb9288df50294898bacd9a1485b18f8c80/web/ui/react-app/public/favicon-96x96.png -------------------------------------------------------------------------------- /web/ui/react-app/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deckhouse/prompp/6fccc6fb9288df50294898bacd9a1485b18f8c80/web/ui/react-app/public/favicon.ico -------------------------------------------------------------------------------- /web/ui/react-app/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Deckhouse Prom++", 3 | "short_name": "Prom++", 4 | "icons": [ 5 | { 6 | "src": "/web-app-manifest-192x192.png", 7 | "sizes": "192x192", 8 | "type": "image/png", 9 | "purpose": "maskable" 10 | }, 11 | { 12 | "src": "/web-app-manifest-512x512.png", 13 | "sizes": "512x512", 14 | "type": "image/png", 15 | "purpose": "maskable" 16 | } 17 | ], 18 | "theme_color": "#ffffff", 19 | "background_color": "#ffffff", 20 | "display": "standalone" 21 | } 22 | -------------------------------------------------------------------------------- /web/ui/react-app/public/web-app-manifest-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deckhouse/prompp/6fccc6fb9288df50294898bacd9a1485b18f8c80/web/ui/react-app/public/web-app-manifest-192x192.png -------------------------------------------------------------------------------- /web/ui/react-app/public/web-app-manifest-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deckhouse/prompp/6fccc6fb9288df50294898bacd9a1485b18f8c80/web/ui/react-app/public/web-app-manifest-512x512.png -------------------------------------------------------------------------------- /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/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/deckhouse/prompp/6fccc6fb9288df50294898bacd9a1485b18f8c80/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/i18n/index.ts: -------------------------------------------------------------------------------- 1 | import i18n from 'i18next'; 2 | import { initReactI18next } from 'react-i18next'; 3 | import { ru } from './locales/ru'; 4 | 5 | export const LOCAL_STORAGE_LANGUAGE_KEY = 'language'; 6 | export const DEFAULT_LANGUAGE = 'en'; 7 | const defaultLng = localStorage.getItem(LOCAL_STORAGE_LANGUAGE_KEY) || DEFAULT_LANGUAGE; 8 | 9 | i18n.use(initReactI18next).init({ 10 | resources: { 11 | ru, 12 | }, 13 | lng: defaultLng, 14 | debug: true, 15 | interpolation: { 16 | escapeValue: false, 17 | }, 18 | }); 19 | 20 | export default i18n; 21 | -------------------------------------------------------------------------------- /web/ui/react-app/src/pages/agent/Agent.tsx: -------------------------------------------------------------------------------- 1 | import React, { FC } from 'react'; 2 | import { Trans } from 'react-i18next'; 3 | 4 | const Agent: FC = () => { 5 | return ( 6 | <> 7 |

8 | Prometheus Agent 9 |

10 |

11 | 12 | This Prometheus instance is running in agent mode. In this mode, Prometheus is only used to scrape 13 | discovered targets and forward the scraped metrics to remote write endpoints. 14 | 15 |

16 |

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

19 | 20 | ); 21 | }; 22 | 23 | export default Agent; 24 | -------------------------------------------------------------------------------- /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 | import { useTranslation } from 'react-i18next'; 3 | 4 | export interface QueryStats { 5 | loadTime: number; 6 | resolution: number; 7 | resultSeries: number; 8 | } 9 | 10 | const QueryStatsView: FC = (props) => { 11 | const { loadTime, resolution, resultSeries } = props; 12 | const { t } = useTranslation('graph'); 13 | 14 | return ( 15 |
16 | 17 | {t('Load time')}: {loadTime}ms   {t('Resolution')}: {resolution}s   {t('Result series')}: {resultSeries} 18 | 19 |
20 | ); 21 | }; 22 | 23 | export default QueryStatsView; 24 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /werf-giterminism.yaml: -------------------------------------------------------------------------------- 1 | giterminismConfigVersion: 1 2 | config: 3 | goTemplateRendering: # The rules for the Go-template functions 4 | allowEnvVariables: [ /CI_.+/, /REPO_MCM_.+/, SOURCE_REPO, GOPROXY, WERF_DISABLE_META_TAGS, CLOUD_PROVIDERS_SOURCE_REPO, COMPILATION_MODE, ASAN, BAZEL_ARCH, GO_ARCH ] 5 | allowUncommittedFiles: [ "tools/build_includes/*" ] 6 | stapel: 7 | mount: 8 | allowBuildDir: true 9 | allowFromPaths: 10 | - ~/go-pkg-cache 11 | -------------------------------------------------------------------------------- /werf_cleanup.yaml: -------------------------------------------------------------------------------- 1 | project: prompp 2 | configVersion: 1 3 | cleanup: 4 | keepPolicies: 5 | - references: 6 | branch: /.*/ 7 | limit: 8 | in: 168h --------------------------------------------------------------------------------