@@ -10,6 +10,8 @@ import (
10
10
11
11
"github.com/axiomhq/axiom-go/axiom"
12
12
"go.uber.org/zap"
13
+
14
+ "github.com/axiomhq/axiom-lambda-extension/version"
13
15
)
14
16
15
17
type Server struct {
30
32
AWS_LAMBDA_INITIALIZATION_TYPE = os .Getenv ("AWS_LAMBDA_INITIALIZATION_TYPE" )
31
33
AWS_LAMBDA_FUNCTION_MEMORY_SIZE , _ = strconv .ParseInt (os .Getenv ("AWS_LAMBDA_FUNCTION_MEMORY_SIZE" ), 10 , 32 )
32
34
lambdaMetaInfo = map [string ]any {}
35
+ axiomMetaInfo = map [string ]string {}
33
36
)
34
37
35
38
func init () {
@@ -43,6 +46,9 @@ func init() {
43
46
"memorySizeMB" : AWS_LAMBDA_FUNCTION_MEMORY_SIZE ,
44
47
"version" : AWS_LAMBDA_FUNCTION_VERSION ,
45
48
}
49
+ axiomMetaInfo = map [string ]string {
50
+ "awsLambdaExtensionVersion" : version .Get (),
51
+ }
46
52
}
47
53
48
54
func New (port string , axClient * axiom.Client , axDataset string ) * Server {
@@ -78,6 +84,7 @@ func (s *Server) httpHandler(w http.ResponseWriter, r *http.Request) {
78
84
for _ , e := range events {
79
85
// attach the lambda information to the event
80
86
e ["lambda" ] = lambdaMetaInfo
87
+ e ["axiom" ] = axiomMetaInfo
81
88
// replace the time field with axiom's _time
82
89
e ["_time" ], e ["time" ] = e ["time" ], nil
83
90
}
0 commit comments