-
Notifications
You must be signed in to change notification settings - Fork 9
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: otel metrics for ingress #2310
Conversation
safeer
commented
Aug 9, 2024
•
edited
Loading
edited
const ( | ||
ingressMeterName = "ftl.ingress" | ||
ingressMethodAttr = "ftl.ingress.method" | ||
ingressPathAttr = "ftl.ingress.path" |
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'm curious if this is too high of a cardinality to log
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.
Depending on what info is contained in the paths, we could potentially chop the path and keep just the top level prefix, or otherwise parse out only the data that we find useful
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.
Oh huh if the path is just the module name, I guess it doesn't even matter if we do anything special here, because it won't add any cardinality beyond the verb ref. We can just leave this as is - it's probably easiest to understand this way
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.
The path is entirely user defined, i.e. //ftl:ingress GET /http/echo
-> https://<domain:port>/http/echo
But you're right it's equivalent to adding a verb ref, and it's pretty usefull; I'll leave it in.
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.
Ahh got it, that makes sense. Sounds good!
``` InstrumentationScope ftl.ingress Metric #0 Descriptor: -> Name: ftl.ingress.requests -> Description: the number of ingress requests that the FTL controller receives -> Unit: 1 -> DataType: Sum -> IsMonotonic: true -> AggregationTemporality: Cumulative NumberDataPoints #0 Data point attributes: -> ftl.ingress.method: Str(GET) -> ftl.ingress.path: Str(/http/echo) -> ftl.ingress.run_time_ms.bucket: Str([16,32)) -> ftl.ingress.verb.ref: Str(echo.getEcho) -> ftl.module.name: Str(echo) StartTimestamp: 2024-08-12 17:44:51.923107 +0000 UTC Timestamp: 2024-08-12 17:45:26.923594 +0000 UTC Value: 1 Metric #1 Descriptor: -> Name: ftl.ingress.ms_to_complete -> Description: duration in ms to complete an ingress request -> Unit: ms -> DataType: Histogram -> AggregationTemporality: Cumulative HistogramDataPoints #0 Data point attributes: -> ftl.ingress.method: Str(GET) -> ftl.ingress.path: Str(/http/echo) -> ftl.ingress.verb.ref: Str(echo.getEcho) -> ftl.module.name: Str(echo) StartTimestamp: 2024-08-12 17:44:51.92311 +0000 UTC Timestamp: 2024-08-12 17:45:26.923622 +0000 UTC Count: 1 Sum: 27.000000 Min: 27.000000 Max: 27.000000 ``` --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>