Skip to content

Commit 9f86a01

Browse files
committed
change model
1 parent 88eeaff commit 9f86a01

3 files changed

Lines changed: 19 additions & 25 deletions

File tree

aws/logs_monitoring_go/internal/model/cloudwatchlogs.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,23 @@
55

66
package model
77

8+
type CloudwatchLogEntry struct {
9+
ID string `json:"id"`
10+
Timestamp int64 `json:"timestamp"`
11+
Message string `json:"message"`
12+
Source string `json:"ddsource"`
13+
Service string `json:"service"`
14+
Host string `json:"hostname"`
15+
Tags []string `json:"ddtags"`
16+
AWS CloudwatchMetadata `json:"aws"`
17+
}
18+
19+
type CloudwatchMetadata struct {
20+
InvokedFunctionARN string `json:"invoked_function_arn"`
21+
FunctionVersion string `json:"function_version,omitempty"`
22+
Logs CloudwatchLogsContext `json:"awslogs"`
23+
}
24+
825
type CloudwatchLogsContext struct {
926
LogGroup string `json:"logGroup"`
1027
LogStream string `json:"logStream"`

aws/logs_monitoring_go/internal/model/log.go

Lines changed: 0 additions & 23 deletions
This file was deleted.

aws/logs_monitoring_go/internal/parsing/parsing.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const (
2121
invocationSourceCloudwatchLogs
2222
)
2323

24-
func Parse(ctx context.Context, event json.RawMessage, cfg *config.Config, out chan<- model.LogEntry) {
24+
func Parse(ctx context.Context, event json.RawMessage, cfg *config.Config, out chan<- model.CloudwatchLogEntry) {
2525
switch detectInvocationSource(event) {
2626
case invocationSourceCloudwatchLogs:
2727
parseCloudwatchLogs(ctx, event, cfg, out)
@@ -47,6 +47,6 @@ func detectInvocationSource(event json.RawMessage) invocationSource {
4747
return invocationSourceUnknown
4848
}
4949

50-
func parseCloudwatchLogs(ctx context.Context, event json.RawMessage, cfg *config.Config, out chan<- model.LogEntry) {
50+
func parseCloudwatchLogs(ctx context.Context, event json.RawMessage, cfg *config.Config, out chan<- model.CloudwatchLogEntry) {
5151

5252
}

0 commit comments

Comments
 (0)