diff --git a/rfcs/text/0049-faas-memory.md b/rfcs/text/0049-faas-memory.md new file mode 100644 index 0000000000..e7f8ac0782 --- /dev/null +++ b/rfcs/text/0049-faas-memory.md @@ -0,0 +1,148 @@ +# 0049: FaaS Memory fields + + +- Stage: **1 Draft** +- Date: **TBD** + + + + + + + + + +## Fields + + +Add new fields: + +* `max_memory` - The maximum memory used during a function invocation, in bytes +* `memory_size` - The configured memory size for the function, in bytes + + + +## Usage + + +Adding FaaS memory fields will allow supporting metrics and logs with memory values in ECS. This is important because memory is used for billing in FaaS, and +can also have an impact on performance. + +These fields will allow tracking memory used and allocated for FaaS. Both are useful. `max_memory` will show the maximum memory used during an invocation. `memory_size` +will show the configured memory size for the function. + +## Source data + + + +With AWS Lamba, these values are available with CloudWatch logs. For example, +``` +2022-12-20T01:00:00.000-08:00 START RequestId: XXX Version: $LATEST +2022-12-20T01:00:02.500-08:00 END RequestId: XXX +2022-12-20T01:00:02.500-08:00 REPORT RequestId: XXX Duration: 3022.91 ms +Billed Duration: 3000 ms Memory Size: 512 MB Max Memory Used: 157 MB +``` + +Here `Memory Size: 512 MB` would be stored in `faas.memory_size`, `Max Memory Used: 157 MB` would be stored in `faas.max_memory`. + + + + + + +## Scope of impact + + + +## Concerns + + + + + + + +## People + +The following are the people that consulted on the contents of this RFC. + +* @mjwolf | author + + + + +## References + + + +AWS Lambda documentation on FaaS memory + +* https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtime-environment.html +* https://docs.aws.amazon.com/lambda/latest/dg/monitoring-observability.html +* https://docs.aws.amazon.com/lambda/latest/dg/computing-power.html + +GCP Cloud Run + +* https://cloud.google.com/functions/docs/concepts/overview +* https://cloud.google.com/functions/docs/configuring/memory +* https://cloud.google.com/functions/docs/monitoring/metrics + +Azure Functions + +* https://learn.microsoft.com/en-us/azure/azure-functions/ +* https://learn.microsoft.com/en-us/azure/azure-functions/monitor-functions-reference?tabs=flex-consumption-plan + + +### RFC Pull Requests + + + +* Stage 0: https://github.com/elastic/ecs/pull/NNN + + diff --git a/rfcs/text/0049/faas.yml b/rfcs/text/0049/faas.yml new file mode 100644 index 0000000000..78a9864ad9 --- /dev/null +++ b/rfcs/text/0049/faas.yml @@ -0,0 +1,17 @@ +--- +- name: faas + fields: + - name: max_memory + level: core + type: keyword + short: Maximum memory used during a function invocation. + description: > + The maximum amount of memory used during a function invocation, in bytes. + example: 127000000 + - name: memory_size + level: core + type: keyword + short: The configured memory limit for the function invocation. + description: > + The configured memory limit for the funtion invocation, in bytes. + example: 512000000