summaryrefslogtreecommitdiffstats
path: root/src/fluent-bit/tests/runtime/data/stackdriver
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-05 12:08:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-05 12:08:18 +0000
commit5da14042f70711ea5cf66e034699730335462f66 (patch)
tree0f6354ccac934ed87a2d555f45be4c831cf92f4a /src/fluent-bit/tests/runtime/data/stackdriver
parentReleasing debian version 1.44.3-2. (diff)
downloadnetdata-5da14042f70711ea5cf66e034699730335462f66.tar.xz
netdata-5da14042f70711ea5cf66e034699730335462f66.zip
Merging upstream version 1.45.3+dfsg.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/fluent-bit/tests/runtime/data/stackdriver')
-rwxr-xr-xsrc/fluent-bit/tests/runtime/data/stackdriver/json.h12
-rw-r--r--src/fluent-bit/tests/runtime/data/stackdriver/stackdriver-credentials.json12
-rw-r--r--src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_multi_entries_severity.log4
-rw-r--r--src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_test_http_request.h134
-rw-r--r--src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_test_insert_id.h26
-rw-r--r--src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_test_k8s_resource.h89
-rw-r--r--src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_test_labels.h44
-rw-r--r--src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_test_log_name.h10
-rw-r--r--src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_test_monitored_resource.h46
-rw-r--r--src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_test_operation.h62
-rw-r--r--src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_test_resource_labels.h37
-rw-r--r--src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_test_source_location.h70
-rw-r--r--src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_test_span_id.h6
-rw-r--r--src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_test_timestamp.h62
-rw-r--r--src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_test_trace.h6
-rw-r--r--src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_test_trace_sampled.h11
16 files changed, 631 insertions, 0 deletions
diff --git a/src/fluent-bit/tests/runtime/data/stackdriver/json.h b/src/fluent-bit/tests/runtime/data/stackdriver/json.h
new file mode 100755
index 000000000..146dd5324
--- /dev/null
+++ b/src/fluent-bit/tests/runtime/data/stackdriver/json.h
@@ -0,0 +1,12 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+
+#define JSON "[" \
+ "1448403340," \
+ "{" \
+ "\"key_0\": false," \
+ "\"key_1\": true," \
+ "\"key_2\": \"some string\"," \
+ "\"key_3\": 0.12345678," \
+ "\"key.4\": 5000," \
+ "\"END_KEY\": \"JSON_END\"" \
+ "}]"
diff --git a/src/fluent-bit/tests/runtime/data/stackdriver/stackdriver-credentials.json b/src/fluent-bit/tests/runtime/data/stackdriver/stackdriver-credentials.json
new file mode 100644
index 000000000..1ea8afd92
--- /dev/null
+++ b/src/fluent-bit/tests/runtime/data/stackdriver/stackdriver-credentials.json
@@ -0,0 +1,12 @@
+{
+ "type": "service_account",
+ "project_id": "fluent-bit",
+ "private_key_id": "837364849384b143e4e21243a2cbcbd26f4fabcdfe",
+ "private_key": "-----BEGIN PRIVATE KEY-----\nasldjkasdjksa98327498327498327489qajdsijasdjlksajdlksajdlks7+TK\n-----END PRIVATE KEY-----\n",
+ "client_email": "stackdriver@fluent-bit.iam.gserviceaccount.com",
+ "client_id": "0123456789",
+ "auth_uri": "https://accounts.google.com/o/oauth2/auth",
+ "token_uri": "https://accounts.google.com/o/oauth2/token",
+ "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
+ "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/stackdriver%40fluent-bit.iam.gserviceaccount.com"
+}
diff --git a/src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_multi_entries_severity.log b/src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_multi_entries_severity.log
new file mode 100644
index 000000000..157cbea64
--- /dev/null
+++ b/src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_multi_entries_severity.log
@@ -0,0 +1,4 @@
+{"message":"test severity1", "severity":"INFO"}
+{"message":"test severity2"}
+{"message":"test severity3", "severity":"DEBUG"}
+{"message":"test severity4"}
diff --git a/src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_test_http_request.h b/src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_test_http_request.h
new file mode 100644
index 000000000..2b7ad82d3
--- /dev/null
+++ b/src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_test_http_request.h
@@ -0,0 +1,134 @@
+#define HTTPREQUEST_COMMON_CASE "[" \
+ "1591111124," \
+ "{" \
+ "\"logging.googleapis.com/http_request\": " \
+ "{" \
+ "\"requestMethod\": \"test_requestMethod\"," \
+ "\"requestUrl\": \"test_requestUrl\"," \
+ "\"userAgent\": \"test_userAgent\"," \
+ "\"remoteIp\": \"test_remoteIp\"," \
+ "\"serverIp\": \"test_serverIp\"," \
+ "\"referer\": \"test_referer\"," \
+ "\"latency\": \"0s\"," \
+ "\"protocol\": \"test_protocol\"," \
+ "\"requestSize\": 123," \
+ "\"responseSize\": 123," \
+ "\"status\": 200," \
+ "\"cacheFillBytes\": 123," \
+ "\"cacheLookup\": true," \
+ "\"cacheHit\": true," \
+ "\"cacheValidatedWithOriginServer\": true" \
+ "}" \
+ "}]"
+
+#define EMPTY_HTTPREQUEST "[" \
+ "1591111124," \
+ "{" \
+ "\"logging.googleapis.com/http_request\": " \
+ "{" \
+ "}" \
+ "}]"
+
+#define HTTPREQUEST_IN_STRING "[" \
+ "1591111124," \
+ "{" \
+ "\"logging.googleapis.com/http_request\": \"some string\"" \
+ "}]"
+
+#define PARTIAL_HTTPREQUEST "[" \
+ "1591111124," \
+ "{" \
+ "\"logging.googleapis.com/http_request\": " \
+ "{" \
+ "\"cacheLookup\": true," \
+ "\"cacheHit\": true," \
+ "\"cacheValidatedWithOriginServer\": true" \
+ "}" \
+ "}]"
+
+#define HTTPREQUEST_SUBFIELDS_IN_INCORRECT_TYPE "[" \
+ "1591111124," \
+ "{" \
+ "\"logging.googleapis.com/http_request\": " \
+ "{" \
+ "\"requestMethod\": 123," \
+ "\"requestUrl\": 123," \
+ "\"userAgent\": 123," \
+ "\"remoteIp\": 123," \
+ "\"serverIp\": true," \
+ "\"referer\": true," \
+ "\"latency\": false," \
+ "\"protocol\": false," \
+ "\"requestSize\": \"some string\"," \
+ "\"responseSize\": true," \
+ "\"status\": false," \
+ "\"cacheFillBytes\": false," \
+ "\"cacheLookup\": \"some string\"," \
+ "\"cacheHit\": 123," \
+ "\"cacheValidatedWithOriginServer\": 123" \
+ "}" \
+ "}]"
+
+#define HTTPREQUEST_EXTRA_SUBFIELDS_EXISTED "[" \
+ "1591111124," \
+ "{" \
+ "\"logging.googleapis.com/http_request\": " \
+ "{" \
+ "\"requestMethod\": \"test_requestMethod\"," \
+ "\"requestUrl\": \"test_requestUrl\"," \
+ "\"userAgent\": \"test_userAgent\"," \
+ "\"remoteIp\": \"test_remoteIp\"," \
+ "\"serverIp\": \"test_serverIp\"," \
+ "\"referer\": \"test_referer\"," \
+ "\"latency\": \"0s\"," \
+ "\"protocol\": \"test_protocol\"," \
+ "\"requestSize\": 123," \
+ "\"responseSize\": 123," \
+ "\"status\": 200," \
+ "\"cacheFillBytes\": 123," \
+ "\"cacheLookup\": true," \
+ "\"cacheHit\": true," \
+ "\"cacheValidatedWithOriginServer\": true," \
+ "\"extra_key1\": \"extra_val1\"," \
+ "\"extra_key2\": 123," \
+ "\"extra_key3\": true" \
+ "}" \
+ "}]"
+
+
+/* Tests for 'latency' */
+#define HTTPREQUEST_LATENCY_COMMON_CASE "[" \
+ "1591111124," \
+ "{" \
+ "\"logging.googleapis.com/http_request\": " \
+ "{" \
+ "\"latency\": \" 100.00 s \"" \
+ "}" \
+ "}]"
+
+#define HTTPREQUEST_LATENCY_INVALID_SPACES "[" \
+ "1591111124," \
+ "{" \
+ "\"logging.googleapis.com/http_request\": " \
+ "{" \
+ "\"latency\": \" 100. 00 s \"" \
+ "}" \
+ "}]"
+
+#define HTTPREQUEST_LATENCY_INVALID_STRING "[" \
+ "1591111124," \
+ "{" \
+ "\"logging.googleapis.com/http_request\": " \
+ "{" \
+ "\"latency\": \" s100.00 s \"" \
+ "}" \
+ "}]"
+
+#define HTTPREQUEST_LATENCY_INVALID_END "[" \
+ "1591111124," \
+ "{" \
+ "\"logging.googleapis.com/http_request\": " \
+ "{" \
+ "\"latency\": \" 100.00 \"" \
+ "}" \
+ "}]"
diff --git a/src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_test_insert_id.h b/src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_test_insert_id.h
new file mode 100644
index 000000000..9cdf3f545
--- /dev/null
+++ b/src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_test_insert_id.h
@@ -0,0 +1,26 @@
+
+#define INSERTID_COMMON_CASE "[" \
+ "1591111124," \
+ "{" \
+ "\"logging.googleapis.com/insertId\": \"test_insertId\" " \
+ "}]"
+
+#define EMPTY_INSERTID "[" \
+ "1591111124," \
+ "{" \
+ "\"logging.googleapis.com/insertId\": \"\" " \
+ "}]"
+
+#define INSERTID_INCORRECT_TYPE_INT "[" \
+ "1591111124," \
+ "{" \
+ "\"logging.googleapis.com/insertId\": 123 " \
+ "}]"
+
+#define INSERTID_INCORRECT_TYPE_MAP "[" \
+ "1591111124," \
+ "{" \
+ "\"logging.googleapis.com/insertId\": " \
+ "{" \
+ "}" \
+ "}]"
diff --git a/src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_test_k8s_resource.h b/src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_test_k8s_resource.h
new file mode 100644
index 000000000..9fe1604a9
--- /dev/null
+++ b/src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_test_k8s_resource.h
@@ -0,0 +1,89 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+
+/* k8s_container */
+#define K8S_CONTAINER_COMMON "[" \
+ "1591649196," \
+ "{" \
+ "\"message\": \"K8S_CONTAINER_COMMON\"," \
+ "\"logging.googleapis.com/local_resource_id\": \"k8s_container.testnamespace.testpod.testctr\"" \
+ "}]"
+
+#define K8S_CONTAINER_COMMON_DIFF_TAGS "[" \
+ "1591649196," \
+ "{" \
+ "\"message\": \"K8S_CONTAINER_COMMON\"," \
+ "\"logging.googleapis.com/local_resource_id\": \"k8s_container.diffnamespace.diffpod.diffctr\"" \
+ "}]"
+
+#define K8S_CONTAINER_NO_LOCAL_RESOURCE_ID "[" \
+ "1591649196," \
+ "{" \
+ "\"message\": \"K8S_CONTAINER_COMMON_NO_LOCAL_RESOURCE_ID\"" \
+ "}]"
+
+/* k8s_node */
+#define K8S_NODE_COMMON "[" \
+ "1591649196," \
+ "{" \
+ "\"message\": \"K8S_NODE_COMMON\"," \
+ "\"logging.googleapis.com/local_resource_id\": \"k8s_node.testnode\"," \
+ "\"PRIORITY\": 6," \
+ "\"SYSLOG_FACILITY\": 3," \
+ "\"_CAP_EFFECTIVE\": \"3fffffffff\"," \
+ "\"_PID\": 1387," \
+ "\"_SYSTEMD_UNIT\": \"docker.service\"," \
+ "\"END_KEY\": \"JSON_END\"" \
+ "}]"
+
+#define K8S_NODE_NO_LOCAL_RESOURCE_ID "[" \
+ "1591649196," \
+ "{" \
+ "\"message\": \"K8S_NODE_NO_LOCAL_RESOURCE_ID\"," \
+ "\"PRIORITY\": 6," \
+ "\"SYSLOG_FACILITY\": 3," \
+ "\"_CAP_EFFECTIVE\": \"3fffffffff\"," \
+ "\"_PID\": 1387," \
+ "\"_SYSTEMD_UNIT\": \"docker.service\"," \
+ "\"END_KEY\": \"JSON_END\"" \
+ "}]"
+
+#define K8S_NODE_LOCAL_RESOURCE_ID_WITH_DOT "[" \
+ "1591649196," \
+ "{" \
+ "\"message\": \"K8S_NODE_LOCAL_RESOURCE_ID_WITH_DOT\"," \
+ "\"logging.googleapis.com/local_resource_id\": \"k8s_node.testnode.withdot.dot\"," \
+ "\"PRIORITY\": 6," \
+ "\"SYSLOG_FACILITY\": 3," \
+ "\"_CAP_EFFECTIVE\": \"3fffffffff\"," \
+ "\"_PID\": 1387," \
+ "\"_SYSTEMD_UNIT\": \"docker.service\"," \
+ "\"END_KEY\": \"JSON_END\"" \
+ "}]"
+
+/* k8s_pod */
+#define K8S_POD_COMMON "[" \
+ "1591649196," \
+ "{" \
+ "\"message\": \"K8S_POD_COMMON\"," \
+ "\"logging.googleapis.com/local_resource_id\": \"k8s_pod.testnamespace.testpod\"," \
+ "\"key_0\": false," \
+ "\"key_1\": true," \
+ "\"key_2\": \"some string\"," \
+ "\"key_3\": 0.12345678," \
+ "\"key_4\": 5000," \
+ "\"END_KEY\": \"JSON_END\"" \
+ "}]"
+
+#define K8S_POD_NO_LOCAL_RESOURCE_ID "[" \
+ "1591649196," \
+ "{" \
+ "\"message\": \"K8S_POD_NO_LOCAL_RESOURCE_ID\"," \
+ "\"key_0\": false," \
+ "\"key_1\": true," \
+ "\"key_2\": \"some string\"," \
+ "\"key_3\": 0.12345678," \
+ "\"key_4\": 5000," \
+ "\"END_KEY\": \"JSON_END\"" \
+ "}]"
+
+ \ No newline at end of file
diff --git a/src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_test_labels.h b/src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_test_labels.h
new file mode 100644
index 000000000..ec3d80b3a
--- /dev/null
+++ b/src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_test_labels.h
@@ -0,0 +1,44 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+
+#define DEFAULT_LABELS "[" \
+ "1591649196," \
+ "{" \
+ "\"logging.googleapis.com/labels\": " \
+ "{" \
+ "\"testA\": \"valA\"," \
+ "\"testB\": \"valB\"" \
+ "}" \
+ "}]"
+
+#define CUSTOM_LABELS "[" \
+ "1591649196," \
+ "{" \
+ "\"logging.googleapis.com/customlabels\": " \
+ "{" \
+ "\"testA\": \"valA\"," \
+ "\"testB\": \"valB\"" \
+ "}" \
+ "}]"
+
+#define DEFAULT_LABELS_K8S_RESOURCE_TYPE "[" \
+ "1591649196," \
+ "{" \
+ "\"logging.googleapis.com/local_resource_id\": \"k8s_container.testnamespace.testpod.testctr\"," \
+ "\"logging.googleapis.com/labels\": " \
+ "{" \
+ "\"testA\": \"valA\"," \
+ "\"testB\": \"valB\"" \
+ "}" \
+ "}]"
+
+#define CUSTOM_LABELS_K8S_RESOURCE_TYPE "[" \
+ "1591649196," \
+ "{" \
+ "\"logging.googleapis.com/local_resource_id\": \"k8s_container.testnamespace.testpod.testctr\"," \
+ "\"logging.googleapis.com/customlabels\": " \
+ "{" \
+ "\"testA\": \"valA\"," \
+ "\"testB\": \"valB\"" \
+ "}" \
+ "}]"
+
diff --git a/src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_test_log_name.h b/src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_test_log_name.h
new file mode 100644
index 000000000..4d39e242e
--- /dev/null
+++ b/src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_test_log_name.h
@@ -0,0 +1,10 @@
+#define LOG_NAME_OVERRIDE "[" \
+ "1591111124," \
+ "{" \
+ "\"custom_log_name_key\": \"custom_log_name\"" \
+ "}]"
+
+#define LOG_NAME_NO_OVERRIDE "[" \
+ "1591111124," \
+ "{" \
+ "}]"
diff --git a/src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_test_monitored_resource.h b/src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_test_monitored_resource.h
new file mode 100644
index 000000000..d18749287
--- /dev/null
+++ b/src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_test_monitored_resource.h
@@ -0,0 +1,46 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+#define MONITORED_RESOURCE_COMMON_CASE "[" \
+ "1591649196," \
+ "{" \
+ "\"logging.googleapis.com/monitored_resource\": " \
+ "{" \
+ "\"labels\": " \
+ "{" \
+ "\"project_id\": \"monitored_resource_project_id\"," \
+ "\"location\": \"monitored_resource_location\"," \
+ "\"testA\": \"valA\"" \
+ "}" \
+ "}" \
+ "}]"
+
+#define MONITORED_RESOURCE_PRIORITY_HIGHER_THAN_LOCAL_RESOURCE_ID "[" \
+ "1591649196," \
+ "{" \
+ "\"logging.googleapis.com/monitored_resource\": " \
+ "{" \
+ "\"labels\": " \
+ "{" \
+ "\"project_id\": \"monitored_resource_project_id\"," \
+ "\"location\": \"monitored_resource_location\"," \
+ "\"cluster_name\": \"monitored_resource_cluster_name\"," \
+ "\"namespace_name\": \"monitored_resource_namespace_name\"," \
+ "\"pod_name\": \"monitored_resource_pod_name\"," \
+ "\"container_name\": \"monitored_resource_container_name\"" \
+ "}" \
+ "}," \
+ "\"logging.googleapis.com/local_resource_id\": \"k8s_container.testnamespace.testpod.testctr\"" \
+ "}]"
+
+#define MONITORED_RESOURCE_PRIORITY_HIGHER_THAN_GCE_INSTANCE "[" \
+ "1448403340," \
+ "{" \
+ "\"logging.googleapis.com/monitored_resource\": " \
+ "{" \
+ "\"labels\": " \
+ "{" \
+ "\"project_id\": \"monitored_resource_project_id\"," \
+ "\"zone\": \"monitored_resource_zone\"," \
+ "\"instance_id\": \"monitored_resource_instance_id\"" \
+ "}" \
+ "}" \
+ "}]"
diff --git a/src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_test_operation.h b/src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_test_operation.h
new file mode 100644
index 000000000..b3af37225
--- /dev/null
+++ b/src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_test_operation.h
@@ -0,0 +1,62 @@
+#define OPERATION_COMMON_CASE "[" \
+ "1591111124," \
+ "{" \
+ "\"logging.googleapis.com/operation\": " \
+ "{" \
+ "\"id\": \"test_id\"," \
+ "\"producer\": \"test_producer\"," \
+ "\"first\": true," \
+ "\"last\": true" \
+ "}" \
+ "}]"
+
+#define EMPTY_OPERATION "[" \
+ "1591111124," \
+ "{" \
+ "\"logging.googleapis.com/operation\": " \
+ "{" \
+ "}" \
+ "}]"
+
+#define OPERATION_IN_STRING "[" \
+ "1591111124," \
+ "{" \
+ "\"logging.googleapis.com/operation\": \"some string\"" \
+ "}]"
+
+#define PARTIAL_SUBFIELDS "[" \
+ "1591111124," \
+ "{" \
+ "\"logging.googleapis.com/operation\": " \
+ "{" \
+ "\"first\": false," \
+ "\"last\": false" \
+ "}" \
+ "}]"
+
+#define SUBFIELDS_IN_INCORRECT_TYPE "[" \
+ "1591111124," \
+ "{" \
+ "\"logging.googleapis.com/operation\": " \
+ "{" \
+ "\"id\": 123," \
+ "\"producer\": true," \
+ "\"first\": \"some string\"," \
+ "\"last\": 123" \
+ "}" \
+ "}]"
+
+#define EXTRA_SUBFIELDS_EXISTED "[" \
+ "1591111124," \
+ "{" \
+ "\"logging.googleapis.com/operation\": " \
+ "{" \
+ "\"id\": \"test_id\"," \
+ "\"producer\": \"test_producer\"," \
+ "\"first\": true," \
+ "\"last\": true," \
+ "\"extra_key1\": \"extra_val1\"," \
+ "\"extra_key2\": 123," \
+ "\"extra_key3\": true" \
+ "}" \
+ "}]"
diff --git a/src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_test_resource_labels.h b/src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_test_resource_labels.h
new file mode 100644
index 000000000..a65a47140
--- /dev/null
+++ b/src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_test_resource_labels.h
@@ -0,0 +1,37 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+
+#define ONE_FIELD "[" \
+ "1591649196," \
+ "{" \
+ "\"keyA\": \"valA\"" \
+ "}]"
+
+#define MULTIPLE_FIELDS "[" \
+ "1591649196," \
+ "{" \
+ "\"keyA\": \"valA\"," \
+ "\"keyB\": \"valB\"" \
+ "}]"
+
+#define NESTED_FIELDS "[" \
+ "1591649196," \
+ "{" \
+ "\"toplevel\": " \
+ "{" \
+ "\"keyA\": \"valA\"," \
+ "\"keyB\": \"valB\"" \
+ "}" \
+ "}]"
+
+#define LAYERED_NESTED_FIELDS "[" \
+ "1591649196," \
+ "{" \
+ "\"toplevel\": " \
+ "{" \
+ "\"midlevel\": " \
+ "{" \
+ "\"keyA\": \"valA\"" \
+ "}," \
+ "\"keyB\": \"valB\"" \
+ "}" \
+ "}]"
diff --git a/src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_test_source_location.h b/src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_test_source_location.h
new file mode 100644
index 000000000..0bf419f5a
--- /dev/null
+++ b/src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_test_source_location.h
@@ -0,0 +1,70 @@
+#define SOURCELOCATION_COMMON_CASE "[" \
+ "1591111124," \
+ "{" \
+ "\"logging.googleapis.com/sourceLocation\": " \
+ "{" \
+ "\"file\": \"test_file\"," \
+ "\"line\": 123," \
+ "\"function\": \"test_function\"" \
+ "}" \
+ "}]"
+
+#define SOURCELOCATION_COMMON_CASE_LINE_IN_STRING "[" \
+ "1591111124," \
+ "{" \
+ "\"logging.googleapis.com/sourceLocation\": " \
+ "{" \
+ "\"file\": \"test_file\"," \
+ "\"line\": \"123\"," \
+ "\"function\": \"test_function\"" \
+ "}" \
+ "}]"
+
+#define EMPTY_SOURCELOCATION "[" \
+ "1591111124," \
+ "{" \
+ "\"logging.googleapis.com/sourceLocation\": " \
+ "{" \
+ "}" \
+ "}]"
+
+#define SOURCELOCATION_IN_STRING "[" \
+ "1591111124," \
+ "{" \
+ "\"logging.googleapis.com/sourceLocation\": \"some string\"" \
+ "}]"
+
+#define PARTIAL_SOURCELOCATION "[" \
+ "1591111124," \
+ "{" \
+ "\"logging.googleapis.com/sourceLocation\": " \
+ "{" \
+ "\"function\": \"test_function\"" \
+ "}" \
+ "}]"
+
+#define SOURCELOCATION_SUBFIELDS_IN_INCORRECT_TYPE "[" \
+ "1591111124," \
+ "{" \
+ "\"logging.googleapis.com/sourceLocation\": " \
+ "{" \
+ "\"file\": 123," \
+ "\"line\": \"some string\"," \
+ "\"function\": true" \
+ "}" \
+ "}]"
+
+#define SOURCELOCATION_EXTRA_SUBFIELDS_EXISTED "[" \
+ "1591111124," \
+ "{" \
+ "\"logging.googleapis.com/sourceLocation\": " \
+ "{" \
+ "\"file\": \"test_file\"," \
+ "\"line\": 123," \
+ "\"function\": \"test_function\"," \
+ "\"extra_key1\": \"extra_val1\"," \
+ "\"extra_key2\": 123," \
+ "\"extra_key3\": true" \
+ "}" \
+ "}]"
+ \ No newline at end of file
diff --git a/src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_test_span_id.h b/src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_test_span_id.h
new file mode 100644
index 000000000..5b7b823e2
--- /dev/null
+++ b/src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_test_span_id.h
@@ -0,0 +1,6 @@
+#define SPAN_ID_COMMON_CASE "[" \
+ "1591111124," \
+ "{" \
+ "\"logging.googleapis.com/spanId\": \"000000000000004a\"" \
+ "}]"
+ \ No newline at end of file
diff --git a/src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_test_timestamp.h b/src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_test_timestamp.h
new file mode 100644
index 000000000..f80cc37d6
--- /dev/null
+++ b/src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_test_timestamp.h
@@ -0,0 +1,62 @@
+/* timestamp after parsing: 2020-07-21T16:40:42.000012345Z */
+#define TIMESTAMP_FORMAT_OBJECT_COMMON_CASE "[" \
+ "1591111124," \
+ "{" \
+ "\"timestamp\": " \
+ "{" \
+ "\"seconds\": \"1595349642\"," \
+ "\"nanos\": \"12345\"" \
+ "}" \
+ "}]"
+
+/* "1595349600" in RFC3339 format: 2020-07-21T16:40:00Z */
+#define TIMESTAMP_FORMAT_OBJECT_NOT_A_MAP "[" \
+ "1595349600," \
+ "{" \
+ "\"timestamp\": \"string\"" \
+ "}]"
+
+/* "1595349600" in RFC3339 format: 2020-07-21T16:40:00Z */
+#define TIMESTAMP_FORMAT_OBJECT_MISSING_SUBFIELD "[" \
+ "1595349600," \
+ "{" \
+ "\"timestamp\": " \
+ "{" \
+ "\"nanos\": \"12345\"" \
+ "}" \
+ "}]"
+
+/* "1595349600" in RFC3339 format: 2020-07-21T16:40:00Z */
+#define TIMESTAMP_FORMAT_OBJECT_INCORRECT_TYPE_SUBFIELDS "[" \
+ "1595349600," \
+ "{" \
+ "\"timestamp\": " \
+ "{" \
+ "\"seconds\": \"string\"," \
+ "\"nanos\": true" \
+ "}" \
+ "}]"
+
+
+/* timestamp after parsing: 2020-07-21T16:40:42.000012345Z */
+#define TIMESTAMP_FORMAT_DUO_FIELDS_COMMON_CASE "[" \
+ "1595349600," \
+ "{" \
+ "\"timestampSeconds\": \"1595349642\"," \
+ "\"timestampNanos\": \"12345\"" \
+ "}]"
+
+/* "1595349600" in RFC3339 format: 2020-07-21T16:40:00Z */
+#define TIMESTAMP_FORMAT_DUO_FIELDS_MISSING_NANOS "[" \
+ "1595349600," \
+ "{" \
+ "\"timestampSeconds\": \"1595349642\"" \
+ "}]"
+
+/* "1595349600" in RFC3339 format: 2020-07-21T16:40:00Z */
+#define TIMESTAMP_FORMAT_DUO_FIELDS_INCORRECT_TYPE "[" \
+ "1595349600," \
+ "{" \
+ "\"timestampSeconds\": \"string\"," \
+ "\"timestampNanos\": true" \
+ "}]"
diff --git a/src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_test_trace.h b/src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_test_trace.h
new file mode 100644
index 000000000..15c7bc911
--- /dev/null
+++ b/src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_test_trace.h
@@ -0,0 +1,6 @@
+#define TRACE_COMMON_CASE "[" \
+ "1591111124," \
+ "{" \
+ "\"trace\": \"test-trace-id-xyz\"" \
+ "}]"
+ \ No newline at end of file
diff --git a/src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_test_trace_sampled.h b/src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_test_trace_sampled.h
new file mode 100644
index 000000000..fad628e93
--- /dev/null
+++ b/src/fluent-bit/tests/runtime/data/stackdriver/stackdriver_test_trace_sampled.h
@@ -0,0 +1,11 @@
+#define TRACE_SAMPLED_CASE_TRUE "[" \
+ "1591111124," \
+ "{" \
+ "\"logging.googleapis.com/traceSampled\": true" \
+ "}]"
+
+#define TRACE_SAMPLED_CASE_FALSE "[" \
+ "1591111124," \
+ "{" \
+ "\"logging.googleapis.com/traceSampled\": false" \
+ "}]"