Skip to content

Commit

Permalink
Migrate Prometheus config
Browse files Browse the repository at this point in the history
Signed-off-by: Tom Kerkhove <kerkhove.tom@gmail.com>
  • Loading branch information
tomkerkhove committed Sep 1, 2020
1 parent 809be1e commit 55c13cc
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions charts/promitor-agent-scraper/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ their default values.
| `metricSinks.statsd.host` | DNS name or IP address of StatsD server | |
| `metricSinks.statsd.port` | Port (UDP) address of StatsD server | `8125` |
| `metricSinks.statsd.metricPrefix` | Prefix that will be added to every metric defined in the metric declaration | |
| `prometheus.scrapeEndpointPath` | Path where the scraping endpoint for Prometheus is being exposed | `/metrics` |
| `prometheus.enableMetricTimestamps` | Indication whether or not to include timestamp | `true` |
| `prometheus.metricUnavailableValue` | Value to report in Prometheus when no metric was found whether or not to include timestamp | `NaN` |
| `prometheus.enableServiceDiscovery` | Indication whether or not service discovery with annotations should be enabled ([docs](https://github.com/helm/charts/tree/master/stable/prometheus#scraping-pod-metrics-via-annotations)) | `true` |
| `metricSinks.prometheusScrapingEndpoint.baseUriPath` | Path where the scraping endpoint for Prometheus is being exposed | `/metrics` |
| `metricSinks.prometheusScrapingEndpoint.enableMetricTimestamps` | Indication whether or not to include timestamp | `true` |
| `metricSinks.prometheusScrapingEndpoint.metricUnavailableValue` | Value to report in Prometheus when no metric was found whether or not to include timestamp | `NaN` |
| `metricSinks.prometheusScrapingEndpoint.enableServiceDiscovery` | Indication whether or not service discovery with annotations should be enabled ([docs](https://github.com/helm/charts/tree/master/stable/prometheus#scraping-pod-metrics-via-annotations)) | `true` |
| `telemetry.applicationInsights.enabled` | Indication whether or not to send telemetry to Azure Application Insights | `false` |
| `telemetry.applicationInsights.logLevel` | Minimum level of logging for Azure Application Insights | |
| `telemetry.applicationInsights.key` | Application Insights instrumentation key | |
Expand Down
4 changes: 2 additions & 2 deletions charts/promitor-agent-scraper/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ include "promitor-agent-scraper.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
kubectl port-forward --namespace {{ .Release.Namespace }} $POD_NAME 8080:{{ .Values.service.targetPort }}

2. Check the scraping output at http://0.0.0.0:8080{{ .Values.prometheus.scrapeEndpointPath }}
2. Check the scraping output at http://0.0.0.0:8080{{ .Values.metricSinks.prometheusScrapingEndpoint.baseUriPath }}

3. To set up Prometheus in your cluster & pull in metrics from Promitor's scraping output, run:

cat > promitor-scrape-config.yaml <<EOF
extraScrapeConfigs: |
- job_name: {{ template "promitor-agent-scraper.fullname" . }}
metrics_path: {{ .Values.prometheus.scrapeEndpointPath }}
metrics_path: {{ .Values.metricSinks.prometheusScrapingEndpoint.baseUriPath }}
static_configs:
- targets:
- {{ template "promitor-agent-scraper.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.service.port }}
Expand Down
6 changes: 3 additions & 3 deletions charts/promitor-agent-scraper/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ data:
{{- end }}
{{- end }}
prometheusScrapingEndpoint:
metricUnavailableValue: {{ .Values.prometheus.metricUnavailableValue | quote }}
enableMetricTimestamps: {{ .Values.prometheus.enableMetricTimestamps | quote }}
baseUriPath: {{ .Values.prometheus.scrapeEndpointPath | quote }}
metricUnavailableValue: {{ .Values.metricSinks.prometheusScrapingEndpoint.metricUnavailableValue | quote }}
enableMetricTimestamps: {{ .Values.metricSinks.prometheusScrapingEndpoint.enableMetricTimestamps | quote }}
baseUriPath: {{ .Values.metricSinks.prometheusScrapingEndpoint.baseUriPath | quote }}
metricsConfiguration:
absolutePath: /config/metrics-declaration.yaml
telemetry:
Expand Down
4 changes: 2 additions & 2 deletions charts/promitor-agent-scraper/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ metadata:
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
type: {{ .Values.service.labelType }}
{{- if .Values.prometheus.enableServiceDiscovery }}
{{- if .Values.metricSinks.prometheusScrapingEndpoint.enableServiceDiscovery }}
annotations:
prometheus.io/scrape: "true"
prometheus.io/path: {{ .Values.prometheus.scrapeEndpointPath | quote }}
prometheus.io/path: {{ .Values.metricSinks.prometheusScrapingEndpoint.baseUriPath | quote }}
prometheus.io/port: {{ .Values.service.targetPort | quote }}
{{- end }}
spec:
Expand Down
10 changes: 5 additions & 5 deletions charts/promitor-agent-scraper/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ metricSinks:
host: ""
port: 8125
metricPrefix: ""
prometheusScrapingEndpoint:
baseUriPath: /metrics
enableMetricTimestamps: true
metricUnavailableValue: NaN
enableServiceDiscovery: true
resourceDiscovery:
enabled: false
host: ""
port: 80
prometheus:
scrapeEndpointPath: /metrics
enableMetricTimestamps: true
metricUnavailableValue: NaN
enableServiceDiscovery: true
telemetry:
defaultLogLevel: "Error"
applicationInsights:
Expand Down

0 comments on commit 55c13cc

Please sign in to comment.