-
Notifications
You must be signed in to change notification settings - Fork 748
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docs metrics configuration #1850
Changes from 3 commits
9a17aee
7fdabd7
a2c2995
ccb150b
dce558a
f0cfc5e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
## Metrics configuration and how to import metrics of [Prebid server](https://docs.prebid.org/prebid-server/versions/pbs-versions-go.html) to [Grafana](https://grafana.com/) through [Prometheus](https://prometheus.io/) stack. | ||
|
||
#### These are the parameters that are capable for metrics collection | ||
|
||
- PBS_METRICS_PROMETHEUS_PORT=9100 - default is 0. | ||
|
||
If PBS_METRICS_PROMETHEUS_PORT is null, your [Prebid server](https://docs.prebid.org/prebid-server/versions/pbs-versions-go.html) won't collect any metrics. | ||
|
||
- PBS_METRICS_PROMETHEUS_NAMESPACE=prebid - default is empty. | ||
|
||
PBS_METRICS_PROMETHEUS_NAMESPACE - for your unique metrics | ||
|
||
- PBS_METRICS_PROMETHEUS_SUBSYSTEM=server - default is empty. | ||
|
||
PBS_METRICS_PROMETHEUS_NAMESPACE - for your deep unique metrics | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this supposed to be PBS_METRICS_PROMETHEUS_SUBSYSTEM? Similar to my above comment, perhaps clarify that this is a secondary prefix added to metrics to ensure uniqueness? |
||
|
||
- PBS_METRICS_DISABLED_METRICS_ADAPTER_CONNECTIONS_METRICS=false - default is true. | ||
|
||
If PBS_METRICS_DISABLED_METRICS_ADAPTER_CONNECTIONS_METRICS is true your [Prebid server](https://docs.prebid.org/prebid-server/versions/pbs-versions-go.html) won't collect any adapter metrics | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the description here needs to be altered. If this flag is set to true you won't get any bidder http connection adapter metrics (e.g. number of new vs reused connections) but you'll still get other adapter metrics. |
||
|
||
#### If you're going to get metrics though [Prometheus](https://prometheus.io/) and [Prometheus](https://prometheus.io/) stack has been already installed, you have several options, please chose one: | ||
|
||
- change environments into code (bad way). | ||
|
||
- create pbs.yaml if it hasn't been already created (It works, but not flexible). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just curious, what problem did you experience with this approach that makes it inflexible? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
@SyntaxNode I'm sorry my being late caused such confusion.. I went on vacation and couldn't respond. I'm going to fix it according to the code review. I'll do my best. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not a problem. It's looking great so far. |
||
|
||
- input the parameters into global environments (Highly recommend you to use this way also it's reliable). | ||
|
||
#### Finally, when you fill in your credentials of metrics, please, run: | ||
|
||
```bash | ||
./validate.sh | ||
``` | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Running There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @VeronikaSolovei9
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you, looks good! |
||
#### Make sure that an application returns any metrics - `http://localhost:9100/metrics`, if not, please check your names of environment and recompile again. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nitpick: also available at There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've fixed it. |
||
|
||
#### Add your host and port into prometheus.yml file on the instance of your [Prometheus](https://prometheus.io/). | ||
|
||
```yaml | ||
global: | ||
scrape_interval: 15s | ||
evaluation_interval: 15s | ||
|
||
external_labels: | ||
monitor: 'docker-host-alpha' | ||
|
||
rule_files: | ||
- "alert.rules" | ||
|
||
scrape_configs: | ||
- job_name: 'prometheus' | ||
scrape_interval: 10s | ||
static_configs: | ||
- targets: [ 'prometheus-host:9090'] | ||
|
||
- job_name: 'prebidserver-metrics' | ||
scrape_interval: 10s | ||
static_configs: | ||
- targets: ['prebidserver-host:9100' ] | ||
alerting: | ||
alertmanagers: | ||
- scheme: http | ||
static_configs: | ||
- targets: | ||
- 'localhost:9093' | ||
``` | ||
|
||
#### Import data source as [Prometheus](https://prometheus.io/) into [Grafana](https://grafana.com/) | ||
|
||
Just fill in host and port of [Prometheus](https://prometheus.io/) | ||
|
||
![img_grafana.png](images/img_grafana.png) | ||
|
||
#### In that case [Prebid server](https://docs.prebid.org/prebid-server/versions/pbs-versions-go.html) uses [package](https://github.com/prometheus/client_golang) in our case it works as [Node exporter](https://github.com/prometheus/node_exporter). Therefore, here is described only how to connect [Prebid server](https://docs.prebid.org/prebid-server/versions/pbs-versions-go.html) connection with [Prometheus](https://prometheus.io/). Also, if you are interested in [Prometheus](https://prometheus.io/) and want to dig deep, follow [docs](https://prometheus.io/docs/introduction/overview/). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe elaborate a bit indicating that this is the primary prefix added to your metrics to ensure uniqueness within your cluster?