Skip to content

Commit

Permalink
Decoupled API version and Schema version. Fixed Record datatype (#1346)
Browse files Browse the repository at this point in the history
  • Loading branch information
jerrytfleung authored Jun 13, 2024
1 parent e6ef326 commit 6867c50
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
7 changes: 5 additions & 2 deletions collector/internal/telemetryapi/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,11 @@ import (
)

const (
ApiVersion20220701 = "2022-07-01"
ApiVersionLatest = ApiVersion20220701
SchemaVersion20220701 = "2022-07-01"
SchemaVersionLatest = SchemaVersion20220701
SchemaVersion20221213 = "2022-12-13"
SchemaVersionLatest = SchemaVersion20221213
lambdaAgentIdentifierHeaderKey = "Lambda-Extension-Identifier"
)

Expand All @@ -42,7 +45,7 @@ func NewClient(logger *zap.Logger) *Client {
return &Client{
logger: logger.Named("telemetryAPI.Client"),
httpClient: &http.Client{},
baseURL: fmt.Sprintf("http://%s/%s/telemetry", os.Getenv("AWS_LAMBDA_RUNTIME_API"), SchemaVersionLatest),
baseURL: fmt.Sprintf("http://%s/%s/telemetry", os.Getenv("AWS_LAMBDA_RUNTIME_API"), ApiVersionLatest),
}
}

Expand Down
6 changes: 3 additions & 3 deletions collector/receiver/telemetryapireceiver/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
package telemetryapireceiver // import "github.com/open-telemetry/opentelemetry-lambda/collector/receiver/telemetryapireceiver"

type event struct {
Time string `json:"time"`
Type string `json:"type"`
Record map[string]any `json:"record"`
Time string `json:"time"`
Type string `json:"type"`
Record any `json:"record"`
}

0 comments on commit 6867c50

Please sign in to comment.