Repository: GoogleCloudPlatform/opentelemetry-operations-go
Pull request #374 (2022-05-02 12:18:10)

Update logging exporter to use "gcp.*" prefix for attributes
With https://github.com/open-telemetry/opentelemetry-specification/pull/2514 merged the upstream specification now uses `gcp.*` for GCP-specific attributes


Patch:
diff --git a/exporter/collector/logs.go b/exporter/collector/logs.go
index 4cff14c..5546960 100644
--- a/exporter/collector/logs.go
+++ b/exporter/collector/logs.go
@@ -34,10 +34,12 @@ import (
 )
 
 const (
-	HTTPRequestAttributeKey = "com.google.httpRequest"
-
 	defaultMaxEntrySize   = 256000   // 256 KB
 	defaultMaxRequestSize = 10000000 // 10 MB
+
+	HTTPRequestAttributeKey    = "gcp.http_request"
+	LogNameAttributeKey        = "gcp.log_name"
+	SourceLocationAttributeKey = "gcp.source_location"
 )
 
 // severityMapping maps the integer severity level values from OTel [0-24]
@@ -225,14 +227,14 @@ func (l *LogsExporter) writeLogEntries(ctx context.Context, batch []*logpb.LogEn
 }
 
 func (l logMapper) getLogName(log plog.LogRecord) (string, error) {
-	logNameAttr, exists := log.Attributes().Get("com.google.logName")
+	logNameAttr, exists := log.Attributes().Get(LogNameAttributeKey)
 	if exists {
 		return logNameAttr.AsString(), nil
 	}
 	if len(l.cfg.LogConfig.DefaultLogName) > 0 {
 		return l.cfg.LogConfig.DefaultLogName, nil
 	}
-	return "", fmt.Errorf("no log name provided.  Set the 'default_log_name' option, or add the 'com.google.logName' attribute to set a log name")
+	return "", fmt.Errorf("no log name provided.  Set the 'default_log_name' option, or add the 'gcp.log_name' attribute to set a log name")
 }
 
 func (l logMapper) logToEntry(
@@ -263,7 +265,7 @@ func (l logMapper) logToEntry(
 	}
 
 	// parse LogEntrySourceLocation struct from OTel attribute
-	sourceLocation, ok := log.Attributes().Get("com.google.sourceLocation")
+	sourceLocation, ok := log.Attributes().Get(SourceLocationAttributeKey)
 	if ok {
 		var logEntrySourceLocation logpb.LogEntrySourceLocation
 		err := json.Unmarshal(sourceLocation.BytesVal(), &logEntrySourceLocation)


Test patch:
diff --git a/exporter/collector/integrationtest/testdata/fixtures/logs_apache_access.json b/exporter/collector/integrationtest/testdata/fixtures/logs_apache_access.json
index 1dd192e..3ab6ec5 100644
--- a/exporter/collector/integrationtest/testdata/fixtures/logs_apache_access.json
+++ b/exporter/collector/integrationtest/testdata/fixtures/logs_apache_access.json
@@ -16,7 +16,7 @@
           "scope": {},
           "logRecords": [
             {
-              "timeUnixNano": "1650994483968433711",
+              "timeUnixNano": "1650984816000000000",
               "body": {
                 "stringValue": "127.0.0.1 - - [26/Apr/2022:22:53:36 +0800] \"GET / HTTP/1.1\" 200 1247"
               },
@@ -28,62 +28,62 @@
                   }
                 },
                 {
-                  "key": "com.google.httpRequest",
+                  "key": "gcp.http_request",
                   "value": {
                     "kvlistValue": {
                       "values": [
                         {
-                          "key": "requestMethod",
+                          "key": "userAgent",
                           "value": {
-                            "stringValue": "GET"
+                            "stringValue": ""
                           }
                         },
                         {
-                          "key": "requestUrl",
+                          "key": "requestMethod",
                           "value": {
-                            "stringValue": "/"
+                            "stringValue": "GET"
                           }
                         },
                         {
-                          "key": "userAgent",
+                          "key": "protocol",
                           "value": {
-                            "stringValue": ""
+                            "stringValue": "HTTP/1.1"
                           }
                         },
                         {
-                          "key": "host",
+                          "key": "requestUrl",
                           "value": {
-                            "stringValue": "-"
+                            "stringValue": "/"
                           }
                         },
                         {
-                          "key": "user",
+                          "key": "status",
                           "value": {
-                            "stringValue": "-"
+                            "stringValue": "200"
                           }
                         },
                         {
-                          "key": "status",
+                          "key": "responseSize",
                           "value": {
-                            "stringValue": "200"
+                            "stringValue": "1247"
                           }
                         },
                         {
-                          "key": "time",
+                          "key": "referer",
                           "value": {
-                            "stringValue": "26/Apr/2022:22:53:36 +0800"
+                            "stringValue": ""
                           }
                         },
                         {
-                          "key": "protocol",
+                          "key": "user",
                           "value": {
-                            "stringValue": "HTTP/1.1"
+                            "stringValue": "-"
                           }
                         },
                         {
-                          "key": "referer",
+                          "key": "time",
                           "value": {
-                            "stringValue": ""
+                            "stringValue": "26/Apr/2022:22:53:36 +0800"
                           }
                         },
                         {
@@ -93,9 +93,9 @@
                           }
                         },
                         {
-                          "key": "responseSize",
+                          "key": "host",
                           "value": {
-                            "stringValue": "1247"
+                            "stringValue": "-"
                           }
                         }
                       ]
@@ -103,7 +103,7 @@
                   }
                 },
                 {
-                  "key": "com.google.logName",
+                  "key": "gcp.log_name",
                   "value": {
                     "stringValue": "my-log-name-foo"
                   }
@@ -113,7 +113,7 @@
               "spanId": ""
             },
             {
-              "timeUnixNano": "1650994483968470678",
+              "timeUnixNano": "1650984817000000000",
               "body": {
                 "stringValue": "127.0.0.1 - - [26/Apr/2022:22:53:37 +0800] \"GET /lamp.png HTTP/1.1\" 200 51164"
               },
@@ -125,26 +125,20 @@
                   }
                 },
                 {
-                  "key": "com.google.httpRequest",
+                  "key": "gcp.http_request",
                   "value": {
                     "kvlistValue": {
                       "values": [
                         {
-                          "key": "time",
-                          "value": {
-                            "stringValue": "26/Apr/2022:22:53:37 +0800"
-                          }
-                        },
-                        {
-                          "key": "remoteIp",
+                          "key": "user",
                           "value": {
-                            "stringValue": "127.0.0.1"
+                            "stringValue": "-"
                           }
                         },
                         {
-                          "key": "host",
+                          "key": "time",
                           "value": {
-                            "stringValue": "-"
+                            "stringValue": "26/Apr/2022:22:53:37 +0800"
                           }
                         },
                         {
@@ -154,9 +148,9 @@
                           }
                         },
                         {
-                          "key": "referer",
+                          "key": "remoteIp",
                           "value": {
-                            "stringValue": ""
+                            "stringValue": "127.0.0.1"
                           }
                         },
                         {
@@ -166,9 +160,9 @@
                           }
                         },
                         {
-                          "key": "requestUrl",
+                          "key": "protocol",
                           "value": {
-                            "stringValue": "/lamp.png"
+                            "stringValue": "HTTP/1.1"
                           }
                         },
                         {
@@ -178,15 +172,15 @@
                           }
                         },
                         {
-                          "key": "protocol",
+                          "key": "host",
                           "value": {
-                            "stringValue": "HTTP/1.1"
+                            "stringValue": "-"
                           }
                         },
                         {
-                          "key": "user",
+                          "key": "requestUrl",
                           "value": {
-                            "stringValue": "-"
+                            "stringValue": "/lamp.png"
                           }
                         },
                         {
@@ -194,13 +188,19 @@
                           "value": {
                             "stringValue": "51164"
                           }
+                        },
+                        {
+                          "key": "referer",
+                          "value": {
+                            "stringValue": ""
+                          }
                         }
                       ]
                     }
                   }
                 },
                 {
-                  "key": "com.google.logName",
+                  "key": "gcp.log_name",
                   "value": {
                     "stringValue": "my-log-name-foo"
                   }
@@ -210,7 +210,7 @@
               "spanId": ""
             },
             {
-              "timeUnixNano": "1650994483968481764",
+              "timeUnixNano": "1650984817000000000",
               "body": {
                 "stringValue": "127.0.0.1 - - [26/Apr/2022:22:53:37 +0800] \"GET /favicon.ico HTTP/1.1\" 200 3990"
               },
@@ -222,56 +222,56 @@
                   }
                 },
                 {
-                  "key": "com.google.httpRequest",
+                  "key": "gcp.http_request",
                   "value": {
                     "kvlistValue": {
                       "values": [
                         {
-                          "key": "responseSize",
+                          "key": "requestUrl",
                           "value": {
-                            "stringValue": "3990"
+                            "stringValue": "/favicon.ico"
                           }
                         },
                         {
-                          "key": "user",
+                          "key": "status",
                           "value": {
-                            "stringValue": "-"
+                            "stringValue": "200"
                           }
                         },
                         {
-                          "key": "referer",
+                          "key": "responseSize",
                           "value": {
-                            "stringValue": ""
+                            "stringValue": "3990"
                           }
                         },
                         {
-                          "key": "requestMethod",
+                          "key": "remoteIp",
                           "value": {
-                            "stringValue": "GET"
+                            "stringValue": "127.0.0.1"
                           }
                         },
                         {
-                          "key": "requestUrl",
+                          "key": "user",
                           "value": {
-                            "stringValue": "/favicon.ico"
+                            "stringValue": "-"
                           }
                         },
                         {
-                          "key": "protocol",
+                          "key": "userAgent",
                           "value": {
-                            "stringValue": "HTTP/1.1"
+                            "stringValue": ""
                           }
                         },
                         {
-                          "key": "userAgent",
+                          "key": "protocol",
                           "value": {
-                            "stringValue": ""
+                            "stringValue": "HTTP/1.1"
                           }
                         },
                         {
-                          "key": "remoteIp",
+                          "key": "host",
                           "value": {
-                            "stringValue": "127.0.0.1"
+                            "stringValue": "-"
                           }
                         },
                         {
@@ -281,15 +281,15 @@
                           }
                         },
                         {
-                          "key": "status",
+                          "key": "requestMethod",
                           "value": {
-                            "stringValue": "200"
+                            "stringValue": "GET"
                           }
                         },
                         {
-                          "key": "host",
+                          "key": "referer",
                           "value": {
-                            "stringValue": "-"
+                            "stringValue": ""
                           }
                         }
                       ]
@@ -297,7 +297,7 @@
                   }
                 },
                 {
-                  "key": "com.google.logName",
+                  "key": "gcp.log_name",
                   "value": {
                     "stringValue": "my-log-name-foo"
                   }
@@ -307,7 +307,7 @@
               "spanId": ""
             },
             {
-              "timeUnixNano": "1650994483968490059",
+              "timeUnixNano": "1650984831000000000",
               "body": {
                 "stringValue": "127.0.0.1 - - [26/Apr/2022:22:53:51 +0800] \"GET / HTTP/1.1\" 200 1247"
               },
@@ -319,14 +319,14 @@
                   }
                 },
                 {
-                  "key": "com.google.httpRequest",
+                  "key": "gcp.http_request",
                   "value": {
                     "kvlistValue": {
                       "values": [
                         {
-                          "key": "user",
+                          "key": "remoteIp",
                           "value": {
-                            "stringValue": "-"
+                            "stringValue": "127.0.0.1"
                           }
                         },
                         {
@@ -342,51 +342,51 @@
                           }
                         },
                         {
-                          "key": "userAgent",
+                          "key": "referer",
                           "value": {
                             "stringValue": ""
                           }
                         },
                         {
-                          "key": "responseSize",
+                          "key": "requestMethod",
                           "value": {
-                            "stringValue": "1247"
+                            "stringValue": "GET"
                           }
                         },
                         {
-                          "key": "host",
+                          "key": "responseSize",
                           "value": {
-                            "stringValue": "-"
+                            "stringValue": "1247"
                           }
                         },
                         {
-                          "key": "protocol",
+                          "key": "user",
                           "value": {
-                            "stringValue": "HTTP/1.1"
+                            "stringValue": "-"
                           }
                         },
                         {
-                          "key": "referer",
+                          "key": "requestUrl",
                           "value": {
-                            "stringValue": ""
+                            "stringValue": "/"
                           }
                         },
                         {
-                          "key": "remoteIp",
+                          "key": "protocol",
                           "value": {
-                            "stringValue": "127.0.0.1"
+                            "stringValue": "HTTP/1.1"
                           }
                         },
                         {
-                          "key": "requestMethod",
+                          "key": "host",
                           "value": {
-                            "stringValue": "GET"
+                            "stringValue": "-"
                           }
                         },
                         {
-                          "key": "requestUrl",
+                          "key": "userAgent",
                           "value": {
-                            "stringValue": "/"
+                            "stringValue": ""
                           }
                         }
                       ]
@@ -394,7 +394,7 @@
                   }
                 },
                 {
-                  "key": "com.google.logName",
+                  "key": "gcp.log_name",
                   "value": {
                     "stringValue": "my-log-name-foo"
                   }
@@ -404,7 +404,7 @@
               "spanId": ""
             },
             {
-              "timeUnixNano": "1650994483968496637",
+              "timeUnixNano": "1650984832000000000",
               "body": {
                 "stringValue": "127.0.0.1 - - [26/Apr/2022:22:53:52 +0800] \"GET / HTTP/1.1\" 200 1247"
               },
@@ -416,20 +416,14 @@
                   }
                 },
                 {
-                  "key": "com.google.httpRequest",
+                  "key": "gcp.http_request",
                   "value": {
                     "kvlistValue": {
                       "values": [
                         {
-                          "key": "responseSize",
-                          "value": {
-                            "stringValue": "1247"
-                          }
-                        },
-                        {
-                          "key": "referer",
+                          "key": "user",
                           "value": {
-                            "stringValue": ""
+                            "stringValue": "-"
                           }
                         },
                         {
@@ -439,15 +433,15 @@
                           }
                         },
                         {
-                          "key": "requestMethod",
+                          "key": "protocol",
                           "value": {
-                            "stringValue": "GET"
+                            "stringValue": "HTTP/1.1"
                           }
                         },
                         {
-                          "key": "requestUrl",
+                          "key": "referer",
                           "value": {
-                            "stringValue": "/"
+                            "stringValue": ""
                           }
                         },
                         {
@@ -457,33 +451,39 @@
                           }
                         },
                         {
-                          "key": "userAgent",
+                          "key": "host",
                           "value": {
-                            "stringValue": ""
+                            "stringValue": "-"
                           }
                         },
                         {
-                          "key": "user",
+                          "key": "responseSize",
                           "value": {
-                            "stringValue": "-"
+                            "stringValue": "1247"
                           }
                         },
                         {
-                          "key": "status",
+                          "key": "userAgent",
                           "value": {
-                            "stringValue": "200"
+                            "stringValue": ""
                           }
                         },
                         {
-                          "key": "host",
+                          "key": "requestMethod",
                           "value": {
-                            "stringValue": "-"
+                            "stringValue": "GET"
                           }
                         },
                         {
-                          "key": "protocol",
+                          "key": "requestUrl",
                           "value": {
-                            "stringValue": "HTTP/1.1"
+                            "stringValue": "/"
+                          }
+                        },
+                        {
+                          "key": "status",
+                          "value": {
+                            "stringValue": "200"
                           }
                         }
                       ]
@@ -491,7 +491,7 @@
                   }
                 },
                 {
-                  "key": "com.google.logName",
+                  "key": "gcp.log_name",
                   "value": {
                     "stringValue": "my-log-name-foo"
                   }
@@ -501,7 +501,7 @@
               "spanId": ""
             },
             {
-              "timeUnixNano": "1650994483968517647",
+              "timeUnixNano": "1650984833000000000",
               "body": {
                 "stringValue": "127.0.0.1 - - [26/Apr/2022:22:53:53 +0800] \"GET / HTTP/1.1\" 200 1247"
               },
@@ -513,62 +513,62 @@
                   }
                 },
                 {
-                  "key": "com.google.httpRequest",
+                  "key": "gcp.http_request",
                   "value": {
                     "kvlistValue": {
                       "values": [
                         {
-                          "key": "status",
+                          "key": "host",
                           "value": {
-                            "stringValue": "200"
+                            "stringValue": "-"
                           }
                         },
                         {
-                          "key": "remoteIp",
+                          "key": "requestMethod",
                           "value": {
-                            "stringValue": "127.0.0.1"
+                            "stringValue": "GET"
                           }
                         },
                         {
-                          "key": "userAgent",
+                          "key": "status",
                           "value": {
-                            "stringValue": ""
+                            "stringValue": "200"
                           }
                         },
                         {
-                          "key": "host",
+                          "key": "responseSize",
                           "value": {
-                            "stringValue": "-"
+                            "stringValue": "1247"
                           }
                         },
                         {
-                          "key": "user",
+                          "key": "remoteIp",
                           "value": {
-                            "stringValue": "-"
+                            "stringValue": "127.0.0.1"
                           }
                         },
                         {
-                          "key": "time",
+                          "key": "userAgent",
                           "value": {
-                            "stringValue": "26/Apr/2022:22:53:53 +0800"
+                            "stringValue": ""
                           }
                         },
                         {
-                          "key": "requestUrl",
+                          "key": "time",
                           "value": {
-                            "stringValue": "/"
+                            "stringValue": "26/Apr/2022:22:53:53 +0800"
                           }
                         },
                         {
-                          "key": "referer",
+                          "key": "requestUrl",
                           "value": {
-                            "stringValue": ""
+                            "stringValue": "/"
                           }
                         },
                         {
-                          "key": "requestMethod",
+                          "key": "user",
                           "value": {
-                            "stringValue": "GET"
+                            "stringValue": "-"
                           }
                         },
                         {
@@ -578,9 +578,9 @@
                           }
                         },
                         {
-                          "key": "responseSize",
+                          "key": "referer",
                           "value": {
-                            "stringValue": "1247"
+                            "stringValue": ""
                           }
                         }
                       ]
@@ -588,7 +588,7 @@
                   }
                 },
                 {
-                  "key": "com.google.logName",
+                  "key": "gcp.log_name",
                   "value": {
                     "stringValue": "my-log-name-foo"
                   }
@@ -598,7 +598,7 @@
               "spanId": ""
             },
             {
-              "timeUnixNano": "1650994483968525857",
+              "timeUnixNano": "1650984833000000000",
               "body": {
                 "stringValue": "127.0.0.1 - - [26/Apr/2022:22:53:53 +0800] \"GET / HTTP/1.1\" 200 1247"
               },
@@ -610,32 +610,26 @@
                   }
                 },
                 {
-                  "key": "com.google.httpRequest",
+                  "key": "gcp.http_request",
                   "value": {
                     "kvlistValue": {
                       "values": [
                         {
-                          "key": "responseSize",
-                          "value": {
-                            "stringValue": "1247"
-                          }
-                        },
-                        {
-                          "key": "requestUrl",
+                          "key": "user",
                           "value": {
-                            "stringValue": "/"
+                            "stringValue": "-"
                           }
                         },
                         {
-                          "key": "status",
+                          "key": "time",
                           "value": {
-                            "stringValue": "200"
+                            "stringValue": "26/Apr/2022:22:53:53 +0800"
                           }
                         },
                         {
-                          "key": "referer",
+                          "key": "requestUrl",
                           "value": {
-                            "stringValue": ""
+                            "stringValue": "/"
                           }
                         },
                         {
@@ -651,33 +645,39 @@
                           }
                         },
                         {
-                          "key": "user",
+                          "key": "host",
                           "value": {
                             "stringValue": "-"
                           }
                         },
                         {
-                          "key": "time",
+                          "key": "responseSize",
                           "value": {
-                            "stringValue": "26/Apr/2022:22:53:53 +0800"
+                            "stringValue": "1247"
                           }
                         },
                         {
-                          "key": "protocol",
+                          "key": "referer",
                           "value": {
-                            "stringValue": "HTTP/1.1"
+                            "stringValue": ""
                           }
                         },
                         {
-                          "key": "host",
+                          "key": "requestMethod",
                           "value": {
-                            "stringValue": "-"
+                            "stringValue": "GET"
                           }
                         },
                         {
-                          "key": "requestMethod",
+                          "key": "status",
                           "value": {
-                            "stringValue": "GET"
+                            "stringValue": "200"
+                          }
+                        },
+                        {
+                          "key": "protocol",
+                          "value": {
+                            "stringValue": "HTTP/1.1"
                           }
                         }
                       ]
@@ -685,7 +685,7 @@
                   }
                 },
                 {
-                  "key": "com.google.logName",
+                  "key": "gcp.log_name",
                   "value": {
                     "stringValue": "my-log-name-foo"
                   }
@@ -695,7 +695,7 @@
               "spanId": ""
             },
             {
-              "timeUnixNano": "1650994483968532546",
+              "timeUnixNano": "1650984833000000000",
               "body": {
                 "stringValue": "127.0.0.1 - - [26/Apr/2022:22:53:53 +0800] \"GET / HTTP/1.1\" 200 1247"
               },
@@ -707,74 +707,74 @@
                   }
                 },
                 {
-                  "key": "com.google.httpRequest",
+                  "key": "gcp.http_request",
                   "value": {
                     "kvlistValue": {
                       "values": [
                         {
-                          "key": "protocol",
+                          "key": "status",
                           "value": {
-                            "stringValue": "HTTP/1.1"
+                            "stringValue": "200"
                           }
                         },
                         {
-                          "key": "remoteIp",
+                          "key": "responseSize",
                           "value": {
-                            "stringValue": "127.0.0.1"
+                            "stringValue": "1247"
                           }
                         },
                         {
-                          "key": "time",
+                          "key": "referer",
                           "value": {
-                            "stringValue": "26/Apr/2022:22:53:53 +0800"
+                            "stringValue": ""
                           }
                         },
                         {
-                          "key": "userAgent",
+                          "key": "remoteIp",
                           "value": {
-                            "stringValue": ""
+                            "stringValue": "127.0.0.1"
                           }
                         },
                         {
-                          "key": "requestMethod",
+                          "key": "host",
                           "value": {
-                            "stringValue": "GET"
+                            "stringValue": "-"
                           }
                         },
                         {
-                          "key": "responseSize",
+                          "key": "requestMethod",
                           "value": {
-                            "stringValue": "1247"
+                            "stringValue": "GET"
                           }
                         },
                         {
-                          "key": "host",
+                          "key": "userAgent",
                           "value": {
-                            "stringValue": "-"
+                            "stringValue": ""
                           }
                         },
                         {
-                          "key": "requestUrl",
+                          "key": "user",
                           "value": {
-                            "stringValue": "/"
+                            "stringValue": "-"
                           }
                         },
                         {
-                          "key": "status",
+                          "key": "time",
                           "value": {
-                            "stringValue": "200"
+                            "stringValue": "26/Apr/2022:22:53:53 +0800"
                           }
                         },
                         {
-                          "key": "referer",
+                          "key": "requestUrl",
                           "value": {
-                            "stringValue": ""
+                            "stringValue": "/"
                           }
                         },
                         {
-                          "key": "user",
+                          "key": "protocol",
                           "value": {
-                            "stringValue": "-"
+                            "stringValue": "HTTP/1.1"
                           }
                         }
                       ]
@@ -782,7 +782,7 @@
                   }
                 },
                 {
-                  "key": "com.google.logName",
+                  "key": "gcp.log_name",
                   "value": {
                     "stringValue": "my-log-name-foo"
                   }
@@ -792,7 +792,7 @@
               "spanId": ""
             },
             {
-              "timeUnixNano": "1650994483968539797",
+              "timeUnixNano": "1650984833000000000",
               "body": {
                 "stringValue": "127.0.0.1 - - [26/Apr/2022:22:53:53 +0800] \"GET / HTTP/1.1\" 200 1247"
               },
@@ -804,74 +804,74 @@
                   }
                 },
                 {
-                  "key": "com.google.httpRequest",
+                  "key": "gcp.http_request",
                   "value": {
                     "kvlistValue": {
                       "values": [
                         {
-                          "key": "referer",
+                          "key": "responseSize",
                           "value": {
-                            "stringValue": ""
+                            "stringValue": "1247"
                           }
                         },
                         {
-                          "key": "requestMethod",
+                          "key": "time",
                           "value": {
-                            "stringValue": "GET"
+                            "stringValue": "26/Apr/2022:22:53:53 +0800"
                           }
                         },
                         {
-                          "key": "requestUrl",
+                          "key": "protocol",
                           "value": {
-                            "stringValue": "/"
+                            "stringValue": "HTTP/1.1"
                           }
                         },
                         {
-                          "key": "protocol",
+                          "key": "userAgent",
                           "value": {
-                            "stringValue": "HTTP/1.1"
+                            "stringValue": ""
                           }
                         },
                         {
-                          "key": "time",
+                          "key": "requestMethod",
                           "value": {
-                            "stringValue": "26/Apr/2022:22:53:53 +0800"
+                            "stringValue": "GET"
                           }
                         },
                         {
-                          "key": "userAgent",
+                          "key": "referer",
                           "value": {
                             "stringValue": ""
                           }
                         },
                         {
-                          "key": "user",
+                          "key": "host",
                           "value": {
                             "stringValue": "-"
                           }
                         },
                         {
-                          "key": "status",
+                          "key": "user",
                           "value": {
-                            "stringValue": "200"
+                            "stringValue": "-"
                           }
                         },
                         {
-                          "key": "responseSize",
+                          "key": "remoteIp",
                           "value": {
-                            "stringValue": "1247"
+                            "stringValue": "127.0.0.1"
                           }
                         },
                         {
-                          "key": "remoteIp",
+                          "key": "requestUrl",
                           "value": {
-                            "stringValue": "127.0.0.1"
+                            "stringValue": "/"
                           }
                         },
                         {
-                          "key": "host",
+                          "key": "status",
                           "value": {
-                            "stringValue": "-"
+                            "stringValue": "200"
                           }
                         }
                       ]
@@ -879,7 +879,7 @@
                   }
                 },
                 {
-                  "key": "com.google.logName",
+                  "key": "gcp.log_name",
                   "value": {
                     "stringValue": "my-log-name-foo"
                   }
@@ -889,7 +889,7 @@
               "spanId": ""
             },
             {
-              "timeUnixNano": "1650994483968548970",
+              "timeUnixNano": "1650984834000000000",
               "body": {
                 "stringValue": "127.0.0.1 - - [26/Apr/2022:22:53:54 +0800] \"GET / HTTP/1.1\" 200 1247"
               },
@@ -901,32 +901,26 @@
                   }
                 },
                 {
-                  "key": "com.google.httpRequest",
+                  "key": "gcp.http_request",
                   "value": {
                     "kvlistValue": {
                       "values": [
                         {
-                          "key": "responseSize",
-                          "value": {
-                            "stringValue": "1247"
-                          }
-                        },
-                        {
-                          "key": "status",
+                          "key": "remoteIp",
                           "value": {
-                            "stringValue": "200"
+                            "stringValue": "127.0.0.1"
                           }
                         },
                         {
-                          "key": "remoteIp",
+                          "key": "user",
                           "value": {
-                            "stringValue": "127.0.0.1"
+                            "stringValue": "-"
                           }
                         },
                         {
-                          "key": "host",
+                          "key": "protocol",
                           "value": {
-                            "stringValue": "-"
+                            "stringValue": "HTTP/1.1"
                           }
                         },
                         {
@@ -936,9 +930,9 @@
                           }
                         },
                         {
-                          "key": "user",
+                          "key": "time",
                           "value": {
-                            "stringValue": "-"
+                            "stringValue": "26/Apr/2022:22:53:54 +0800"
                           }
                         },
                         {
@@ -948,9 +942,9 @@
                           }
                         },
                         {
-                          "key": "requestUrl",
+                          "key": "responseSize",
                           "value": {
-                            "stringValue": "/"
+                            "stringValue": "1247"
                           }
                         },
                         {
@@ -960,15 +954,21 @@
                           }
                         },
                         {
-                          "key": "time",
+                          "key": "host",
                           "value": {
-                            "stringValue": "26/Apr/2022:22:53:54 +0800"
+                            "stringValue": "-"
                           }
                         },
                         {
-                          "key": "protocol",
+                          "key": "status",
                           "value": {
-                            "stringValue": "HTTP/1.1"
+                            "stringValue": "200"
+                          }
+                        },
+                        {
+                          "key": "requestUrl",
+                          "value": {
+                            "stringValue": "/"
                           }
                         }
                       ]
