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

Build a histogram of log counts. #15

Closed
turbotankist opened this issue Apr 3, 2024 · 11 comments
Closed

Build a histogram of log counts. #15

turbotankist opened this issue Apr 3, 2024 · 11 comments
Assignees
Labels
enhancement New feature or request

Comments

@turbotankist
Copy link

It would be very convenient to be able to build a time histogram to navigate through the logs.
But a grafana shows:
victorialogs-datasource. This datasource does not support full-range histograms. The graph below is based on the logs seen in the response
So it shows something, but not a full count of logs.
image

@dmitryk-dk dmitryk-dk added the enhancement New feature or request label Apr 3, 2024
@steverweber
Copy link

steverweber commented Apr 8, 2024

I assume https://docs.victoriametrics.com/victorialogs/roadmap/ will somewhat resolve this if or when some "Stats calculations" are done server side.

@grinapo
Copy link

grinapo commented May 16, 2024

I think #22 would help you too (and latest version of victorialogs).

@grinapo
Copy link

grinapo commented Jun 28, 2024

Now, let's get back here.
I have tried to generate some Time series based on logs:
severity:info | stats by (_time:1m) count() res | sort by (_time)
It results data in the form:

Time (stamp), Line(string), labels (dict)
2024-06-28 07:46:00, {"res":"5"}, { "res": "5" }
2024-06-28 07:47:00, {"res":"25"}, { "res": "25" }

but grafana would really like stamp+numeric result in a form of:
2024-06-28 07:46:00, 5, { "res": "5" }
instead.

There would be nice to have some example (provided it actually works) how to get time series data from VL.

@crocchietta
Copy link

I also tried unsuccessfully to use Time series based on logs.
It might be interesting to create a new pipe to reformat the results returned to grafana depending on what you are trying to do.

@crocchietta
Copy link

There is not too much reaction on this subject. Is this a feature we can hope for in a future release?
Or will it never be possible to generate time series from victorialogs datasource?

@Loori-R
Copy link
Contributor

Loori-R commented Jul 8, 2024

Hi @crocchietta, we plan to add this feature in the future, but the exact timelines are not yet determined.

@crocchietta
Copy link

Thank you for taking the time to respond.
Very happy with victoriametrics, I chose to continue with victorialogs rather than using Loki. But this feature is missing and seems important to me.
Victorialogs has already evolved a lot. So I'll wait.
A roadmap specific to victorialogs-datasource would be interesting.

Thank you to the team for the work done.

@tiny-pangolin
Copy link
Contributor

I have a workaround for visualizations you can use the extract fields and convert field type to work around this issue for now, but it doesn't work for explore and it requires extra steps for each panel which is not ideal.

image

@crocchietta
Copy link

@tiny-pangolin : thanks. I had already tried with extract fields but I missed the convert field type transformation at the grafana level.
Even though this adds steps in building a panel and requires a bit more computing power for the browser, it will allow me to wait for this feature to be added.

@Loori-R
Copy link
Contributor

Loori-R commented Dec 5, 2024

Starting from v0.8.0, victorialogs-datasource supports /select/logsql/stats_query and /select/logsql/stats_query_range endpoints, enabling Time series and other panel types.

We also plan to add support for /select/logsql/hits, which will allow displaying accurate histograms of log counts.

@dmitryk-dk
Copy link
Contributor

Hi! The feature was added in the new release. Please check it. If you find any issue, please reopen the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

8 participants