-
I have installed promitor scraper agent for "resourceType: ApiManagement" on AKS cluster. Helm chart used:- https://hub.helm.sh/charts/promitor/promitor-agent-scraper/2.0.0-preview-1 But the pod is getting crashed with the following error, Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object. Tried configuring "Resourcetype: Azure Cache for Redis" using the metrics declaration https://promitor.io/configuration/v1.x/metrics/redis-cache and got the same error. But able to make it work using the below runtime configuration, prometheus: Tried the same runtime configuration for "ApiManagement", but got the below error, Unhandled Exception: System.Runtime.Serialization.SerializationException: Unable to deserialize the configured metrics declaration. Please verify that it is a well-formed YAML specification. ---> System.ArgumentException: Requested value 'ApiManagement' was not found. Can you please help on this? |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 14 replies
-
That's not nice. Would you mind sharing:
|
Beta Was this translation helpful? Give feedback.
-
configmap.txt Please find the files attached. Full logs |
Beta Was this translation helpful? Give feedback.
-
The steps followed as below,
helm install promitor-agent-scraper-apim promitor/promitor-agent-scraper --values ./metric-declaration.yaml
cat metric-declaration.yaml azureAuthentication:
appId: "<appId>"
appKey: "<appKey>"
azureMetadata:
tenantId: "<tenantId>"
subscriptionId: "<subscriptionId>"
resourceGroupName: "<resourceGroupName>"
metricDefaults:
aggregation:
interval: 00:01:00
scraping:
schedule: "0 * * ? * *"
metrics:
- name: promitor_test_azureapimanagement_capacity
description: "The amount of capacity used an Azure API Management instance."
resourceType: ApiManagement
azureMetricConfiguration:
metricName: Capacity
aggregation:
type: Average
resources:
- instanceName: "<instanceName>" |
Beta Was this translation helpful? Give feedback.
-
Deployment yaml file below, apiVersion: extensions/v1beta1
kind: Deployment
metadata:
annotations:
deployment.kubernetes.io/revision: "4"
meta.helm.sh/release-name: promitor-agent-scraper-apim
meta.helm.sh/release-namespace: aksmonitor
creationTimestamp: "2020-08-04T13:35:30Z"
generation: 4
labels:
app: promitor-agent-scraper
app.kubernetes.io/managed-by: Helm
chart: promitor-agent-scraper-1.6.0
heritage: Helm
release: promitor-agent-scraper-apim
name: promitor-agent-scraper-apim
namespace: aksmonitor
resourceVersion: "11816974"
selfLink: /apis/extensions/v1beta1/namespaces/aksmonitor/deployments/promitor-agent-scraper-apim
uid: 94c2a2ed-feed-4fb6-a500-04c4f0de8e83
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
app: promitor-agent-scraper
release: promitor-agent-scraper-apim
type: runtime
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
annotations:
checksum/config: 59aeec025eb4412a83fe1dff5052efb689b305e34d39c5fc9521fad852f58798
checksum/secret: 91f05f2cd7568f445af8055aeb528f47e1063daa1eaa1bd93e109ecccbd2e902
kubectl.kubernetes.io/restartedAt: "2020-08-04T07:52:25-07:00"
creationTimestamp: null
labels:
app: promitor-agent-scraper
release: promitor-agent-scraper-apim
type: runtime
spec:
containers:
- env:
- name: PROMITOR_AUTH_APPID
valueFrom:
secretKeyRef:
key: azure-app-id
name: promitor-agent-scraper-apim
- name: PROMITOR_AUTH_APPKEY
valueFrom:
secretKeyRef:
key: azure-app-key
name: promitor-agent-scraper-apim
image: tomkerkhove/promitor-agent-scraper:1.0.0
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
httpGet:
path: /api/v1/health
port: http
scheme: HTTP
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
name: promitor-agent-scraper
ports:
- containerPort: 88
name: http
protocol: TCP
readinessProbe:
failureThreshold: 3
httpGet:
path: /api/v1/health
port: http
scheme: HTTP
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /config/
name: config-volume-promitor-agent-scraper-apim
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
serviceAccount: promitor-agent-scraper-apim
serviceAccountName: promitor-agent-scraper-apim
terminationGracePeriodSeconds: 30
volumes:
- configMap:
defaultMode: 420
name: config-map-promitor-agent-scraper-apim
name: config-volume-promitor-agent-scraper-apim
status:
conditions:
- lastTransitionTime: "2020-08-04T13:35:30Z"
lastUpdateTime: "2020-08-04T13:35:30Z"
message: Deployment has minimum availability.
reason: MinimumReplicasAvailable
status: "True"
type: Available
- lastTransitionTime: "2020-08-04T15:01:44Z"
lastUpdateTime: "2020-08-04T15:01:44Z"
message: ReplicaSet "promitor-agent-scraper-apim-8667d8f9" has timed out progressing.
reason: ProgressDeadlineExceeded
status: "False"
type: Progressing
observedGeneration: 4
replicas: 1
unavailableReplicas: 1
updatedReplicas: 1 |
Beta Was this translation helpful? Give feedback.
-
I am able to scrape metrics "Capacity" for ApiManagement, but other metrics are not working. Getting the below errors, Error for metrics "Requests",
Metrics Declaration as below, azureAuthentication:
appId: "appId"
appKey: "appKey"
azureMetadata:
tenantId: "tenantId"
subscriptionId: "subscriptionId"
resourceGroupName: "resourceGroupName"
metricDefaults:
aggregation:
interval: 00:01:00
scraping:
schedule: "0 * * ? * *"
metrics:
- name: Requests
description: "Requests"
resourceType: ApiManagement
azureMetricConfiguration:
metricName: Requests
aggregation:
type: Sum
resources:
- instanceName: "instanceName" Error for metrics "Duration of Backend Requests",
|
Beta Was this translation helpful? Give feedback.
-
Thank you!! it worked and i was able to add the metrics. Do Promitor have support for scraping Application Gateway metrics from Azure Monitor to Prometheus? |
Beta Was this translation helpful? Give feedback.
@tomkerkhove
Deployment yaml file below,