@@ -976,7 +976,7 @@
                   }
                 },
                 {
-                  "key": "com.google.logName",
+                  "key": "gcp.log_name",
                   "value": {
                     "stringValue": "my-log-name-foo"
                   }
@@ -986,7 +986,7 @@
               "spanId": ""
             },
             {
-              "timeUnixNano": "1650994483968557408",
+              "timeUnixNano": "1650984834000000000",
               "body": {
                 "stringValue": "127.0.0.1 - - [26/Apr/2022:22:53:54 +0800] \"GET / HTTP/1.1\" 200 1247"
               },
@@ -998,62 +998,62 @@
                   }
                 },
                 {
-                  "key": "com.google.httpRequest",
+                  "key": "gcp.http_request",
                   "value": {
                     "kvlistValue": {
                       "values": [
                         {
-                          "key": "requestUrl",
+                          "key": "remoteIp",
                           "value": {
-                            "stringValue": "/"
+                            "stringValue": "127.0.0.1"
                           }
                         },
                         {
-                          "key": "userAgent",
+                          "key": "user",
                           "value": {
-                            "stringValue": ""
+                            "stringValue": "-"
                           }
                         },
                         {
-                          "key": "responseSize",
+                          "key": "protocol",
                           "value": {
-                            "stringValue": "1247"
+                            "stringValue": "HTTP/1.1"
                           }
                         },
                         {
-                          "key": "referer",
+                          "key": "host",
                           "value": {
-                            "stringValue": ""
+                            "stringValue": "-"
                           }
                         },
                         {
-                          "key": "remoteIp",
+                          "key": "time",
                           "value": {
-                            "stringValue": "127.0.0.1"
+                            "stringValue": "26/Apr/2022:22:53:54 +0800"
                           }
                         },
                         {
-                          "key": "user",
+                          "key": "responseSize",
                           "value": {
-                            "stringValue": "-"
+                            "stringValue": "1247"
                           }
                         },
                         {
-                          "key": "requestMethod",
+                          "key": "referer",
                           "value": {
-                            "stringValue": "GET"
+                            "stringValue": ""
                           }
                         },
                         {
-                          "key": "host",
+                          "key": "requestMethod",
                           "value": {
-                            "stringValue": "-"
+                            "stringValue": "GET"
                           }
                         },
                         {
-                          "key": "time",
+                          "key": "requestUrl",
                           "value": {
-                            "stringValue": "26/Apr/2022:22:53:54 +0800"
+                            "stringValue": "/"
                           }
                         },
                         {
@@ -1063,9 +1063,9 @@
                           }
                         },
                         {
-                          "key": "protocol",
+                          "key": "userAgent",
                           "value": {
-                            "stringValue": "HTTP/1.1"
+                            "stringValue": ""
                           }
                         }
                       ]
@@ -1073,7 +1073,7 @@
                   }
                 },
                 {
-                  "key": "com.google.logName",
+                  "key": "gcp.log_name",
                   "value": {
                     "stringValue": "my-log-name-foo"
                   }
@@ -1083,7 +1083,7 @@
               "spanId": ""
             },
             {
-              "timeUnixNano": "1650994483968564828",
+              "timeUnixNano": "1650984834000000000",
               "body": {
                 "stringValue": "127.0.0.1 - - [26/Apr/2022:22:53:54 +0800] \"GET / HTTP/1.1\" 200 1247"
               },
@@ -1095,10 +1095,16 @@
                   }
                 },
                 {
-                  "key": "com.google.httpRequest",
+                  "key": "gcp.http_request",
                   "value": {
                     "kvlistValue": {
                       "values": [
+                        {
+                          "key": "time",
+                          "value": {
+                            "stringValue": "26/Apr/2022:22:53:54 +0800"
+                          }
+                        },
                         {
                           "key": "requestMethod",
                           "value": {
@@ -1106,9 +1112,9 @@
                           }
                         },
                         {
-                          "key": "status",
+                          "key": "requestUrl",
                           "value": {
-                            "stringValue": "200"
+                            "stringValue": "/"
                           }
                         },
                         {
@@ -1124,33 +1130,27 @@
                           }
                         },
                         {
-                          "key": "requestUrl",
-                          "value": {
-                            "stringValue": "/"
-                          }
-                        },
-                        {
-                          "key": "user",
+                          "key": "protocol",
                           "value": {
-                            "stringValue": "-"
+                            "stringValue": "HTTP/1.1"
                           }
                         },
                         {
-                          "key": "time",
+                          "key": "responseSize",
                           "value": {
-                            "stringValue": "26/Apr/2022:22:53:54 +0800"
+                            "stringValue": "1247"
                           }
                         },
                         {
-                          "key": "protocol",
+                          "key": "status",
                           "value": {
-                            "stringValue": "HTTP/1.1"
+                            "stringValue": "200"
                           }
                         },
                         {
-                          "key": "responseSize",
+                          "key": "host",
                           "value": {
-                            "stringValue": "1247"
+                            "stringValue": "-"
                           }
                         },
                         {
@@ -1160,7 +1160,7 @@
                           }
                         },
                         {
-                          "key": "host",
+                          "key": "user",
                           "value": {
                             "stringValue": "-"
                           }
@@ -1170,7 +1170,7 @@
                   }
                 },
                 {
-                  "key": "com.google.logName",
+                  "key": "gcp.log_name",
                   "value": {
                     "stringValue": "my-log-name-foo"
                   }
@@ -1180,80 +1180,86 @@
               "spanId": ""
             },
             {
-              "timeUnixNano": "1650994483968571303",
+              "timeUnixNano": "1650984834000000000",
               "body": {
                 "stringValue": "127.0.0.1 - - [26/Apr/2022:22:53:54 +0800] \"GET / HTTP/1.1\" 200 1247"
               },
               "attributes": [
                 {
-                  "key": "com.google.httpRequest",
+                  "key": "log.file.name",
+                  "value": {
+                    "stringValue": "test.log"
+                  }
+                },
+                {
+                  "key": "gcp.http_request",
                   "value": {
                     "kvlistValue": {
                       "values": [
                         {
-                          "key": "user",
+                          "key": "host",
                           "value": {
                             "stringValue": "-"
                           }
                         },
                         {
-                          "key": "protocol",
+                          "key": "remoteIp",
                           "value": {
-                            "stringValue": "HTTP/1.1"
+                            "stringValue": "127.0.0.1"
                           }
                         },
                         {
-                          "key": "responseSize",
+                          "key": "time",
                           "value": {
-                            "stringValue": "1247"
+                            "stringValue": "26/Apr/2022:22:53:54 +0800"
                           }
                         },
                         {
-                          "key": "status",
+                          "key": "userAgent",
                           "value": {
-                            "stringValue": "200"
+                            "stringValue": ""
                           }
                         },
                         {
-                          "key": "userAgent",
+                          "key": "responseSize",
                           "value": {
-                            "stringValue": ""
+                            "stringValue": "1247"
                           }
                         },
                         {
-                          "key": "time",
+                          "key": "referer",
                           "value": {
-                            "stringValue": "26/Apr/2022:22:53:54 +0800"
+                            "stringValue": ""
                           }
                         },
                         {
-                          "key": "requestMethod",
+                          "key": "requestUrl",
                           "value": {
-                            "stringValue": "GET"
+                            "stringValue": "/"
                           }
                         },
                         {
-                          "key": "host",
+                          "key": "protocol",
                           "value": {
-                            "stringValue": "-"
+                            "stringValue": "HTTP/1.1"
                           }
                         },
                         {
-                          "key": "requestUrl",
+                          "key": "user",
                           "value": {
-                            "stringValue": "/"
+                            "stringValue": "-"
                           }
                         },
                         {
-                          "key": "referer",
+                          "key": "requestMethod",
                           "value": {
-                            "stringValue": ""
+                            "stringValue": "GET"
                           }
                         },
                         {
-                          "key": "remoteIp",
+                          "key": "status",
                           "value": {
-                            "stringValue": "127.0.0.1"
+                            "stringValue": "200"
                           }
                         }
                       ]
@@ -1261,13 +1267,7 @@
                   }
                 },
                 {
-                  "key": "log.file.name",
-                  "value": {
-                    "stringValue": "test.log"
-                  }
-                },
-                {
-                  "key": "com.google.logName",
+                  "key": "gcp.log_name",
                   "value": {
                     "stringValue": "my-log-name-foo"
                   }
@@ -1277,32 +1277,26 @@
               "spanId": ""
             },
             {
-              "timeUnixNano": "1650994483968578924",
+              "timeUnixNano": "1650984834000000000",
               "body": {
                 "stringValue": "127.0.0.1 - - [26/Apr/2022:22:53:54 +0800] \"GET / HTTP/1.1\" 200 1247"
               },
               "attributes": [
                 {
-                  "key": "log.file.name",
-                  "value": {
-                    "stringValue": "test.log"
-                  }
-                },
-                {
-                  "key": "com.google.httpRequest",
+                  "key": "gcp.http_request",
                   "value": {
                     "kvlistValue": {
                       "values": [
                         {
-                          "key": "requestUrl",
+                          "key": "responseSize",
                           "value": {
-                            "stringValue": "/"
+                            "stringValue": "1247"
                           }
                         },
                         {
-                          "key": "responseSize",
+                          "key": "userAgent",
                           "value": {
-                            "stringValue": "1247"
+                            "stringValue": ""
                           }
                         },
                         {
@@ -1312,15 +1306,15 @@
                           }
                         },
                         {
-                          "key": "protocol",
+                          "key": "requestUrl",
                           "value": {
-                            "stringValue": "HTTP/1.1"
+                            "stringValue": "/"
                           }
                         },
                         {
-                          "key": "referer",
+                          "key": "time",
                           "value": {
-                            "stringValue": ""
+                            "stringValue": "26/Apr/2022:22:53:54 +0800"
                           }
                         },
                         {
@@ -1348,13 +1342,13 @@
                           }
                         },
                         {
-                          "key": "time",
+                          "key": "protocol",
                           "value": {
-                            "stringValue": "26/Apr/2022:22:53:54 +0800"
+                            "stringValue": "HTTP/1.1"
                           }
                         },
                         {
-                          "key": "userAgent",
+                          "key": "referer",
                           "value": {
                             "stringValue": ""
                           }
@@ -1364,7 +1358,13 @@
                   }
                 },
                 {
-                  "key": "com.google.logName",
+                  "key": "log.file.name",
+                  "value": {
+                    "stringValue": "test.log"
+                  }
+                },
+                {
+                  "key": "gcp.log_name",
                   "value": {
                     "stringValue": "my-log-name-foo"
                   }
@@ -1374,7 +1374,7 @@
               "spanId": ""
             },
             {
-              "timeUnixNano": "1650994483968584858",
+              "timeUnixNano": "1650984834000000000",
               "body": {
                 "stringValue": "127.0.0.1 - - [26/Apr/2022:22:53:54 +0800] \"GET / HTTP/1.1\" 200 1247"
               },
@@ -1386,26 +1386,26 @@
                   }
                 },
                 {
-                  "key": "com.google.httpRequest",
+                  "key": "gcp.http_request",
                   "value": {
                     "kvlistValue": {
                       "values": [
                         {
-                          "key": "requestUrl",
+                          "key": "referer",
                           "value": {
-                            "stringValue": "/"
+                            "stringValue": ""
                           }
                         },
                         {
-                          "key": "remoteIp",
+                          "key": "host",
                           "value": {
-                            "stringValue": "127.0.0.1"
+                            "stringValue": "-"
                           }
                         },
                         {
-                          "key": "host",
+                          "key": "requestUrl",
                           "value": {
-                            "stringValue": "-"
+                            "stringValue": "/"
                           }
                         },
                         {
@@ -1415,45 +1415,45 @@
                           }
                         },
                         {
-                          "key": "time",
+                          "key": "userAgent",
                           "value": {
-                            "stringValue": "26/Apr/2022:22:53:54 +0800"
+                            "stringValue": ""
                           }
                         },
                         {
-                          "key": "requestMethod",
+                          "key": "remoteIp",
                           "value": {
-                            "stringValue": "GET"
+                            "stringValue": "127.0.0.1"
                           }
                         },
                         {
-                          "key": "userAgent",
+                          "key": "user",
                           "value": {
-                            "stringValue": ""
+                            "stringValue": "-"
                           }
                         },
                         {
-                          "key": "protocol",
+                          "key": "requestMethod",
                           "value": {
-                            "stringValue": "HTTP/1.1"
+                            "stringValue": "GET"
                           }
                         },
                         {
-                          "key": "status",
+                          "key": "protocol",
                           "value": {
-                            "stringValue": "200"
+                            "stringValue": "HTTP/1.1"
                           }
                         },
                         {
-                          "key": "referer",
+                          "key": "time",
                           "value": {
-                            "stringValue": ""
+                            "stringValue": "26/Apr/2022:22:53:54 +0800"
                           }
                         },
                         {
-                          "key": "user",
+                          "key": "status",
                           "value": {
-                            "stringValue": "-"
+                            "stringValue": "200"
                           }
                         }
                       ]
@@ -1461,7 +1461,7 @@
                   }
                 },
                 {
-                  "key": "com.google.logName",
+                  "key": "gcp.log_name",
                   "value": {
                     "stringValue": "my-log-name-foo"
                   }
@@ -1471,7 +1471,7 @@
               "spanId": ""
             },
             {
-              "timeUnixNano": "1650994483968591035",
+              "timeUnixNano": "1650984878000000000",
               "body": {
                 "stringValue": "127.0.0.2 - - [26/Apr/2022:22:54:38 +0800] \"GET / HTTP/1.1\" 200 4429"
               },
@@ -1483,20 +1483,26 @@
                   }
                 },
                 {
-                  "key": "com.google.httpRequest",
+                  "key": "gcp.http_request",
                   "value": {
                     "kvlistValue": {
                       "values": [
                         {
-                          "key": "time",
+                          "key": "referer",
                           "value": {
-                            "stringValue": "26/Apr/2022:22:54:38 +0800"
+                            "stringValue": ""
                           }
                         },
                         {
-                          "key": "requestUrl",
+                          "key": "userAgent",
                           "value": {
-                            "stringValue": "/"
+                            "stringValue": ""
+                          }
+                        },
+                        {
+                          "key": "user",
+                          "value": {
+                            "stringValue": "-"
                           }
                         },
                         {
@@ -1506,27 +1512,27 @@
                           }
                         },
                         {
-                          "key": "userAgent",
+                          "key": "time",
                           "value": {
-                            "stringValue": ""
+                            "stringValue": "26/Apr/2022:22:54:38 +0800"
                           }
                         },
                         {
-                          "key": "protocol",
+                          "key": "requestUrl",
                           "value": {
-                            "stringValue": "HTTP/1.1"
+                            "stringValue": "/"
                           }
                         },
                         {
-                          "key": "host",
+                          "key": "protocol",
                           "value": {
-                            "stringValue": "-"
+                            "stringValue": "HTTP/1.1"
                           }
                         },
                         {
-                          "key": "user",
+                          "key": "remoteIp",
                           "value": {
-                            "stringValue": "-"
+                            "stringValue": "127.0.0.2"
                           }
                         },
                         {
@@ -1542,15 +1548,9 @@
                           }
                         },
                         {
-                          "key": "referer",
-                          "value": {
-                            "stringValue": ""
-                          }
-                        },
-                        {
-                          "key": "remoteIp",
+                          "key": "host",
                           "value": {
-                            "stringValue": "127.0.0.2"
+                            "stringValue": "-"
                           }
                         }
                       ]
@@ -1558,7 +1558,7 @@
                   }
                 },
                 {
-                  "key": "com.google.logName",
+                  "key": "gcp.log_name",
                   "value": {
                     "stringValue": "my-log-name-foo"
                   }
@@ -1568,7 +1568,7 @@
               "spanId": ""
             },
             {
-              "timeUnixNano": "1650994483968597344",
+              "timeUnixNano": "1650984883000000000",
               "body": {
                 "stringValue": "127.0.0.1 - - [26/Apr/2022:22:54:43 +0800] \"-\" 408 -"
               },
@@ -1580,7 +1580,7 @@
                   }
                 },
                 {
-                  "key": "com.google.httpRequest",
+                  "key": "gcp.http_request",
                   "value": {
                     "kvlistValue": {
                       "values": [
@@ -1591,33 +1591,27 @@
                           }
                         },
                         {
-                          "key": "remoteIp",
-                          "value": {
-                            "stringValue": "127.0.0.1"
-                          }
-                        },
-                        {
-                          "key": "requestUrl",
+                          "key": "user",
                           "value": {
-                            "stringValue": ""
+                            "stringValue": "-"
                           }
                         },
                         {
-                          "key": "host",
+                          "key": "time",
                           "value": {
-                            "stringValue": "-"
+                            "stringValue": "26/Apr/2022:22:54:43 +0800"
                           }
                         },
                         {
-                          "key": "user",
+                          "key": "responseSize",
                           "value": {
                             "stringValue": "-"
                           }
                         },
                         {
-                          "key": "responseSize",
+                          "key": "remoteIp",
                           "value": {
-                            "stringValue": "-"
+                            "stringValue": "127.0.0.1"
                           }
                         },
                         {
@@ -1639,15 +1633,21 @@
                           }
                         },
                         {
-                          "key": "referer",
+                          "key": "host",
+                          "value": {
+                            "stringValue": "-"
+                          }
+                        },
+                        {
+                          "key": "requestUrl",
                           "value": {
                             "stringValue": ""
                           }
                         },
                         {
-                          "key": "time",
+                          "key": "referer",
                           "value": {
-                            "stringValue": "26/Apr/2022:22:54:43 +0800"
+                            "stringValue": ""
                           }
                         }
                       ]
@@ -1655,7 +1655,7 @@
                   }
                 },
                 {
-                  "key": "com.google.logName",
+                  "key": "gcp.log_name",
                   "value": {
                     "stringValue": "my-log-name-foo"
                   }
diff --git a/exporter/collector/integrationtest/testdata/fixtures/logs_apache_access_expected.json b/exporter/collector/integrationtest/testdata/fixtures/logs_apache_access_expected.json
index 03652ab..489f80c 100644
--- a/exporter/collector/integrationtest/testdata/fixtures/logs_apache_access_expected.json
+++ b/exporter/collector/integrationtest/testdata/fixtures/logs_apache_access_expected.json
@@ -12,7 +12,7 @@
             }
           },
           "textPayload": "127.0.0.1 - - [26/Apr/2022:22:53:36 +0800] \"GET / HTTP/1.1\" 200 1247",
