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

cLoki - Live Update Mode #30

Closed
Dletta opened this issue Sep 18, 2021 · 1 comment
Closed

cLoki - Live Update Mode #30

Dletta opened this issue Sep 18, 2021 · 1 comment

Comments

@Dletta
Copy link
Collaborator

Dletta commented Sep 18, 2021

Problem

Live Update Mode is not yet implemented.

Goal / Solution / Example

Query: {type="call"}

  • Grafana expects a websocket to be opened based on the query path below
  • ws://grafana/api/datasources/proxy/24/loki/api/v1/tail?query=%7Btype%3D%22call%22%7D
  • The data that comes back from Loki (one line, but here prettified for reading
  •  { 
      "streams": [
        {
         "stream": {
          "duration":"0",
          "from_user":"311",
          "ruri_user":"00048177783344",
          "status":"8",
          "type":"call"
         },
      "values":[
        [
         "1631983284788000000",
         "USER_FAILURE 0 seconds call with 22177e4b-b394-4c54-8250-8ce5563d5c8b from 311@136.243.16.181 (193.46.255.223:47385) to 00048177783344@ (136.243.16.181:5060)"
        ]
       ]
      }
     ]
    }

Seems it is not much different in response as a normal query results, minus the 'overhead' or 'meta data' that we receive on the first answer. In the back Grafana gets the 'existing' data via http response and then opens the websocket for future update. (Seems like it sets up a watcher on backend (well of course how else))
@akvlad akvlad mentioned this issue Nov 3, 2021
@akvlad
Copy link
Collaborator

akvlad commented Nov 4, 2021

Done with the PR.

@akvlad akvlad closed this as completed Nov 4, 2021
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