Skip to content
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

Use 1.0.0-preview-3 for tomkerkhove/promitor-agent-scraper #492

Merged
merged 1 commit into from
Apr 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .azure-devops/agents-scraper-release-official.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ steps:
### Getting started
Running Promitor Scraper is super easy:
```
docker run -d -p 8999:80 --name promitor-scraper
docker run -d -p 8999:80 --name promitor-agent-scraper
--env PROMITOR_AUTH_APPID='<azure-ad-app-id>' \
--env PROMITOR_AUTH_APPKEY='<azure-ad-app-key>' \
--volume C:/Promitor/metrics-declaration.yaml:/config/metrics-declaration.yaml \
Expand Down
4 changes: 2 additions & 2 deletions .azure-devops/scraper-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:
containerregistrytype: 'Container Registry'
dockerRegistryEndpoint: 'Docker Hub'
dockerFile: ./src/Promitor.Scraper.Host/Dockerfile
arguments: '--tag promitor-scraper-ci --no-cache'
arguments: '--tag promitor-agent-scraper-ci --no-cache'
useDefaultContext: false
buildContext: ./src/
imageName: '$(Image.TaggedName)'
Expand All @@ -99,7 +99,7 @@ jobs:
imageName: '$(Image.TaggedName)'
containerName: 'promitor-ci'
ports: '8999:80'
volumes: '/samples/promitor-sample.yaml:/config/metrics-declaration.yaml promitor-scraper-ci'
volumes: '/samples/promitor-sample.yaml:/config/metrics-declaration.yaml promitor-agent-scraper-ci'
envVars: |
PROMITOR_AUTH_APPID='$(Container.Env.AzureMonitor.Id)'
PROMITOR_AUTH_APPKEY='$(Container.Env.AzureMonitor.Key)'
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

<p align="center">
<a href="./LICENSE" rel="nofollow"><img src="https://img.shields.io/github/license/mashape/apistatus.svg?style=flat-square" alt="License"></a>
<a href="https://hub.docker.com/r/tomkerkhove/promitor-scraper/" rel="nofollow"><img src="https://img.shields.io/docker/pulls/tomkerkhove/promitor-scraper.svg?style=flat-square" alt="Docker Pulls"></a>
<a href="https://hub.docker.com/r/tomkerkhove/promitor-agent-scraper/" rel="nofollow"><img src="https://img.shields.io/docker/pulls/tomkerkhove/promitor-agent-scraper.svg?style=flat-square" alt="Docker Pulls"></a>
<a href="https://dev.azure.com/tomkerkhove/Promitor/_build/latest?definitionId=50&branchName=master" rel="nofollow"><img src="https://dev.azure.com/tomkerkhove/Promitor/_apis/build/status/Promitor%20CI%20-%20Scraper%20Agent?branchName=master" alt="Build Status"></a>
<a href="https://hub.docker.com/r/tomkerkhove/promitor-scraper/" rel="nofollow"><img src="https://img.shields.io/docker/stars/tomkerkhove/promitor-scraper.svg?style=flat-square" alt="Docker Stars"></a>
<a href="https://hub.docker.com/r/tomkerkhove/promitor-agent-scraper/" rel="nofollow"><img src="https://img.shields.io/docker/stars/tomkerkhove/promitor-agent-scraper.svg?style=flat-square" alt="Docker Stars"></a>
<a href="https://www.codefactor.io/repository/github/tomkerkhove/promitor" rel="nofollow"><img src="https://www.codefactor.io/repository/github/tomkerkhove/promitor/badge" alt="CodeFactor"></a>
<a href="https://app.netlify.com/sites/promitor-staging/deploys" rel="nofollow"><img src="https://api.netlify.com/api/v1/badges/07753d51-f4f8-4ffb-8e8d-d64c312c6636/deploy-status" alt="Netlify"></a>
<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=LYCEDSP3S5P9G&source=url" rel="nofollow"><img src="https://promitor.io/media/buttons/paypal.png" alt="Donate"></a>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
appVersion: "1.0"
description: A Helm chart to deploy Promitor, an Azure Monitor scraper for Prometheus
name: promitor-scraper
name: promitor-agent-scraper
icon: https://github.com/tomkerkhove/promitor/blob/master/docs/media/logos/promitor.png
home: https://github.com/tomkerkhove/promitor
version: 0.1.0
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
1. Forward the application port by running these commands:

export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ include "promitor-scraper.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
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.scrapeConfig.path }}
Expand All @@ -13,6 +13,6 @@ extraScrapeConfigs: |
metrics_path: {{ .Values.scrapeConfig.path }}
static_configs:
- targets:
- {{ template "promitor-scraper.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.service.port }}
- {{ template "promitor-agent-scraper.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.service.port }}
EOF
helm install stable/prometheus -f promitor-scrape-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "promitor-scraper.name" -}}
{{- define "promitor-agent-scraper.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

Expand All @@ -11,7 +11,7 @@ Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "promitor-scraper.fullname" -}}
{{- define "promitor-agent-scraper.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
Expand All @@ -27,16 +27,16 @@ If release name contains chart name it will be used as a full name.
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "promitor-scraper.chart" -}}
{{- define "promitor-agent-scraper.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create secret name based on whether or not user defined it.
*/}}
{{- define "promitor-scraper.secretname" -}}
{{- define "promitor-agent-scraper.secretname" -}}
{{- if .Values.secrets.createSecret -}}
{{ template "promitor-scraper.fullname" . }}
{{ template "promitor-agent-scraper.fullname" . }}
{{- else -}}
{{- printf "%s" .Values.secrets.secretName -}}
{{- end -}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{{- $metrics := toYaml .Values.metrics -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: config-map-{{ template "promitor-scraper.fullname" . }}
labels:
app: {{ template "promitor-scraper.name" . }}
chart: {{ template "promitor-scraper.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
data:
metrics-declaration.yaml: |-
azureMetadata:
tenantId: {{ .Values.azureMetadata.tenantId }}
subscriptionId: {{ .Values.azureMetadata.subscriptionId }}
resourceGroupName: {{ .Values.azureMetadata.resourceGroupName }}
metricDefaults:
aggregation:
interval: {{ .Values.metricDefaults.aggregation.interval }}
scraping:
schedule: {{ .Values.metricDefaults.scraping.schedule | quote }}
metrics:
{{- $metrics := toYaml .Values.metrics -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: config-map-{{ template "promitor-agent-scraper.fullname" . }}
labels:
app: {{ template "promitor-agent-scraper.name" . }}
chart: {{ template "promitor-agent-scraper.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
data:
metrics-declaration.yaml: |-
azureMetadata:
tenantId: {{ .Values.azureMetadata.tenantId }}
subscriptionId: {{ .Values.azureMetadata.subscriptionId }}
resourceGroupName: {{ .Values.azureMetadata.resourceGroupName }}
metricDefaults:
aggregation:
interval: {{ .Values.metricDefaults.aggregation.interval }}
scraping:
schedule: {{ .Values.metricDefaults.scraping.schedule | quote }}
metrics:
{{ tpl $metrics . | indent 4 }}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: {{ template "promitor-scraper.fullname" . }}
name: {{ template "promitor-agent-scraper.fullname" . }}
labels:
app: {{ template "promitor-scraper.name" . }}
chart: {{ template "promitor-scraper.chart" . }}
app: {{ template "promitor-agent-scraper.name" . }}
chart: {{ template "promitor-agent-scraper.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
Expand All @@ -16,13 +16,13 @@ spec:
maxUnavailable: 1
selector:
matchLabels:
app: {{ template "promitor-scraper.name" . }}
app: {{ template "promitor-agent-scraper.name" . }}
release: {{ .Release.Name }}
type: {{ .Values.service.selectorType }}
template:
metadata:
labels:
app: {{ template "promitor-scraper.name" . }}
app: {{ template "promitor-agent-scraper.name" . }}
release: {{ .Release.Name }}
type: {{ .Values.service.selectorType }}
annotations:
Expand All @@ -43,12 +43,12 @@ spec:
- name: PROMITOR_AUTH_APPID
valueFrom:
secretKeyRef:
name: {{ template "promitor-scraper.secretname" . }}
name: {{ template "promitor-agent-scraper.secretname" . }}
key: {{ .Values.secrets.appIdSecret }}
- name: PROMITOR_AUTH_APPKEY
valueFrom:
secretKeyRef:
name: {{ template "promitor-scraper.secretname" . }}
name: {{ template "promitor-agent-scraper.secretname" . }}
key: {{ .Values.secrets.appKeySecret }}
- name: PROMITOR_HTTP_PORT
value: {{ .Values.service.targetPort | quote }}
Expand All @@ -62,11 +62,11 @@ spec:
- name: PROMITOR_TELEMETRY_INSTRUMENTATIONKEY
valueFrom:
secretKeyRef:
name: {{ template "promitor-scraper.secretname" . }}
name: {{ template "promitor-agent-scraper.secretname" . }}
key: {{ .Values.secrets.appInsightsSecret }}
{{- end }}
volumeMounts:
- name: config-volume-{{ template "promitor-scraper.fullname" . }}
- name: config-volume-{{ template "promitor-agent-scraper.fullname" . }}
mountPath: /config/
livenessProbe:
httpGet:
Expand All @@ -77,6 +77,6 @@ spec:
path: /api/v1/health
port: http
volumes:
- name: config-volume-{{ template "promitor-scraper.fullname" . }}
- name: config-volume-{{ template "promitor-agent-scraper.fullname" . }}
configMap:
name: config-map-{{ template "promitor-scraper.fullname" . }}
name: config-map-{{ template "promitor-agent-scraper.fullname" . }}
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{{- if .Values.secrets.createSecret }}
apiVersion: v1
kind: Secret
metadata:
name: {{ template "promitor-scraper.secretname" . }}
labels:
app: {{ template "promitor-scraper.name" . }}
chart: {{ template "promitor-scraper.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
type: Opaque
data:
{{ .Values.secrets.appIdSecret }}: {{ .Values.azureAuthentication.appId | b64enc | quote }}
{{ .Values.secrets.appKeySecret }}: {{ .Values.azureAuthentication.appKey | b64enc | quote }}
{{- if .Values.telemetry.appInsightsKey }}
{{ .Values.secrets.appInsightsSecret }}: {{ .Values.telemetry.appInsightsKey | b64enc | quote }}
{{- end }}
{{- end }}
{{- if .Values.secrets.createSecret }}
apiVersion: v1
kind: Secret
metadata:
name: {{ template "promitor-agent-scraper.secretname" . }}
labels:
app: {{ template "promitor-agent-scraper.name" . }}
chart: {{ template "promitor-agent-scraper.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
type: Opaque
data:
{{ .Values.secrets.appIdSecret }}: {{ .Values.azureAuthentication.appId | b64enc | quote }}
{{ .Values.secrets.appKeySecret }}: {{ .Values.azureAuthentication.appKey | b64enc | quote }}
{{- if .Values.telemetry.appInsightsKey }}
{{ .Values.secrets.appInsightsSecret }}: {{ .Values.telemetry.appInsightsKey | b64enc | quote }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "promitor-scraper.fullname" . }}
name: {{ template "promitor-agent-scraper.fullname" . }}
labels:
app: {{ template "promitor-scraper.name" . }}
chart: {{ template "promitor-scraper.chart" . }}
app: {{ template "promitor-agent-scraper.name" . }}
chart: {{ template "promitor-agent-scraper.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
type: {{ .Values.service.labelType }}
Expand All @@ -20,6 +20,6 @@ spec:
targetPort: {{ .Values.service.targetPort }}
protocol: TCP
selector:
app: {{ template "promitor-scraper.name" . }}
app: {{ template "promitor-agent-scraper.name" . }}
release: {{ .Release.Name }}
type: {{ .Values.service.selectorType }}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Default values for promitor-scraper.
# Default values for promitor-agent-scraper.
# This is a YAML-formatted file.

replicaCount: 1

image:
repository: tomkerkhove/promitor-agent-scraper
tag: 1.0.0-preview-2
tag: 1.0.0-preview-3
pullPolicy: Always

azureAuthentication:
Expand Down
2 changes: 1 addition & 1 deletion deploy/automation/docker-hub/ci/azuredeploy.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {
"Define_GitHub_comment_text": {
"inputs": "Docker image for this PR was built and is available on [Docker Hub](@{triggerBody()?['repository']?['repo_url']}).\n\nYou can pull it locally via the CLI:\n```shell\ndocker pull @{triggerBody()?['repository']?['repo_name']}:@{triggerBody()?['push_data']?['tag']}\n```\n\nWant to verify the new version? Run it locally:\n```shell\ndocker run -d -p 8999:80 --name promitor-scraper-@{triggerBody()?['push_data']?['tag']} \\\n --env PROMITOR_AUTH_APPID='<azure-ad-app-id>' \\\n --env PROMITOR_AUTH_APPKEY='<azure-ad-app-key>' \\\n --volume C:/Promitor/metrics-declaration.yaml:/config/metrics-declaration.yaml \\\n @{triggerBody()?['repository']?['repo_name']}:@{triggerBody()?['push_data']?['tag']}\n```",
"inputs": "Docker image for this PR was built and is available on [Docker Hub](@{triggerBody()?['repository']?['repo_url']}).\n\nYou can pull it locally via the CLI:\n```shell\ndocker pull @{triggerBody()?['repository']?['repo_name']}:@{triggerBody()?['push_data']?['tag']}\n```\n\nWant to verify the new version? Run it locally:\n```shell\ndocker run -d -p 8999:80 --name promitor-agent-scraper-@{triggerBody()?['push_data']?['tag']} \\\n --env PROMITOR_AUTH_APPID='<azure-ad-app-id>' \\\n --env PROMITOR_AUTH_APPKEY='<azure-ad-app-key>' \\\n --volume C:/Promitor/metrics-declaration.yaml:/config/metrics-declaration.yaml \\\n @{triggerBody()?['repository']?['repo_name']}:@{triggerBody()?['push_data']?['tag']}\n```",
"runAfter": {
"Determine_GitHub_Issue_Id": [
"Succeeded"
Expand Down
8 changes: 4 additions & 4 deletions docs/deployment/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ _For more information about advanced configuration, read our documentation [here
❯ docker run -d -p 8999:80 -e PROMITOR_AUTH_APPID='<azure-ad-app-id>' \
-e PROMITOR_AUTH_APPKEY='<azure-ad-app-key>' \
-v C:/Promitor/metrics-declaration.yaml:/config/metrics-declaration.yaml \
tomkerkhove/promitor-scraper
tomkerkhove/promitor-agent-scraper:1.0.0-preview-3
```