-          "timestamp": "2022-04-28T17:26:45.136110082Z",
+          "timestamp": "2022-05-02T12:16:14.574548493Z",
           "httpRequest": {
             "requestMethod": "GET",
             "requestUrl": "/",
@@ -32,7 +32,7 @@
             }
           },
           "textPayload": "127.0.0.1 - - [26/Apr/2022:22:53:37 +0800] \"GET /lamp.png HTTP/1.1\" 200 51164",
-          "timestamp": "2022-04-28T17:26:45.136110082Z",
+          "timestamp": "2022-05-02T12:16:14.574548493Z",
           "httpRequest": {
             "requestMethod": "GET",
             "requestUrl": "/lamp.png",
@@ -52,7 +52,7 @@
             }
           },
           "textPayload": "127.0.0.1 - - [26/Apr/2022:22:53:37 +0800] \"GET /favicon.ico HTTP/1.1\" 200 3990",
-          "timestamp": "2022-04-28T17:26:45.136110082Z",
+          "timestamp": "2022-05-02T12:16:14.574548493Z",
           "httpRequest": {
             "requestMethod": "GET",
             "requestUrl": "/favicon.ico",
@@ -72,7 +72,7 @@
             }
           },
           "textPayload": "127.0.0.1 - - [26/Apr/2022:22:53:51 +0800] \"GET / HTTP/1.1\" 200 1247",
