antony@notes:~/misc$ cat "Prometheus-certified-associate.md"
Prometheus certified associate
Prometheus certified associate
Q1
How does Prometheus collect metrics?
A. Applications send metrics to Prometheus vis UDP. B. Applications send metrics to Prometheus via GRPC. C. Prometheus scrapes metrics from instrumented application’s HTTP Server D. Prometheus scrapes metrics from instrumented application’s UDP Server
:::spoiler 解答 C :::
Q2
If you offer a free service, which of the following do you want?
A. SLO’s and SLI’s. B. SLI’s, SLO’s and SLAs C. SLAS. D. SLIS.
:::spoiler 解答 A :::
Q3
What are the changes in numerical data recorded over time called?
A. time series B. data dashboard C. metrics D. time table
:::spoiler 解答 A :::
Q4
What is a trace?
A. Trace is a set of events triggered by a singie logical operation, consolord so s B. Trace is a simple mechanism for propagating name/value pairs. C. Trace is a numerical measurement about a service, captured at runtime D. Trace is a timestamped text record, either structured (recommended) or unst
:::spoiler 解答 A :::
Q5
With a SLO of 99.9%, what is the error budget? A. 0.1% B. Insufficient data to tell. C. 99.9% D. 100%.
:::spoiler 解答 A :::
Q6
How many metrics types does Prometheus text format support
A. 40 B. 4 C. 8 D. 10
:::spoiler 解答 B :::
Q7
Which one of the following item should not belong to a metrics?
A. environment D. username C. server name D. response code
:::spoiler 解答 B :::
Q8
Why can’t you send logs to Prometheus?
A. Default Prometheus installations will store deta only for a few weeks. B. PromQL language is inefficient for parsing log files. C. It is best practice to avoid mixing logs and metries wihin a Prometheus instance. D. Prometheus handles metrics but logs are text-based events.
:::spoiler 解答 D :::
Q9
Which of the following Kubernetes SD configurations “key allow rerieing scarape targets from Kubernetes REST API?
A. <kubernetes_scrape_config>
B. <kube-apiserver_sd_config>
C. <kube-piserver_scrape_config>
D. <kubernetes_sd_config>
:::spoiler 解答 D :::
Q10
Your publicly available web server receives 1000 requests per hour with a 1-3% average error tes sos the tando wit aut?
A. Rate of requests, errors, and request times B. Stack traces of successful requests C. Detailed web server logs for failed requests D. Stack traces of error requests
:::spoiler 解答 A :::
Q11
Which of the following metric is unsuitable for a Promethes setup?
A. prometheus_engine_query_log_enabled
B. user_last_login_tinestamp_seconds{email="john.doe@example.com"}
C. http_response_total{handler="/static/*filepath"}
D. promhttp_metric_handler_requests_total{code="580"}
:::spoiler 解答 B :::
Q12
What is api_http_requests_total in the following metric?
api_http_requests_total{method="POST", handler="/messages"}
A. “api_http_requests_total” is a metric type. B. “api_http_requests_total” is a metric name. C. “api_http_requests_total” is a metric field. D. “api_http_requests_total” is a metric label name.
:::spoiler 解答 B :::
Q13
You’d like to monitor a short lived batch job. What Prometheus component wold you want?
A. PullGateway B. PushGateway C. PullProxy D. PushProxy
:::spoiler 解答 B :::
Q14
What Prometheus component would you use if targets are runnning beind Firewal NAT?
A. Pull Gateway B. Pull Proxy C. HA Proxy D. PushProx
:::spoiler 解答 D :::
Q15
What’s “wrong” with the myapp_file_uploads_total{userid="5123", status="failed"} metrics?
A. The _total suffic should be omitted
B. The userid should not be exposed as a label.
C. The status should not be exposed as a label.
D. The metric name should consist of dashes instead of underscores
:::spoiler 解答 B :::
Q16
How can you send metrics from your Prometheus setup to a remote system, e.g. for long term storage?
A. With S3 Buckets B. With “scraping” C. With “remote write” D. With “federation”
:::spoiler 解答 C :::
Q17
What is a difference between a counter and a gauge?
A. Counters change value on each scrape and a gauges remain static. B. Counters are only incremented, while gauge can go up and down. C. Counters have no labels while gauges can have many labels. D. Counters and gauges are different names for the same thing.
:::spoiler 解答 B :::
Q18
Which of the following is a valid metric name?
A. go_goroutines B. 99_goroutines C. go routines D. go.goroutines
:::spoiler 解答 A :::
Q19
Which exporter would be best suited for basic HITP probing?
A. SNMP exporter B. Apache exporter C. Blackbox exporter D. JMX exporter
:::spoiler 解答 C :::
Q20
What does scrape_interval configure in Prometheus?
A. It defines how frequently to scrape targets. B. It defines how often to send alerts. C. It defines how frequently to evaluate rules. D. It defines how often to refresh metrics.
:::spoiler 解答 A :::
Q21
What is an example of a single-target exporter?
A. Blackbox Exporter B. SNMP Exporter C. Redis Exporter D. Node Exporter
:::spoiler 解答 D :::
Q22
How do you configure the rule evaluation interval in Prometheus?
A. You can configure the evaluation interval in the Prometheus TSDB configuration file and in the rule configuration file. B. You can configure the evaluation interval in the globel configuration file and in the rule configuration file. C. You can configure the evaluation intenval in the service discovery configurtion and in the command-line flags. D. You can configure the evaluation interval in the scraping job configuration file and in the command-line flags.
:::spoiler 解答 B :::
Q23
Which kind of metrics are associated with the function deriv?
A. Summaries B. Counters C. Histograms D. Gauges
:::spoiler 解答 D
Here is why:
derivshould only be used with gauges and only works for float samples.
- 參考文件:https://prometheus.io/docs/prometheus/latest/querying/functions/#deriv:~:text=deriv%20should%20only%20be%20used%20with%20gauges%20and%20only%20works%20for%20float%20samples. :::
Q24
Given the metric prometheus_tsdb_lowest_timestamp_secoods, how do you know in which month belongs the
A. format_date(prometheus_tsdb_lowest_timestamp_seconds, "5m")
B. (time() - prometheus_tsdb_lowest_timestamp_secceds) / 86400
C. prometheus_tsdb_lowest_tinestamp_seconds % month
D. month(prometheus_tsdb_lowest_timestamp_seconds)
:::spoiler 解答 D :::
Q25
Which PromQL expression computes how many requests in total are currently in-flight for time series ?
apiserver_current_inflight_requests{instance="1"} 5
apiserver_current_inflight_requests{instances="2"} 7A. sum(apiserver_current_inflight_requests)
B. max(apiserver_current_inflight_requests)
C. sum_over_time(apiserver_current_inflight_requests, reperts[10m])
D. min(apiserver_current_inflight_requests)
:::spoiler 解答 A :::
Q26
How do you calculate the average request duration during the last 5 minutes from a histograms on summany called http_request_duration_seconds ?
A. rate(http_request_duration_seconds_total[5m]) / rate(http_request_duration_seconds_average[5m])
B. rate(http_request_duration_seconds_sum[5m]) / rate(http_request_duration_seconds_average
C. rate(http_request_duration_seconds_sum[5m]) / rate(http_request_duration_seconds_count[5m])
D. rate(http_request_duration_seconds_total[5m)) / rate(http_request_duration_seconds_count[5m]
:::spoiler 解答 C :::
Q27
Which PromQL statement returns the average free bytes of the fliesystems over the last hour?
A. avg_over_time(node_filesystem_avail_bytes[1h]) B. sum_over_time(node_filesystem_avail_bytes[1h]) C. sum(node_filesystem_avail_bytes[1h]) D. avg(node_filesystem_avail_bytes[1h])
:::spoiler 解答 A :::
Q28
How can you use the delta PromQL function?
A. On counter metrics to compute the difference between the first and last value of each time series element. B. On counter metrics to compute the number of metric resets within the provided time range. C. On gauge metrics to compute the number of metric resets within the provided time range. D. On gauge metrics to compute the difference between the first and last value of each time series element.
:::spoiler 解答 D :::
Q29
Which of the following PromQL query is invalid?
A. max without (instance, job) up B. max without (instance) up C. max by (instance) up D. max on (instance) (up)
:::spoiler 解答 D :::
Q30
Given the following Histogram metric data, how many requests took less than or equal to 0.1 seconds?'
apiserver_request_duration_seconds_bucket(job="kube-apiserver",le="+Inf") 3
apiserver_request_duration_seconds_bucket(job="kube-apiserver",le="0.05") 0
apiserver_request_duration_seconds_bucket(job="kube-apiserver",le="0.1") 1
apiserver_request_duration_seconds_bucket(job="kube-apiserver",le="1") 3
apiserver_request_duration_seconds_count(job="kube-apiserver") 3
apiserver_request_duration_seconds_sum(jbb="kube-apiserver") 0.554003785A. 0.554003785 B. 3 C. 0 D. 1
:::spoiler 解答 D :::
Q31
What function calculates the φ-quantile from a histoggam?
A. predict_linear() B. avg_over_time() C. histogram() D. histogram_quantile()
:::spoiler 解答 D :::
Q32
How can you select all the up metrics whose instance label match the regex fe-.*?
A. up{instance=regexp(fe-.*)}
B. up{instance="fe-.*"}
C. up{instance~"fe-.*"}
D. up{instance=~"fe-.*"}
:::spoiler 解答 D :::
Q33
Which PromQL expression computes the rate of API Server requests across the different cloud providers from the following metrics?
apiserver_request_total{job="kube-apiserver", instance="192.168.1.228:6443, cloud="aws"} 1
apiserver_request_total{job="kube-apiserver", instance="192.168.1.121:6443, clmud="gcloud" 5A. rate(sum by (cloud)(apiserver_request_total{job=“kube- apisever”})(5m)) B. sum by (cloud)(rate(apiserver_request_total{job=“kube-apisrver”}[5m])) C. sum by (cloud) (apiserver_request_total{job=“kube-apiserver}) D. rate(apiserver_request_total{job=“kube-apiserver”[5m]) by (cloud)
:::spoiler 解答 D :::
Q34
which expression calculates the average uptime of targets over the last hour?
A. avg(up[1h]) B. average_over_time(up[1h]) C. avg_over_time(up[1h]) D. avg(up-1h)
:::spoiler 解答 C :::
Q35
which PromQL statement returns the sum of all values of the metric node_memory_MemAvailable_bytes from 10 minutes ago?
A. offset sum(node_memory_MemAvailable_bytes[10m]) B. sum(node_memory_MemAvailable_bytes) setoff 10m C. sum(node_memory_MemAvailable_bytes) offset 10m D. sum(node_memory_MemAvailable_bytes offset 10m)
:::spoiler 解答 D :::
Q36
Which metric type uses the delta() function?
A. Info B. Histogram C. Gauge D. Counter
:::spoiler 解答 C :::
Q37
If the vector selector foo[5m] contains 1 1 NaN 0 , what would max_over_time(foo[5m])) return?
A. 1
B. It errors out.
C. NaN
D. No answer.
:::spoiler 解答 A :::
Q38
Which of the following is an invalid @ modifier expression?
A. sum(http_requests_total{method="GET"}) @ 1609746000
B. go_goroutines @ end()
C. sum(http_requests_total{method="GET"} @ 1609746000)
D. go_goroutines @ start()
:::spoiler 解答 C :::
Q39
With the following metrics over the last 5 minutes:
up{instance="localhost"} 1 1 1 1 1
up{instance="server1"} 1 0 0 0 0What does the following query retum: min_over_time(up[5m])?
A. up{instance="localhost"} 1
up{instance="server1"} 0
B. {instance="localhost"} 1
{instance="server1"} 0
C. up{instance="server1"} 0
D. {instance="server1"} 0
:::spoiler 解答 A :::
Q40
The following is a list of metrics exposed by an application.
http_requests_total{code="508"} 10
http_requests_total{code="200"} 20
http_requests_total{code="408"} 30
http_requests_total{verb="POST"} 30
http_requests_total{verb="GET"} 30What is the issue with the metric family?
A. verb label content should be normalized to lowercase.
B. Metric names are missing a prefix to indicate which application is exposing the query.
C. The value represents two different thigs accross the dimensions: code and verb.
D. Unit is missing in the http_requests_total meticname.
:::spoiler 解答 C :::
Q41
What is the difference between client libraries and exporters?
A. Exporters expose metrics for scraping. Client libraries push metrics via Remote White. B. Exporters run next to the services to monitor, and use client libraries internally. C. Exporters are written in Go. Client libraries are written in many languages. D. Exporters and client libraries mean the same thing.
:::spoiler 解答 A :::
Q42
What should you do with counters that have labels?
A. Instantiate them with their possible label values when creating them so they are expoved with a zero value. B. Investigate if you can move their label value inside their metic name to limit the numbe of lebels. C. Make sure every counters with labels has an extra counter, aggregated, without lebels. D. Save their state between application runs so you can restore their last value on startup.