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

Open
opentokix opened this issue Dec 20, 2024 · 1 comment
Open

Victorialogs as a source for annotations #188

opentokix opened this issue Dec 20, 2024 · 1 comment
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
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