Skip to content

[awslogsencodingextension] Establish a standard format for custom timestamp fields #43392

@MichaelKatsoulis

Description

@MichaelKatsoulis

Component(s)

extension/encoding/awslogsencoding

Describe the issue you're reporting

Problem

The awslogsencodingextension currently has no established handling of custom timestamp fields that are not the official record timestamp:

  1. VPC Flow Logs: aws.vpc.flow.start field uses int64 (Unix seconds since epoch)
  2. Future timestamp fields: No standard for how custom timestamp fields should be formatted

The official record timestamps are correctly handled as nanoseconds since epoch (OpenTelemetry standard), but custom timestamp fields like aws.vpc.flow.start need a consistent approach.

Current State

Field Type Format Issue
aws.vpc.flow.start int64 Seconds since epoch Inconsistent with semconv patterns
Record timestamps int64 Nanoseconds since epoch Correct (OpenTelemetry standard)

Problem Details

  • SemConv patterns: Semantic conventions don't have a way to set a field as a date type. In most existing semconv fields ISO-8601 formatted date is used. Few are also in nanoseconds since epoch
  • Consistency: Need a standard for future custom timestamp fields
  • Consumer Experience: Integer timestamps are not human-readable. They require additional handling from extension consumers

Proposed Solution

Standard for Custom Timestamp Fields:

  • Type: string
  • Format: ISO-8601 with millisecond precision
  • Pattern: "2006-01-02T15:04:05.000Z"
  • Timezone: UTC (indicated by Z suffix)

Examples

Current :

{
  "timestamp": 1609459200000000000,           // Record timestamp (nanoseconds) 
  "aws.vpc.flow.start": 1609459200            // Custom field (seconds) 
}

Proposed:

{
  "timestamp": 1609459200000000000,           // Record timestamp (nanoseconds) 
  "aws.vpc.flow.start": "2021-01-01T00:00:00.000Z"  // Custom field (ISO-8601) 
}

Decision

After discussions in the issue we decided to go with RFC3339Nano for nanoseconds precision.

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions