...

Text file src/edge-infra.dev/config/pallets/o11y/otel/base/otel-collector-promtargets.yaml

Documentation: edge-infra.dev/config/pallets/o11y/otel/base

     1apiVersion: opentelemetry.io/v1beta1
     2kind: OpenTelemetryCollector
     3metadata:
     4  name: collector-with-ta-prometheus-cr
     5spec:
     6  serviceAccount: opentelemetry-targetallocator-sa
     7  priorityClassName: edge-p4-operability-services
     8  image: us-east1-docker.pkg.dev/ret-edge-pltf-infra/thirdparty/otel/opentelemetry-collector-contrib@sha256:ff3b385fc8a4bc7709e2bd8b4024259b649f78732aecc874a963250b5a5c3dd4 #TBD: Fix bzl path automation
     9  resources:
    10    requests:
    11      cpu: 25m
    12      memory: 128Mi
    13  config:
    14    service:
    15      pipelines:
    16        metrics:
    17          exporters:
    18          - googlemanagedprometheus
    19          processors:
    20          - attributes
    21          - resource
    22          - groupbyattrs
    23          - resourcedetection
    24          - memory_limiter
    25          - batch
    26          receivers:
    27          - prometheus
    28      telemetry:
    29        logs:
    30          encoding: "json"
    31          level: "WARN"
    32    exporters:
    33      googlemanagedprometheus:
    34        metric:
    35          prefix: prometheus.googleapis.com
    36          compression: gzip
    37    processors:
    38      attributes:
    39        actions:
    40        - value: ${cluster_hash}
    41          action: upsert
    42          key: cluster_hash
    43        - value: ${cluster_uuid}
    44          action: upsert
    45          key: cluster_name
    46        - value: ${cluster_provider}
    47          action: upsert
    48          key: cluster_type
    49      batch:
    50        # batch metrics before sending to reduce API usage
    51        send_batch_max_size: 0
    52        send_batch_size: 10000
    53        timeout: 10s
    54      groupbyattrs:
    55        keys:
    56        - cluster
    57        - location
    58        - project_id
    59        - namespace
    60      memory_limiter:
    61        # drop metrics if memory usage gets too high
    62        check_interval: 5s
    63        limit_mib: 4096
    64      resource:
    65        attributes:
    66        - value: ${cluster_uuid}
    67          action: upsert
    68          key: cluster
    69        - value: ${gcp_region}-${gcp_zone}
    70          action: upsert
    71          key: location
    72        - value: ${gcp_project_id}
    73          action: upsert
    74          key: project_id
    75      resourcedetection:
    76        detectors:
    77        - gcp
    78        override: false
    79        timeout: 5s
    80    receivers:
    81      prometheus:
    82        config:
    83          scrape_configs:
    84          - job_name: otel-collector
    85            scrape_interval: 60s
    86            static_configs:
    87            - targets:
    88              - 0.0.0.0:8888
    89        report_extra_scrape_metrics: true
    90        target_allocator:
    91          collector_id: "$${POD_NAME}"
    92          endpoint: http://collector-with-ta-prometheus-cr-targetallocator
    93          interval: 60s
    94  managementState: managed
    95  mode: statefulset
    96  podDisruptionBudget:
    97    minAvailable: 1
    98  targetAllocator:
    99    serviceAccount: opentelemetry-targetallocator-sa
   100    image: us-east1-docker.pkg.dev/ret-edge-pltf-infra/thirdparty/ghcr.io/open-telemetry/opentelemetry-operator/target-allocator@sha256:c490ab98f73f683d11af86ac2b0c69be89bc787abfcb38525f870a7d377173da #TBD: Fix bzl path automation
   101    resources:
   102      requests:
   103        cpu: 10m
   104        memory: 10Mi
   105    enabled: true
   106    observability:
   107      metrics:
   108        enableMetrics: true
   109    prometheusCR:
   110      enabled: true
   111      podMonitorSelector: {}
   112      scrapeInterval: 1m0s
   113      serviceMonitorSelector: {}
   114  upgradeStrategy: automatic

View as plain text