# Kubernetes
We currently provide [a helm chart](https://github.com/tomkerkhove/promitor/tree/master/charts/promitor-scraper) which deploys all the required infrastructure on your Kubernetes cluster.
We currently provide [a helm chart](https://github.com/tomkerkhove/promitor/tree/master/charts/promitor-agent-scraper) which deploys all the required infrastructure on your Kubernetes cluster.

To use this, you will need to provide parameters [via `--set` or `--values`](https://helm.sh/docs/using_helm/#customizing-the-chart-before-installing). Included here are the values that correspond with the local environment variables. In addition
to these, you will need a metric declaration file as described in [Metric Declaration](/configuration/metrics).
Expand All @@ -40,11 +40,11 @@ telemetry:
appInsightsKey: "<azure-app-insights-key>"
```

Check the [full values file](https://github.com/tomkerkhove/promitor/blob/master/charts/promitor-scraper/values.yaml) to see all configurable values.
Check the [full values file](https://github.com/tomkerkhove/promitor/blob/master/charts/promitor-agent-scraper/values.yaml) to see all configurable values.

If you have a `metric-declaration.yaml` file, you can create a basic deployment with this command:
```
❯ helm install --name promitor-scraper ./charts/promitor-scraper \
❯ helm install --name promitor-agent-scraper ./charts/promitor-agent-scraper \
--set azureAuthentication.appId='<azure-ad-app-id>' \
--set azureAuthentication.appKey='<azure-ad-app-key>' \
--values /path/to/metric-declaration.yaml
Expand Down
10 changes: 5 additions & 5 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ layout: default
title: Promitor - An Azure Monitor scraper for Prometheus
---

[![License](https://img.shields.io/github/license/mashape/apistatus.svg?style=flat-square)](https://github.com/tomkerkhove/promitor/blob/master/LICENSE)[![Build Status](https://dev.azure.com/tomkerkhove/Promitor/_apis/build/status/Promitor%20CI%20-%20Scraper%20Agent?branchName=master)](https://dev.azure.com/tomkerkhove/Promitor/_build/latest?definitionId=50&branchName=master) [![Docker Pulls](https://img.shields.io/docker/pulls/tomkerkhove/promitor-scraper.svg?style=flat-square)](https://hub.docker.com/r/tomkerkhove/promitor-scraper/)
[![Docker Stars](https://img.shields.io/docker/stars/tomkerkhove/promitor-scraper.svg?style=flat-square)](https://hub.docker.com/r/tomkerkhove/promitor-scraper/)[![Donate](https://promitor.io/media/buttons/paypal.png)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=LYCEDSP3S5P9G&source=url)
[![License](https://img.shields.io/github/license/mashape/apistatus.svg?style=flat-square)](https://github.com/tomkerkhove/promitor/blob/master/LICENSE)[![Build Status](https://dev.azure.com/tomkerkhove/Promitor/_apis/build/status/Promitor%20CI%20-%20Scraper%20Agent?branchName=master)](https://dev.azure.com/tomkerkhove/Promitor/_build/latest?definitionId=50&branchName=master) [![Docker Pulls](https://img.shields.io/docker/pulls/tomkerkhove/promitor-agent-scraper.svg?style=flat-square)](https://hub.docker.com/r/tomkerkhove/promitor-agent-scraper/)
[![Docker Stars](https://img.shields.io/docker/stars/tomkerkhove/promitor-agent-scraper.svg?style=flat-square)](https://hub.docker.com/r/tomkerkhove/promitor-agent-scraper/)[![Donate](https://promitor.io/media/buttons/paypal.png)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=LYCEDSP3S5P9G&source=url)

**Promitor** is an **Azure Monitor scraper for Prometheus** providing a scraping endpoint for Prometheus that provides a configured subset of Azure Monitor metrics.

Expand All @@ -15,14 +15,14 @@ title: Promitor - An Azure Monitor scraper for Prometheus
# Running Promitor Scraper
Running Promitor Scraper is super easy:
```
docker run -d -p 8999:80 --name promitor-scraper \
docker run -d -p 8999:80 --name promitor-agent-scraper \
--env PROMITOR_AUTH_APPID='<azure-ad-app-id>' \
--env PROMITOR_AUTH_APPKEY='<azure-ad-app-key>' \
--volume C:/Promitor/metrics-declaration.yaml:/config/metrics-declaration.yaml \
tomkerkhove/promitor-scraper
tomkerkhove/promitor-agent-scraper:1.0.0-preview-3
```

Docker image is available on [Docker Hub](https://hub.docker.com/r/tomkerkhove/promitor-scraper/).
Docker image is available on [Docker Hub](https://hub.docker.com/r/tomkerkhove/promitor-agent-scraper/).

# Features

Expand Down
Loading