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

Stackdriver adapter cannot use googlecloud exporters metrics #32700

Closed
justsomecorporateuser opened this issue Apr 26, 2024 · 2 comments
Closed
Labels
exporter/googlecloud needs triage New item requiring triage

Comments

@justsomecorporateuser
Copy link

Component(s)

exporter/googlecloud

Describe the issue you're reporting

Trying to set up HPA using Opentelemetry Operator, with Auto-instrumentation and Collector sending metrics to GCP monitoring.
I have https://github.com/GoogleCloudPlatform/k8s-stackdriver/tree/master/custom-metrics-stackdriver-adapter configured to pick the metrics and HPA set using external metrics

I can see the googlecloud exported metrics in Metrics Explorer fine.. (but with 50th, 95th, 99 percentile division ). When i try to set a HPA, it gives a warning:

unable to fetch metrics from external metrics API: Expected metric of type DoubleValue or Int64Value, but received TypedValue: { 0xc000d44900 [] []}

That is basically what custom-metrics-stackdriver-adapter docs say, must be either DOUBLE or INT64.

Question is this: Do i have some way to influence the metrics type for the metrics sent to GCP monitoring in Collector configs?

@justsomecorporateuser justsomecorporateuser added the needs triage New item requiring triage label Apr 26, 2024
Copy link
Contributor

Pinging code owners:

%s See Adding Labels via Comments if you do not have permissions to add labels yourself.

@justsomecorporateuser
Copy link
Author

justsomecorporateuser commented Apr 26, 2024

Problem was that my HPA did not have reducer.. once that was there, got it working

apiVersion: autoscaling/v2 
kind: HorizontalPodAutoscaler
metadata:
  name: spring-boot-hpa
  namespace: test
spec:
  minReplicas: 1
  maxReplicas: 5
  metrics:
  - type: External
    external:
      metric:
        name: workload.googleapis.com|http.server.request.duration
        selector:
          matchLabels:
            metric.labels.service_name: spring-boot-example
            reducer: "REDUCE_PERCENTILE_99"
      target:
        type: AverageValue
        averageValue: "1"
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: spring-boot-example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exporter/googlecloud needs triage New item requiring triage
Projects
None yet
Development

No branches or pull requests

1 participant