title: How to get execution ID for Google Cloud Functions triggered from HTTP?
body: <p>I am trying to write logs to Logging from Python applications by using Cloud Logging API Cloud client library with  &quot;execution ID&quot; that as same as google's default value.</p>
  <p><a href="https://i.stack.imgur.com/R8ueA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/R8ueA.png" alt="enter image description here" /></a></p>
  <p><strong>logger setup:</strong></p>
  <pre><code>from google.cloud import logging
  from google.cloud.logging.resource import Resource
  
  
  log_client = logging.Client()
  
  # This is the resource type of the log
  log_name = 'cloudfunctions.googleapis.com%2Fcloud-functions'
  
  # Inside the resource, nest the required labels specific to the resource type
  res = Resource(type=&quot;cloud_function&quot;,
                 labels={
                     &quot;function_name&quot;: &quot;my-function&quot;,
                     &quot;region&quot;: &quot;asia-east2&quot;
                 })
  logger = log_client.logger(log_name.format(&quot;my-project&quot;))
  </code></pre>
  <p><strong>write log:</strong></p>
  <pre><code>logger.log_struct({&quot;message&quot;: request.remote_addr}, resource=res, severity='INFO')
  </code></pre>