Skip to content

Zero value wall times cause backend failures when spans are uploaded #488

@philwebb

Description

@philwebb

Describe the bug
Please see spring-projects/spring-boot#38579 for background.

Environment

  • Micrometer version 1.12.0

To Reproduce
How to reproduce the bug:
See reproducer in linked issue.

Expected behavior
The JSON payload does not include invalid timestamps:

  {                                                                                                       
    "traceId": "XXXX",                                                        
    "parentId": "XXXX",                                                                       
    "id": "XXXX",                                                                             
    "kind": "CLIENT",                                                                                     
    "name": "connection",                                                                                 
    "timestamp": 1702045951598046,                                                                        
    "duration": 6111,                                                                                     
    "localEndpoint": {                                                                                    
      "serviceName": "XXXX",
      "ipv4": "XXXX"
    },                                                                                                    
    "annotations": [                                                                                      
      {                                                                                                   
        "timestamp": 0,                                                                                   
        "value": "\"acquired\":{}"                                                                        
      },                                                                                                  
      {                                                                                                   
        "timestamp": 0,                                                                                   
        "value": "\"commit\":{}"                                                                          
      }                                                                                                   
    ],                                                                                                    
    "tags": {                                                                                             
      "jdbc.datasource.driver": "org.postgresql.Driver",                                                  
      "jdbc.datasource.pool": "HikariPool-1",                                                             
      "otel.library.name": "org.springframework.boot",                                                    
      "otel.library.version": "3.2.0",                                                                    
      "otel.scope.name": "org.springframework.boot",                                                      
      "otel.scope.version": "3.2.0"                                                                       
    }                                                                                                     
  }, 

Additional context
In 1.12.0 the Observation.Event.getWallTime() method was added with a default return of 0. Users that call Event.of will have an event that includes the correct walltime, but users that implement Event directly will always return 0.

These 0 values are not valid and should not be passed to the backend.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA general bug

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions