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

Victorialogs as a source for annotations #188

Closed
opentokix opened this issue Dec 20, 2024 · 10 comments
Closed

Victorialogs as a source for annotations #188

opentokix opened this issue Dec 20, 2024 · 10 comments
Labels
bug Something isn't working

Comments

@opentokix
Copy link

opentokix commented Dec 20, 2024

I am trying to use Victorialogs Datasource as a source for annotations. Using python and requests to send a POST object to the jsonlines endpoint. I get annotations to work, but I don't understand what I need to do to get tags to work and how to construct my object/query-params to get labels (other) to work. And also have been unable to find this in any documentation. (I can write that doc in a PR if I just get some details how this is intended to work).

I am using v0.13.2 of writing of this issue.

image

Here is the relevant python code for how I create the object.

    stream_fields = "stream,level,invoker,system,type_of"
    uri = f"{scheme}://{host}:{port}/insert/jsonline?_stream_fields={stream_fields}"  # noqa E501
    headers = {
        "Content-Type": "application/stream+json",
        "Authorization": f"Bearer {token}"
    }
    doc = {"level": "info",
           "invoker": invoker,
           "system": system,
           "stream": "annotations",
           "type": type_of,
           "_msg": message,
           "tags": tags if tags else [],
           }
    try:
        response = requests.post(uri, headers=headers, data=json.dumps(doc))

This is the annotation I have gotten to work so far:

image

It is the "Object object" I am wondering about.

@dmitryk-dk
Copy link
Contributor

@Loori-R could you take a look please?

@dmitryk-dk dmitryk-dk added the bug Something isn't working label Jan 15, 2025
@opentokix
Copy link
Author

Any progress on this?

@dmitryk-dk
Copy link
Contributor

Any progress on this?

Hi! Will try to check it today

@dmitryk-dk
Copy link
Contributor

dmitryk-dk commented Mar 7, 2025

Hi @opentokix ! Could you share, please, the message, invoker, system, type_of, tags variables?

UPD. no needed reproduced on my local

@dmitryk-dk
Copy link
Contributor

dmitryk-dk commented Mar 7, 2025

Hi @opentokix ! Would this solution work for you?

Image Image

I can make it more structured if object representation is not ok

@opentokix
Copy link
Author

opentokix commented Mar 8, 2025

I would like to have the mouse over more human readable.

Lets say I send in a object whith the info of username, version and tags or something like that.

I want the mouse over to have that info only. And not a json-string. But it should be customizable.

Think of it like you want to send an event from a argocd run or a ci/cd-system into the logsystem and then fetch this into a dashboard for the metrics of the application to know when the latest build is deployed.

@dmitryk-dk
Copy link
Contributor

I would like to have the mouse over more human readable.

Lets say I send in a object whith the info of username, version and tags or something like that.

I want the mouse over to have that info only. And not a json-string. But it should be customizable.

Think of it like you want to send an event from a argocd run or a ci/cd-system into the logsystem and then fetch this into a dashboard for the metrics of the application to know when the latest build is deployed.

Hi @opentokix ! Grafana has a limitation to render the content on the annotation side. (It can't render any tags and has css style like nowrap), so that all info will be in one line (I removed the object)

@opentokix
Copy link
Author

That is ok - amazing work, when is it going to get released, or is it already available?

@dmitryk-dk
Copy link
Contributor

That is ok - amazing work, when is it going to get released, or is it already available?

It is on review right now. Will be included in the next release if everything is ok on review

@dmitryk-dk
Copy link
Contributor

Hi @opentokix ! The issue was fixed in the v0.16.0 release. Feel free to reopen the issue if you find any problem

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

No branches or pull requests

2 participants