-          "timestamp": "2022-04-28T17:26:45.136110082Z",
+          "timestamp": "2022-05-02T12:16:14.574548493Z",
           "httpRequest": {
             "requestMethod": "GET",
             "requestUrl": "/",
@@ -92,7 +92,7 @@
             }
           },
           "textPayload": "127.0.0.1 - - [26/Apr/2022:22:53:52 +0800] \"GET / HTTP/1.1\" 200 1247",
-          "timestamp": "2022-04-28T17:26:45.136110082Z",
+          "timestamp": "2022-05-02T12:16:14.574548493Z",
           "httpRequest": {
             "requestMethod": "GET",
             "requestUrl": "/",
@@ -112,7 +112,7 @@
             }
           },
           "textPayload": "127.0.0.1 - - [26/Apr/2022:22:53:53 +0800] \"GET / HTTP/1.1\" 200 1247",
-          "timestamp": "2022-04-28T17:26:45.136110082Z",
+          "timestamp": "2022-05-02T12:16:14.574548493Z",
           "httpRequest": {
             "requestMethod": "GET",
             "requestUrl": "/",
@@ -132,7 +132,7 @@
             }
           },
           "textPayload": "127.0.0.1 - - [26/Apr/2022:22:53:53 +0800] \"GET / HTTP/1.1\" 200 1247",
