-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: add an observability operator #1018
base: main
Are you sure you want to change the base?
Conversation
secondsStr := strconv.FormatFloat(totalSeconds, 'f', -1, 64) | ||
builder.WriteString(fmt.Sprintf("%sS", secondsStr)) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am kinda curious about the edge case of zero duration for Prometheus inputs. Specifically, cases like "0s", "0m", or an empty string. Shouldn't this ideally be parsed as zero duration, resulting in the ISO 8601 representation of PT0S
? 🤔
In code it would look like this:
if isoDuration == "P" {
isoDuration = "PT0S"
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specifically, cases like "0s", "0m", or an empty string
The first 2 don't make sense in the context of promQL, but we can definitely add them to the tests.
{"1ms", "PT0.001S"}, | ||
{"1000ms", "PT1S"}, | ||
{"1y2w3d4h5m6s", "P1Y2W3DT4H5M6S"}, | ||
{"1y2w3d4h5m6s7ms", "P1Y2W3DT4H5M6.007S"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding this: https://github.com/Altinn/altinn-platform/pull/1018/files#r1812522355
Also another test case may need to get added here:
{"0", "PT0S"},
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Go ahead, you can just add them. See what happens in those tests.
Description
Related Issue(s)
Verification
Documentation