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

Silenced "Expires 2 hours ago" #348

Open
anatolijd opened this issue Dec 10, 2020 · 1 comment
Open

Silenced "Expires 2 hours ago" #348

anatolijd opened this issue Dec 10, 2020 · 1 comment
Labels
issue: bug Something isn't working

Comments

@anatolijd
Copy link

I've got a few silenced items, with Expires time is in the past (see pic):

https://i.imgur.com/OpIY1Tf.jpg
Screenshot from 2020-12-11 00-45-14

Not sure if it Web UI or Silenced API issue, but it does not seem correct anyway.

Expected Behavior

I expect silences to expire on time.

Current Behavior

Entity silence item Expires: 2 hours ago.

Steps to Reproduce

silences were created with custom handler.
Each silence was created twice, with the same payload, with few minutes delay between calls.
First call returned 201 , 2nd call returned 409 Conflict

Not sure if it is web-ui or API issue, here is silenced items raw:

$ sensuctl silenced list --format yaml
type: Silenced
api_version: core/v2
metadata:
  created_by: admin
  name: entity:nginx-bbd465f66-xpcwf:*
  namespace: test
spec:
  begin: 1607635394
  creator: admin
  expire: 2000
  expire_on_resolve: false
  reason: Provisioning
  subscription: entity:nginx-bbd465f66-xpcwf
---
type: Silenced
api_version: core/v2
metadata:
  created_by: admin
  name: entity:packer-base-ebs:*
  namespace: test
spec:
  begin: 1607007012
  check: '*'
  creator: admin
  expire: -1
  expire_on_resolve: false
  reason: Provisioning
  subscription: entity:packer-base-ebs
---
type: Silenced
api_version: core/v2
metadata:
  created_by: admin
  name: entity:ragnarok-dev:*
  namespace: test
spec:
  begin: 1607634299
  creator: admin
  expire: 905
  expire_on_resolve: false
  reason: Provisioning
  subscription: entity:ragnarok-dev

Your Environment

  • Sensu version : 6.1.3 built from master last week
  • Operating System and version: Ubuntu 18
@anatolijd anatolijd added the issue: bug Something isn't working label Dec 10, 2020
@anatolijd
Copy link
Author

anatolijd commented Dec 11, 2020

i thought "begin":0 might have been an issue when creating silenced object, and probably duplicated sileced attemt too.

here is json payload sent by handler:

curl -v -k -H 'Content-type: application/json' -H "Authorization: Key $SENSU__API_KEY" -XPOST https://sensu-api.acme.com:8080/api/core/v2/silenced/test/entities/ -d

{
  "metadata": {
    "name": "entity:ragnarok-dev:*",
    "namespace": "test"
  },
  "expire": 1800,
  "expire_on_resolve": false,
  "creator": "admin",
  "reason": "Provisioning",
  "subscription": "entity:ragnarok-dev",
  "begin": 0
}

I made sure handler is eceuted only once and I updated handler to set begin = time.Now() , but issue still remains - UI still shows some items to expire in the past
Expires: 8 minutes ago

I've monitored expiration via sensuctl, and can tell that sensuctl output always shows correct Begin and Expire values,
and silenced item is resolved in-time.

# date && sensuctl silenced list
Fri Dec 11 13:35:30 UTC 2020
               Name                        Subscription           Check          Begin           Expire   ExpireOnResolve   Creator              Reason              Namespace  
 ──────────────────────────────── ────────────────────────────── ─────── ────────────────────── ──────── ───────────────── ───────── ────────────────────────────── ─────────── 
  entity:nginx-bbd465f66-xpcwf:*   entity:nginx-bbd465f66-xpcwf           2020-12-11T13:33:10Z   39s      false             admin     sensu-silence-entity-handler   default

So this is clearly web-ui issue - at some point is starts to display elapsed value (Begin - Expire) instead of Expire value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant