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

Error checking metric providers: prometheus in metric template success-rate.fakenamespace not avaiable #1553

Open
felipesbs opened this issue Nov 21, 2023 · 1 comment

Comments

@felipesbs
Copy link

felipesbs commented Nov 21, 2023

Describe the bug

running query failed: error response: ","canary":"fakedeploy.fakenamespace │
│ ","stacktrace":"github.com/fluxcd/flagger/pkg/controller.(*Controller).recordEventErrorf\n\t/workspace/pkg/controller/events.go:39\ngithub.com/fluxcd/flagger/pkg/controller.(*Controller).advanceCanary\n\t/workspace/pkg/controller/scheduler.go:207\ngithub │
│ .com/fluxcd/flagger/pkg/controller.CanaryJob.Start.func1\n\t/workspace/pkg/controller/job.go:39"}

To Reproduce

Create MetricTemplate Resource with this specs.

apiVersion: flagger.app/v1beta1
kind: MetricTemplate
metadata:
  name: success-rate
  namespace: fakenamespace
spec:
  provider:
    type: prometheus
    address: http://prometheus.linkerd-viz:9090
  query: |
    sum(
      rate(
        response_total{
          namespace="{{ namespace }}",
          deployment=~"{{ target }}",
          classification!="failure",
          direction="{{ variables.direction }}"
        }[{{ interval }}]
      )
    ) 
    / 
    sum(
      rate(
        response_total{
          namespace="{{ namespace }}",
          deployment=~"{{ target }}",
          direction="{{ variables.direction }}"
        }[{{ interval }}]
      )
    ) 
    * 100

Expected behavior

Check Metrics for Canary Deploy

Additional context

  • Flagger version: 1.34.0
  • Kubernetes version: GKE 1.27.7-gke.1121000
  • Service Mesh provider: Linkerd
  • Ingress provider: Nginx
@LiZhenCheng9527
Copy link
Contributor

Could you provide the flagger logs? Was there a log like this when the flagger installation succeeded:
{"level":"info","ts":"2024-01-26T07:44:04.473Z","caller":"flagger/main.go:206","msg":"Connected to metrics server http://prometheus:9090"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants