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

"customer" variable need to be an annotation, not a label #32

Open
mouglou opened this issue Jan 10, 2022 · 4 comments
Open

"customer" variable need to be an annotation, not a label #32

mouglou opened this issue Jan 10, 2022 · 4 comments

Comments

@mouglou
Copy link

mouglou commented Jan 10, 2022

Issue Summary
Hi there !
I was tring to deploy Alerta, and lost sometime on the customer field.
As the documentation says here, the customer field need to be in the label section, which seems to be logical, but its was not working.
To get the customer field ok, I had to add it as an "annotation".

Environment

  • OS: linux

  • API version: 8.1.0

  • Deployment: Helmchart (Kubernetes)

  • Database: Postgres

  • Server config:
    Auth enabled? Yes
    Auth provider? Basic
    Customer views? No

alerta@alert-poc-alerta-f579f95f-mchv7:/$ alerta version
alerta 8.1.0
alerta client 8.0.0
requests 2.25.0
click 7.1.2

To Reproduce
Steps to reproduce the behavior:

  1. Deploy a PrometheusRule with the customer field in the label section
  2. Nothing will be display in the customer field
  3. Add it to annotations, the field will be ok

Expected behavior
Add the customer field in the labels, not annotation section

@fredgate
Copy link

fredgate commented May 6, 2022

Same problem. The field customer is empty in alerta using a label in prometheus alert.

I use Docker image alerta/alerta-web:8.7.0.

$ alerta version
alerta 8.7.0
alerta client 8.5.1
requests 2.26.0
click 8.0.3

It's curious because the prometheus webhook seems correct : https://github.com/alerta/alerta/blob/v8.7.0/alerta/webhooks/prometheus.py#L49

    environment = labels.pop('environment', current_app.config['DEFAULT_ENVIRONMENT'])
    customer = labels.pop('customer', None)

The customer field was introduced in alerta on Jan 11, 2019 by this commit, and always filled from the label:
alerta/alerta@aeb600d

@fredgate
Copy link

fredgate commented May 6, 2022

It seems that the field is correct for the alert object : we can see the correct value for the customer field in the AJAX requests that loaf alerts list, and in the data tab of the alert page.

It is a display bug in the web UI.

My UI is translated in french, can it be the cause ?
No : I changed the application settings to set the language as english, and the customer column is still empty.

@fredgate
Copy link

fredgate commented May 6, 2022

Solved by adding CUSTOMER_VIEWS = True in alerta configuration.

Not sure that it should be the correct behaviour. CUSTOMER_VIEWS is planned for multi-tenancy. But we want to see the value in customer column event without multi-tenancy.
To see if this condition is relevant: https://github.com/alerta/alerta-webui/blob/master/src/components/AlertList.vue#L218

<span v-if="col == 'customer' && $config.customer_views">

@aponchaut
Copy link

Hello,

I have the same problem with the customer label.
When I put the customer as annotation, I have the value displayed in alerta_webui but it is impossible to filter by customer from the link https://alerta*/customers (the customer value don't match).
Indeed, with the annotation setting, there are 2 "Customer" fields : one empty, the second with the annotation value.

Moreover, alertad receives the value of the client annotation (with the debug mode in alertad.conf) but the postgres "alerts" table does not contain the client value (the column is empty for all alerts).

When I set the both values in the same time (annotation and label, I don't receive the alerts).

The customer filtering don't work.

alertad : 8.7.0

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

3 participants