Over at MOVE-UP we’re already using Grafana to display sensor data like altitude and speed. However, storing into and fetching it again from a database takes some seconds while we’d rather have that information live.
That’s where Grafana Live comes in, which allows you to stream data in (soft) real-time. For example, let’s say we have the data in a Python script:
import random
import time
alt = random.uniform(0, 1000)
speed = random.uniform(0, 100)
for _ in range(500):
alt += random.uniform(-5, 5)
speed += random.uniform(-1, 1)
time.sleep(0.1)
How do we get it into Grafana?

The official documentation suggests creating a full-blown
TypeScript + Go plugin or setup Telegraf.
None of that is necessary, you can just use the new API endpoint /api/live/push/:streamId
directly:
import os
import random
import requests
import time
url = "http://localhost:3000/api/live/push/test_stream"
headers = {"Authorization": "Bearer " + os.environ["AUTH"]}
alt = random.uniform(0, 1000)
speed = random.uniform(0, 100)
for _ in range(500):
alt += random.uniform(-5, 5)
speed += random.uniform(-1, 1)
response = requests.post(url, headers=headers, data=f"balloon speed={speed},alt={alt}")
if response.status_code != 200:
print(f"Error: {response.status_code} - {response.text}")
time.sleep(0.1)
Authentication is done with an API token.
Thanks to Grafana89e9 and Smaragda Benetou for pointing this out with code examples.
Webmentions
No webmentions were found.
{% for webmention in webmentions %}-
{{ webmention.content }}
{% if webmention.author %}
{{ webmention.author.name }}
{% endif %}
{% if webmention.pubdate and webmention.url %}on{% endif %}
{% if webmention.pubdate %}
{% endif %}
{% endfor %}
{% else %}No bookmarks were found.
{% endif %}{% for webmention in webmentions %}-
{% endfor %}
{% else %}No likes were found.
{% endif %}{% for webmention in webmentions %}-
{{ webmention.content }}
{% if webmention.author %}
{{ webmention.author.name }}
{% endif %}
{% if webmention.pubdate and webmention.url %}on{% endif %}
{% if webmention.pubdate %}
{% endif %}
{% endfor %}
{% else %}No links were found.
{% endif %}{% for webmention in webmentions %}-
{{ webmention.title }}
{% if webmention.pubdate %}
{% endif %}
{% endfor %}
{% else %}No posts were found.
{% endif %}{% for webmention in webmentions %}-
{{ webmention.content }}
{% if webmention.author %}
{% if webmention.author.photo %}
{% endif %}
{{ webmention.author.name }}
{% endif %}
{% if webmention.pubdate and webmention.author %}on{% endif %}
{% if webmention.pubdate %}
{% endif %}
{% endfor %}
{% else %}No replies were found.
{% endif %}{% for webmention in webmentions %}-
{% endfor %}
{% else %}No reposts were found.
{% endif %}{% for webmention in webmentions %}-
{{ webmention.author.name }}
{{ webmention.content }}
{% endfor %}
{% else %}No RSVPs were found.
{% endif %}{% for webmention in webmentions %}-
{% if webmention.author %}
{% if webmention.author.photo %}
{% endif %}
{{ webmention.author.name }}
{% endif %}
{% if webmention.content %}
{{ webmention.content }}
{% else %}
{{ webmention.title }}
{% endif %}
{% if webmention.pubdate %}
{% endif %}
{% if webmention.pubdate and webmention.url %}|{% endif %}
{% if webmention.url %}
Permalink
{% endif %}
{% endfor %}
{% else %}No webmentions were found.
{% endif %}Comments