-          "timestamp": "2022-04-28T17:26:45.136110082Z",
+          "timestamp": "2022-05-02T12:16:14.574548493Z",
           "httpRequest": {
             "requestMethod": "GET",
             "requestUrl": "/",
@@ -152,7 +152,7 @@
             }
           },
           "textPayload": "127.0.0.1 - - [26/Apr/2022:22:53:53 +0800] \"GET / HTTP/1.1\" 200 1247",
-          "timestamp": "2022-04-28T17:26:45.136110082Z",
+          "timestamp": "2022-05-02T12:16:14.574548493Z",
           "httpRequest": {
             "requestMethod": "GET",
             "requestUrl": "/",
@@ -172,7 +172,7 @@
             }
           },
           "textPayload": "127.0.0.1 - - [26/Apr/2022:22:53:53 +0800] \"GET / HTTP/1.1\" 200 1247",
-          "timestamp": "2022-04-28T17:26:45.136110082Z",
+          "timestamp": "2022-05-02T12:16:14.574548493Z",
           "httpRequest": {
             "requestMethod": "GET",
             "requestUrl": "/",
@@ -192,7 +192,7 @@
             }
           },
           "textPayload": "127.0.0.1 - - [26/Apr/2022:22:53:54 +0800] \"GET / HTTP/1.1\" 200 1247",
