prometheus-community / yet-another-cloudwatch-exporter

Prometheus exporter for AWS CloudWatch - Discovers services through AWS tags, gets CloudWatch metrics data and provides them as Prometheus metrics with AWS tags as labels
Apache License 2.0
984 stars 337 forks source link

[BUG] MissingRegion: could not find region configuration #1075

Closed LH8PPL closed 1 year ago

LH8PPL commented 1 year ago

Is there an existing issue for this?

YACE version

v0.53.0

Config file

apiVersion: v1
kind: Namespace
metadata:
  name: yace
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: yace
  namespace: yace
data:
  config.yml: |-
    ---
    apiVersion: v1alpha1
    discovery:
      jobs:
        - type: AWS/S3
          regions:
            - eu-central-1
          period: 86400
          length: 86400
          metrics:
            - name: NumberOfObjects
              statistics: [Average]
            - name: BucketSizeBytes
              statistics: [Average]
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: yace
  namespace: yace
spec:
  replicas: 1
  selector:
    matchLabels:
      name: yace
  template:
    metadata:
      labels:
        name: yace
    spec:
      containers:
      - name: yace
        image: ghcr.io/nerdswords/yet-another-cloudwatch-exporter:v0.53.0 # release version as tag - Do not forget the version 'v'
        imagePullPolicy: IfNotPresent
        args:
          - "--config.file=/tmp/config.yml"
          - "--debug"
        env:
          - name: debug
            value: "true"
          - name : AWS_ENDPOINT_URL
            value: https://sts.eu-central-1.amazonaws.com
        ports:
        - name: app
          containerPort: 5000
        volumeMounts:
        - name: config-volume
          mountPath: /tmp
      volumes:
      - name: config-volume
        configMap:
          name: yace
---
apiVersion: v1
kind: Service
metadata:
  labels:
    app: yace
  name: yace
  namespace: yace
spec:
  ports:
  - name: http-metrics
    port: 5000
    protocol: TCP
    targetPort: 5000
  selector:
    app: yace
  sessionAffinity: None
  type: ClusterIP

Current Behavior

deploying on AWS EKS, enviornment closed to sts.amazonaws.com, can reach regional endpoint. Error: {"arn":"","error":"MissingRegion: could not find region configuration","job_type":"AWS/S3","level":"error","msg":"Couldn't get account Id","region":"eu-central-1","time":"2023-07-26T14:32:40Z"}

Expected Behavior

s3 metrics

Steps To Reproduce

  1. AWS EKS
  2. config above

Anything else?

No response

LH8PPL commented 1 year ago

i tried to add the sts-endpoint but got error: {"err":"line 3: field sts-endpoint not found in type config.ScrapeConf","level":"warning","msg":"config file syntax error","time":"2023-07-31T07:54:49Z"} {"level":"warning","msg":"Config file error(s) detected: Yace might not work as expected. Future versions of Yace might fail to run with an invalid config file.","time":"2023-07-31T07:54:49Z"}

LH8PPL commented 1 year ago

problem with security that my company put in place