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

New conversion function for extracted labels #15337

Open
ash211 opened this issue Dec 10, 2024 · 1 comment
Open

New conversion function for extracted labels #15337

ash211 opened this issue Dec 10, 2024 · 1 comment

Comments

@ash211
Copy link

ash211 commented Dec 10, 2024

Is your feature request related to a problem? Please describe.
I have a log line with a field in ISO 8601 duration format (wikipedia). Example: PT26.481S. I'd like to parse this into a number of milliseconds for use in charting.

https://grafana.com/docs/loki/latest/query/metric_queries/#unwrapped-range-aggregations documents two parsing functions related to this:

  • duration_seconds (and synonym duration)
  • bytes

Neither of these supports this format.

Describe the solution you'd like
I'd like to propose another conversion function:

  • duration_millis_iso8601

This function takes as input a String in ISO 8601 duration format, and returns a numeric value representing the number of milliseconds in the duration. This is the same string->f64 signature as the other two functions.

Describe alternatives you've considered
I considered supplying my own conversion function, but from the above documentation about metric queries it doesn't seem that this plugin point is supported.

Thanks for consideration

@ash211
Copy link
Author

ash211 commented Dec 10, 2024

Possibly related: #2925

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

1 participant