@@ -44,13 +44,7 @@ import (
4444const (
4545 initialQueueSize = 5
4646 scopeName = "github.com/open-telemetry/opentelemetry-lambda/collector/receiver/telemetryapi"
47-
48- logReportFmt = "REPORT RequestId: %s Duration: %.2f ms Billed Duration: %.0f ms Memory Size: %.0f MB Max Memory Used: %.0f MB"
49- metricBilledDurationMs = "billedDurationMs"
50- metricDurationMs = "durationMs"
51- metricMaxMemoryUsedMB = "maxMemoryUsedMB"
52- metricMemorySizeMB = "memorySizeMB"
53- metricInitDurationMs = "initDurationMs"
47+ logReportFmt = "REPORT RequestId: %s Duration: %.2f ms Billed Duration: %.0f ms Memory Size: %.0f MB Max Memory Used: %.0f MB"
5448)
5549
5650type telemetryAPIReceiver struct {
@@ -279,16 +273,16 @@ func createReportLogRecord(scopeLog *plog.ScopeLogs, record map[string]interface
279273 return nil
280274 }
281275 var durationMs , billedDurationMs , memorySizeMB , maxMemoryUsedMB float64
282- if durationMs , ok = metrics [metricDurationMs ].(float64 ); ! ok {
276+ if durationMs , ok = metrics [string ( telemetryapi . MetricDurationMs ) ].(float64 ); ! ok {
283277 return nil
284278 }
285- if billedDurationMs , ok = metrics [metricBilledDurationMs ].(float64 ); ! ok {
279+ if billedDurationMs , ok = metrics [string ( telemetryapi . MetricBilledDurationMs ) ].(float64 ); ! ok {
286280 return nil
287281 }
288- if memorySizeMB , ok = metrics [metricMemorySizeMB ].(float64 ); ! ok {
282+ if memorySizeMB , ok = metrics [string ( telemetryapi . MetricMemorySizeMB ) ].(float64 ); ! ok {
289283 return nil
290284 }
291- if maxMemoryUsedMB , ok = metrics [metricMaxMemoryUsedMB ].(float64 ); ! ok {
285+ if maxMemoryUsedMB , ok = metrics [string ( telemetryapi . MetricMaxMemoryUsedMB ) ].(float64 ); ! ok {
292286 return nil
293287 }
294288
0 commit comments