-          "timestamp": "2022-04-28T17:26:45.136110082Z",
+          "timestamp": "2022-05-02T12:16:14.574548493Z",
           "httpRequest": {
             "requestMethod": "GET",
             "requestUrl": "/",
@@ -212,7 +212,7 @@
             }
           },
           "textPayload": "127.0.0.1 - - [26/Apr/2022:22:53:54 +0800] \"GET / HTTP/1.1\" 200 1247",
-          "timestamp": "2022-04-28T17:26:45.136110082Z",
+          "timestamp": "2022-05-02T12:16:14.574548493Z",
           "httpRequest": {
             "requestMethod": "GET",
             "requestUrl": "/",
@@ -232,7 +232,7 @@
             }
           },
           "textPayload": "127.0.0.1 - - [26/Apr/2022:22:53:54 +0800] \"GET / HTTP/1.1\" 200 1247",
-          "timestamp": "2022-04-28T17:26:45.136110082Z",
+          "timestamp": "2022-05-02T12:16:14.574548493Z",
           "httpRequest": {
             "requestMethod": "GET",
             "requestUrl": "/",
@@ -252,7 +252,7 @@
             }
           },
           "textPayload": "127.0.0.1 - - [26/Apr/2022:22:53:54 +0800] \"GET / HTTP/1.1\" 200 1247",
