You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: Generate psedurandom execution id if Function-Execution-Id is not provided; Update README with examples (#260)
* fix: Generate psedurandom execution id if Function-Execution-Id is missing; Update README with exeamples to generate execution Id
* Update README.md to address comments
Copy file name to clipboardExpand all lines: README.md
+51Lines changed: 51 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -133,6 +133,57 @@ handling logic.
133
133
curl localhost:8080
134
134
# Output: Hello, World!
135
135
```
136
+
## Quickstart: Enable Exeuction Id Logging
137
+
138
+
[Cloud Run Functions(1st gen)](https://cloud.google.com/functions/1stgendocs/deploy) provides an execution id in the logs at `labels.execution_id`, which customers can use to filter their logs for each execution. [Cloud Run Functions](https://cloud.google.com/functions/docs/deploy) doesn't have the same feature embedded.
139
+
140
+
To have exeuction id logged for `Cloud Run Functions` executions, users can either:
141
+
142
+
* Provide a custom execution Id in the Http Header `Function-Execution-Id`.
{"message":"Try logging with executionID!","logging.googleapis.com/labels":{"execution_id":"123456"}}
152
+
```
153
+
154
+
155
+
OR
156
+
* Leverage `LogWriter` provided in function-framework-go(v1.9.0 or higher) library to generate logs. If `Function-Exeuction-Id` is empty, a pseduorandom execution id will be auto-generated if `LogWriter` is used.
0 commit comments