You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by ch...@apache.org on 2019/08/26 05:29:11 UTC

[openwhisk] branch master updated: Pass transactionId to action container (#4586)

This is an automated email from the ASF dual-hosted git repository.

chetanm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openwhisk.git


The following commit(s) were added to refs/heads/master by this push:
     new d85a722  Pass transactionId to action container (#4586)
d85a722 is described below

commit d85a722b66980af8e7dd9a3d61918020ba45bcea
Author: Chetan Mehrotra <ch...@apache.org>
AuthorDate: Mon Aug 26 10:59:05 2019 +0530

    Pass transactionId to action container (#4586)
    
    Passes current transactionId to action `/run` call. This would enable tracing the activations originating from same transaction (like in sequence or composition) in any third party tracing system.
---
 .../scala/org/apache/openwhisk/core/containerpool/ContainerProxy.scala  | 1 +
 docs/actions-new.md                                                     | 2 ++
 .../apache/openwhisk/core/containerpool/test/ContainerProxyTests.scala  | 1 +
 3 files changed, 4 insertions(+)

diff --git a/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/ContainerProxy.scala b/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/ContainerProxy.scala
index 445c2b3..97f225e 100644
--- a/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/ContainerProxy.scala
+++ b/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/ContainerProxy.scala
@@ -572,6 +572,7 @@ class ContainerProxy(
           "namespace" -> job.msg.user.namespace.name.toJson,
           "action_name" -> job.msg.action.qualifiedNameWithLeadingSlash.toJson,
           "activation_id" -> job.msg.activationId.toString.toJson,
+          "transaction_id" -> job.msg.transid.id.toJson,
           // compute deadline on invoker side avoids discrepancies inside container
           // but potentially under-estimates actual deadline
           "deadline" -> (Instant.now.toEpochMilli + actionTimeout.toMillis).toString.toJson)
diff --git a/docs/actions-new.md b/docs/actions-new.md
index d6c857e..f4be309 100644
--- a/docs/actions-new.md
+++ b/docs/actions-new.md
@@ -199,6 +199,7 @@ platform follows the following schema:
   "api_host": String,
   "api_key": String,
   "activation_id": String,
+  "transaction_id": String,
   "deadline": Number
 }
 ```
@@ -207,6 +208,7 @@ platform follows the following schema:
 * `namespace` is the OpenWhisk namespace for the action (e.g., `whisk.system`).
 * `action_name` is the [fully qualified name](reference.md#fully-qualified-names) of the action.
 * `activation_id` is a unique ID for this activation.
+* `transaction_id` is a unique ID for the request of which this activation is part of.
 * `deadline` is the deadline for the function.
 * `api_key` is the API key used to invoke the action.
 
diff --git a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/test/ContainerProxyTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/test/ContainerProxyTests.scala
index fdc3290..7e6f9e4 100644
--- a/tests/src/test/scala/org/apache/openwhisk/core/containerpool/test/ContainerProxyTests.scala
+++ b/tests/src/test/scala/org/apache/openwhisk/core/containerpool/test/ContainerProxyTests.scala
@@ -1189,6 +1189,7 @@ class ContainerProxyTests
       environment.fields("namespace") shouldBe invocationNamespace.name.toJson
       environment.fields("action_name") shouldBe message.action.qualifiedNameWithLeadingSlash.toJson
       environment.fields("activation_id") shouldBe message.activationId.toJson
+      environment.fields("transaction_id") shouldBe transid.id.toJson
       val authEnvironment = environment.fields.filterKeys(message.user.authkey.toEnvironment.fields.contains)
       if (apiKeyMustBePresent) {
         message.user.authkey.toEnvironment shouldBe authEnvironment.toJson.asJsObject