-          "timestamp": "2022-04-28T17:26:45.136110082Z",
+          "timestamp": "2022-05-02T12:16:14.574548493Z",
           "httpRequest": {
             "requestMethod": "GET",
             "requestUrl": "/",
@@ -272,7 +272,7 @@
             }
           },
           "textPayload": "127.0.0.1 - - [26/Apr/2022:22:53:54 +0800] \"GET / HTTP/1.1\" 200 1247",
-          "timestamp": "2022-04-28T17:26:45.136110082Z",
+          "timestamp": "2022-05-02T12:16:14.574548493Z",
           "httpRequest": {
             "requestMethod": "GET",
             "requestUrl": "/",
@@ -292,7 +292,7 @@
             }
           },
           "textPayload": "127.0.0.1 - - [26/Apr/2022:22:53:54 +0800] \"GET / HTTP/1.1\" 200 1247",
-          "timestamp": "2022-04-28T17:26:45.136110082Z",
+          "timestamp": "2022-05-02T12:16:14.574548493Z",
           "httpRequest": {
             "requestMethod": "GET",
             "requestUrl": "/",
@@ -312,7 +312,7 @@
             }
           },
           "textPayload": "127.0.0.2 - - [26/Apr/2022:22:54:38 +0800] \"GET / HTTP/1.1\" 200 4429",
-          "timestamp": "2022-04-28T17:26:45.136110082Z",
+          "timestamp": "2022-05-02T12:16:14.574548493Z",
           "httpRequest": {
             "requestMethod": "GET",
             "requestUrl": "/",
@@ -332,7 +332,7 @@
             }
           },
           "textPayload": "127.0.0.1 - - [26/Apr/2022:22:54:43 +0800] \"-\" 408 -",
-          "timestamp": "2022-04-28T17:26:45.136110082Z"
+          "timestamp": "2022-05-02T12:16:14.574548493Z"
         }
       ],
       "partialSuccess": true
