Skip to content

Commit

Permalink
General Helm Chart improvements (#696)
Browse files Browse the repository at this point in the history
* Remove secret from file

* Remove "runtime" prefix

* Update sample

* Use new metric format
  • Loading branch information
tomkerkhove authored Sep 2, 2019
1 parent 1c19f32 commit 949fb4a
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 49 deletions.
18 changes: 9 additions & 9 deletions charts/promitor-agent-scraper/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ The following table lists the configurable parameters of the Promitor chart and
| `image.pullPolicy` | Policy to pull image | `Always` |
| `azureAuthentication.appId` | Id of the Azure AD entity to authenticate with | |
| `azureAuthentication.appKey` | Secret of the Azure AD entity to authenticate with | |
| `runtime.prometheus.scrapeEndpointPath` | Path where the scraping endpoint for Prometheus is being exposed | `/metrics` |
| `runtime.prometheus.enableMetricTimestamps` | Indication wheter or not to include timestamp | `true` |
| `runtime.prometheus.metricUnavailableValue` | Value to report in Prometheus when no metric was found wheter or not to include timestamp | `NaN` |
| `runtime.telemetry.applicationInsights.enabled` | Indication wheter or not to send telemetry to Azure Application Insights | `false` |
| `runtime.telemetry.applicationInsights.logLevel` | Minimum level of logging for Azure Application Insights | |
| `runtime.telemetry.applicationInsights.key` | Application Insights instrumentation key | |
| `runtime.telemetry.containerLogs.enabled` | Indication wheter or not to send telemetry to container logs | `true` |
| `runtime.telemetry.containerLogs.logLevel` | Minimum level of logging for container logs | |
| `runtime.telemetry.defaultLogLevel` | Minimum level of logging for all telemetry sinks, unless specified otherwise | `Error` |
| `prometheus.scrapeEndpointPath` | Path where the scraping endpoint for Prometheus is being exposed | `/metrics` |
| `prometheus.enableMetricTimestamps` | Indication wheter or not to include timestamp | `true` |
| `prometheus.metricUnavailableValue` | Value to report in Prometheus when no metric was found wheter or not to include timestamp | `NaN` |
| `telemetry.applicationInsights.enabled` | Indication wheter 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 | |
| `telemetry.containerLogs.enabled` | Indication wheter or not to send telemetry to container logs | `true` |
| `telemetry.containerLogs.logLevel` | Minimum level of logging for container logs | |
| `telemetry.defaultLogLevel` | Minimum level of logging for all telemetry sinks, unless specified otherwise | `Error` |
| `azureMetadata.tenantId` | Id of Azure tenant | |
| `azureMetadata.subscriptionId` | Id of Azure subscription | |
| `azureMetadata.resourceGroupName` | Name of resource group | `promitor` |
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 $POD_NAME 8080:{{ .Values.service.targetPort }}

2. Check the scraping output at http://127.0.0.1:8080{{ .Values.runtime.prometheus.scrapeEndpointPath }}
2. Check the scraping output at http://127.0.0.1:8080{{ .Values.prometheus.scrapeEndpointPath }}

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.runtime.prometheus.scrapeEndpointPath }}
metrics_path: {{ .Values.prometheus.scrapeEndpointPath }}
static_configs:
- targets:
- {{ template "promitor-agent-scraper.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.service.port }}
Expand Down
26 changes: 13 additions & 13 deletions charts/promitor-agent-scraper/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,31 @@ metadata:
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
data:
runtime.yaml: |-
yaml: |-
server:
httpPort: {{ .Values.service.targetPort | quote }}
prometheus:
metricUnavailableValue: {{ .Values.runtime.prometheus.metricUnavailableValue | quote }}
enableMetricTimestamps: {{ .Values.runtime.prometheus.enableMetricTimestamps | quote }}
metricUnavailableValue: {{ .Values.prometheus.metricUnavailableValue | quote }}
enableMetricTimestamps: {{ .Values.prometheus.enableMetricTimestamps | quote }}
scrapeEndpoint:
baseUriPath: {{ .Values.runtime.prometheus.scrapeEndpointPath | quote }}
baseUriPath: {{ .Values.prometheus.scrapeEndpointPath | quote }}
metricsConfiguration:
absolutePath: /config/metrics-declaration.yaml
telemetry:
applicationInsights:
{{- if .Values.runtime.telemetry.applicationInsights.key }}
instrumentationKey: {{ .Values.runtime.telemetry.applicationInsights.key | quote }}
{{- if .Values.telemetry.applicationInsights.key }}
instrumentationKey: {{ .Values.telemetry.applicationInsights.key | quote }}
{{- end }}
isEnabled: {{ .Values.runtime.telemetry.applicationInsights.enabled | quote }}
{{- if .Values.runtime.telemetry.applicationInsights.logLevel }}
verbosity: {{ .Values.runtime.telemetry.applicationInsights.logLevel | quote }}
isEnabled: {{ .Values.telemetry.applicationInsights.enabled | quote }}
{{- if .Values.telemetry.applicationInsights.logLevel }}
verbosity: {{ .Values.telemetry.applicationInsights.logLevel | quote }}
{{- end }}
containerLogs:
isEnabled: {{ .Values.runtime.telemetry.containerLogs.enabled | quote }}
{{- if .Values.runtime.telemetry.containerLogs.logLevel }}
verbosity: {{ .Values.runtime.telemetry.containerLogs.logLevel | quote }}
isEnabled: {{ .Values.telemetry.containerLogs.enabled | quote }}
{{- if .Values.telemetry.containerLogs.logLevel }}
verbosity: {{ .Values.telemetry.containerLogs.logLevel | quote }}
{{- end }}
defaultVerbosity: {{ .Values.runtime.telemetry.defaultLogLevel | quote }}
defaultVerbosity: {{ .Values.telemetry.defaultLogLevel | quote }}
metrics-declaration.yaml: |-
version: v1
azureMetadata:
Expand Down
34 changes: 17 additions & 17 deletions charts/promitor-agent-scraper/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,19 @@ azureAuthentication:
appId: ""
appKey: ""

runtime:
prometheus:
scrapeEndpointPath: /metrics
enableMetricTimestamps: True
metricUnavailableValue: NaN
telemetry:
defaultLogLevel: "Error"
applicationInsights:
enabled: False
key: ""
logLevel: ""
containerLogs:
enabled: True
logLevel: ""
prometheus:
scrapeEndpointPath: /metrics
enableMetricTimestamps: True
metricUnavailableValue: NaN
telemetry:
defaultLogLevel: "Error"
applicationInsights:
enabled: False
key: ""
logLevel: ""
containerLogs:
enabled: True
logLevel: ""

## Metric Declaration YAML
azureMetadata:
Expand All @@ -43,15 +42,16 @@ metricDefaults:
metrics: []
# Sample metric configuration below
# - name: demo_queue_size
# description: "Amount of active messages of the 'myqueue' queue"
# description: "Amount of active messages of the 'myqueue' queue (determined with ServiceBusQueue provider)"
# resourceType: ServiceBusQueue
# namespace: promitor-messaging
# queueName: myqueue
# azureMetricConfiguration:
# metricName: ActiveMessages
# aggregation:
# type: Total
# interval: 00:15:00
# resources:
# - namespace: promitor-messaging
# queueName: orders

secrets:
# To use your own secret, set createSecret to false and define the name/keys that your secret uses
Expand Down
6 changes: 0 additions & 6 deletions docs/deployment/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,6 @@ To use this, you will need to provide parameters [via `--set` or `--values`](htt
to these, you will need a metric declaration file as described in [Metric Declaration](/configuration/metrics).

```yaml
azureAuthentication:
# PROMITOR_AUTH_APPID (Required)
appId: "<azure-ad-app-id>"
# PROMITOR_AUTH_APPKEY (Required)
appKey: "<azure-ad-app-key>"

azureMetadata:
tenantId: "<azure-tenant-id>"
subscriptionId: "<azure-subscription-id>"
Expand Down
5 changes: 3 additions & 2 deletions docs/walkthrough/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,13 @@ metrics:
- name: demo_queue_size
description: "Amount of active messages of the 'demo_queue' queue"
resourceType: ServiceBusQueue
namespace: <service-bus-namespace>
queueName: demo_queue
azureMetricConfiguration:
metricName: ActiveMessages
aggregation:
type: Total
resources:
- namespace: <service-bus-namespace>
queueName: demo_queue
```

## Deploy Promitor to your cluster using Helm
Expand Down

0 comments on commit 949fb4a

Please sign in to comment.