diff --git a/exporter/collector/integrationtest/testdata/fixtures/logs_apache_error.json b/exporter/collector/integrationtest/testdata/fixtures/logs_apache_error.json
index ac02d4e..3413008 100644
--- a/exporter/collector/integrationtest/testdata/fixtures/logs_apache_error.json
+++ b/exporter/collector/integrationtest/testdata/fixtures/logs_apache_error.json
@@ -1,7 +1,16 @@
 {
   "resourceLogs": [
     {
-      "resource": {},
+      "resource": {
+        "attributes": [
+          {
+            "key": "cloud.platform",
+            "value": {
+              "stringValue": "gcp_compute_engine"
+            }
+          }
+        ]
+      },
       "scopeLogs": [
         {
           "scope": {},
@@ -12,21 +21,21 @@
                 "kvlistValue": {
                   "values": [
                     {
-                      "key": "time",
+                      "key": "message",
                       "value": {
-                        "stringValue": "Tue Apr 26 00:46:21.412645 2022"
+                        "stringValue": "[pid 417652:tid 139808755448704] AH01232: suEXEC mechanism enabled (wrapper: /usr/local/apache/bin/suexec)"
                       }
                     },
                     {
-                      "key": "severity",
+                      "key": "time",
                       "value": {
-                        "stringValue": "notice"
+                        "stringValue": "Tue Apr 26 00:46:21.412645 2022"
                       }
                     },
                     {
-                      "key": "message",
+                      "key": "severity",
                       "value": {
-                        "stringValue": "[pid 417652:tid 139808755448704] AH01232: suEXEC mechanism enabled (wrapper: /usr/local/apache/bin/suexec)"
+                        "stringValue": "notice"
                       }
                     }
                   ]
@@ -40,7 +49,7 @@
                   }
                 },
                 {
-                  "key": "com.google.logName",
+                  "key": "gcp.log_name",
                   "value": {
                     "stringValue": "apache-error-fixture"
                   }
@@ -85,7 +94,7 @@
                   }
                 },
                 {
-                  "key": "com.google.logName",
+                  "key": "gcp.log_name",
                   "value": {
                     "stringValue": "apache-error-fixture"
                   }
@@ -128,7 +137,7 @@
                   }
                 },
                 {
-                  "key": "com.google.logName",
+                  "key": "gcp.log_name",
                   "value": {
                     "stringValue": "apache-error-fixture"
                   }
@@ -143,21 +152,21 @@
                 "kvlistValue": {
                   "values": [
                     {
-                      "key": "severity",
+                      "key": "time",
                       "value": {
-                        "stringValue": "notice"
+                        "stringValue": "Tue Apr 26 00:46:21.503003 2022"
                       }
                     },
                     {
-                      "key": "message",
+                      "key": "severity",
                       "value": {
-                        "stringValue": "[pid 417653:tid 139808755448704] AH00094: Command line: '/usr/local/apache/bin/httpd'"
+                        "stringValue": "notice"
                       }
                     },
                     {
-                      "key": "time",
+                      "key": "message",
                       "value": {
-                        "stringValue": "Tue Apr 26 00:46:21.503003 2022"
+                        "stringValue": "[pid 417653:tid 139808755448704] AH00094: Command line: '/usr/local/apache/bin/httpd'"
                       }
                     }
                   ]
@@ -171,7 +180,7 @@
                   }
                 },
                 {
-                  "key": "com.google.logName",
+                  "key": "gcp.log_name",
                   "value": {
                     "stringValue": "apache-error-fixture"
                   }
@@ -185,12 +194,6 @@
               "body": {
                 "kvlistValue": {
                   "values": [
-                    {
-                      "key": "message",
-                      "value": {
-                        "stringValue": "[pid 417653:tid 139808755448704] AH00491: caught SIGTERM, shutting down"
-                      }
-                    },
                     {
                       "key": "time",
                       "value": {
@@ -202,6 +205,12 @@
                       "value": {
                         "stringValue": "notice"
                       }
+                    },
+                    {
+                      "key": "message",
+                      "value": {
+                        "stringValue": "[pid 417653:tid 139808755448704] AH00491: caught SIGTERM, shutting down"
+                      }
                     }
                   ]
                 }
@@ -214,7 +223,7 @@
                   }
                 },
                 {
-                  "key": "com.google.logName",
+                  "key": "gcp.log_name",
                   "value": {
                     "stringValue": "apache-error-fixture"
                   }
@@ -257,7 +266,7 @@
                   }
                 },
                 {
-                  "key": "com.google.logName",
+                  "key": "gcp.log_name",
                   "value": {
                     "stringValue": "apache-error-fixture"
                   }
@@ -302,7 +311,7 @@
                   }
                 },
                 {
-                  "key": "com.google.logName",
+                  "key": "gcp.log_name",
                   "value": {
                     "stringValue": "apache-error-fixture"
                   }
@@ -317,21 +326,21 @@
                 "kvlistValue": {
                   "values": [
                     {
-                      "key": "severity",
+                      "key": "time",
                       "value": {
-                        "stringValue": "notice"
+                        "stringValue": "Tue Apr 26 22:48:35.606223 2022"
                       }
                     },
                     {
-                      "key": "message",
+                      "key": "severity",
                       "value": {
-                        "stringValue": "[pid 769:tid 140159306111872] AH00489: Apache/2.4.46 (Unix) OpenSSL/1.1.1g mod_wsgi/4.7.1 Python/3.6 configured -- resuming normal operations"
+                        "stringValue": "notice"
                       }
                     },
                     {
-                      "key": "time",
+                      "key": "message",
                       "value": {
-                        "stringValue": "Tue Apr 26 22:48:35.606223 2022"
+                        "stringValue": "[pid 769:tid 140159306111872] AH00489: Apache/2.4.46 (Unix) OpenSSL/1.1.1g mod_wsgi/4.7.1 Python/3.6 configured -- resuming normal operations"
                       }
                     }
                   ]
@@ -345,7 +354,7 @@
                   }
                 },
                 {
-                  "key": "com.google.logName",
+                  "key": "gcp.log_name",
                   "value": {
                     "stringValue": "apache-error-fixture"
                   }
@@ -360,21 +369,21 @@
                 "kvlistValue": {
                   "values": [
                     {
-                      "key": "severity",
+                      "key": "time",
                       "value": {
-                        "stringValue": "notice"
+                        "stringValue": "Tue Apr 26 22:48:35.606298 2022"
                       }
                     },
                     {
-                      "key": "message",
+                      "key": "severity",
                       "value": {
-                        "stringValue": "[pid 769:tid 140159306111872] AH00094: Command line: '/usr/local/apache/bin/httpd'"
+                        "stringValue": "notice"
                       }
                     },
                     {
-                      "key": "time",
+                      "key": "message",
                       "value": {
-                        "stringValue": "Tue Apr 26 22:48:35.606298 2022"
+                        "stringValue": "[pid 769:tid 140159306111872] AH00094: Command line: '/usr/local/apache/bin/httpd'"
                       }
                     }
                   ]
@@ -388,7 +397,7 @@
                   }
                 },
                 {
-                  "key": "com.google.logName",
+                  "key": "gcp.log_name",
                   "value": {
                     "stringValue": "apache-error-fixture"
                   }
diff --git a/exporter/collector/integrationtest/testdata/fixtures/logs_apache_error_expected.json b/exporter/collector/integrationtest/testdata/fixtures/logs_apache_error_expected.json
index c987975..9946177 100644
--- a/exporter/collector/integrationtest/testdata/fixtures/logs_apache_error_expected.json
+++ b/exporter/collector/integrationtest/testdata/fixtures/logs_apache_error_expected.json
@@ -5,11 +5,10 @@
         {
           "logName": "projects/fakeprojectid/logs/apache-error-fixture",
           "resource": {
-            "type": "generic_node",
+            "type": "gce_instance",
             "labels": {
-              "location": "global",
-              "namespace": "",
-              "node_id": ""
+              "instance_id": "",
+              "zone": ""
             }
           },
           "jsonPayload": {
@@ -17,16 +16,15 @@
             "severity": "notice",
             "time": "Tue Apr 26 00:46:21.412645 2022"
           },
-          "timestamp": "2022-04-28T17:26:45.136110082Z"
+          "timestamp": "2022-05-02T12:16:14.574548493Z"
         },
         {
           "logName": "projects/fakeprojectid/logs/apache-error-fixture",
           "resource": {
-            "type": "generic_node",
+            "type": "gce_instance",
             "labels": {
-              "location": "global",
-              "namespace": "",
-              "node_id": ""
+              "instance_id": "",
+              "zone": ""
             }
           },
           "jsonPayload": {
@@ -34,17 +32,16 @@
             "severity": "warn",
             "time": "Tue Apr 26 00:46:21.457314 2022"
           },
-          "timestamp": "2022-04-28T17:26:45.136110082Z",
+          "timestamp": "2022-05-02T12:16:14.574548493Z",
           "severity": "WARNING"
         },
         {
           "logName": "projects/fakeprojectid/logs/apache-error-fixture",
           "resource": {
-            "type": "generic_node",
+            "type": "gce_instance",
             "labels": {
-              "location": "global",
-              "namespace": "",
-              "node_id": ""
+              "instance_id": "",
+              "zone": ""
             }
           },
           "jsonPayload": {
@@ -52,16 +49,15 @@
             "severity": "notice",
             "time": "Tue Apr 26 00:46:21.502940 2022"
           },
-          "timestamp": "2022-04-28T17:26:45.136110082Z"
+          "timestamp": "2022-05-02T12:16:14.574548493Z"
         },
         {
           "logName": "projects/fakeprojectid/logs/apache-error-fixture",
           "resource": {
-            "type": "generic_node",
+            "type": "gce_instance",
             "labels": {
-              "location": "global",
-              "namespace": "",
-              "node_id": ""
+              "instance_id": "",
+              "zone": ""
             }
           },
           "jsonPayload": {
@@ -69,16 +65,15 @@
             "severity": "notice",
             "time": "Tue Apr 26 00:46:21.503003 2022"
           },
-          "timestamp": "2022-04-28T17:26:45.136110082Z"
+          "timestamp": "2022-05-02T12:16:14.574548493Z"
         },
         {
           "logName": "projects/fakeprojectid/logs/apache-error-fixture",
           "resource": {
-            "type": "generic_node",
+            "type": "gce_instance",
             "labels": {
-              "location": "global",
-              "namespace": "",
-              "node_id": ""
+              "instance_id": "",
+              "zone": ""
             }
           },
           "jsonPayload": {
@@ -86,16 +81,15 @@
             "severity": "notice",
             "time": "Tue Apr 26 00:46:38.988423 2022"
           },
-          "timestamp": "2022-04-28T17:26:45.136110082Z"
+          "timestamp": "2022-05-02T12:16:14.574548493Z"
         },
         {
           "logName": "projects/fakeprojectid/logs/apache-error-fixture",
           "resource": {
-            "type": "generic_node",
+            "type": "gce_instance",
             "labels": {
-              "location": "global",
-              "namespace": "",
-              "node_id": ""
+              "instance_id": "",
+              "zone": ""
             }
           },
           "jsonPayload": {
@@ -103,16 +97,15 @@
             "severity": "notice",
             "time": "Tue Apr 26 22:48:34.466058 2022"
           },
-          "timestamp": "2022-04-28T17:26:45.136110082Z"
+          "timestamp": "2022-05-02T12:16:14.574548493Z"
         },
         {
           "logName": "projects/fakeprojectid/logs/apache-error-fixture",
           "resource": {
-            "type": "generic_node",
+            "type": "gce_instance",
             "labels": {
-              "location": "global",
-              "namespace": "",
-              "node_id": ""
+              "instance_id": "",
+              "zone": ""
             }
           },
           "jsonPayload": {
@@ -120,17 +113,16 @@
             "severity": "warn",
             "time": "Tue Apr 26 22:48:34.740290 2022"
           },
-          "timestamp": "2022-04-28T17:26:45.136110082Z",
+          "timestamp": "2022-05-02T12:16:14.574548493Z",
           "severity": "WARNING"
         },
         {
           "logName": "projects/fakeprojectid/logs/apache-error-fixture",
           "resource": {
-            "type": "generic_node",
+            "type": "gce_instance",
             "labels": {
-              "location": "global",
-              "namespace": "",
-              "node_id": ""
+              "instance_id": "",
+              "zone": ""
             }
           },
           "jsonPayload": {
@@ -138,16 +130,15 @@
             "severity": "notice",
             "time": "Tue Apr 26 22:48:35.606223 2022"
           },
-          "timestamp": "2022-04-28T17:26:45.136110082Z"
+          "timestamp": "2022-05-02T12:16:14.574548493Z"
         },
         {
           "logName": "projects/fakeprojectid/logs/apache-error-fixture",
           "resource": {
-            "type": "generic_node",
+            "type": "gce_instance",
             "labels": {
-              "location": "global",
-              "namespace": "",
-              "node_id": ""
+              "instance_id": "",
+              "zone": ""
             }
           },
           "jsonPayload": {
@@ -155,7 +146,7 @@
             "severity": "notice",
             "time": "Tue Apr 26 22:48:35.606298 2022"
           },
-          "timestamp": "2022-04-28T17:26:45.136110082Z"
+          "timestamp": "2022-05-02T12:16:14.574548493Z"
         }
       ],
       "partialSuccess": true
diff --git a/exporter/collector/logs_test.go b/exporter/collector/logs_test.go
index 700e893..560f4f2 100644
--- a/exporter/collector/logs_test.go
+++ b/exporter/collector/logs_test.go
@@ -163,7 +163,7 @@ func TestLogMapping(t *testing.T) {
 			log: func() plog.LogRecord {
 				log := plog.NewLogRecord()
 				log.Attributes().Insert(
-					"com.google.sourceLocation",
+					SourceLocationAttributeKey,
 					pcommon.NewValueBytes([]byte(`{"file": "test.php", "line":100, "function":"helloWorld"}`)),
 				)
 				return log
@@ -255,7 +255,7 @@ func TestGetLogName(t *testing.T) {
 			name: "log with name attribute",
 			log: func() plog.LogRecord {
 				log := plog.NewLogRecord()
-				log.Attributes().Insert("com.google.logName", pcommon.NewValueString("foo-log"))
+				log.Attributes().Insert(LogNameAttributeKey, pcommon.NewValueString("foo-log"))
 				return log
 			},
 			expectedName: "foo-log",