Skip to content

fileexporter is not encoding traceId according to specification #36095

Closed
@ncabanis

Description

@ncabanis

Component(s)

exporter/file

What happened?

Description

Traces written using the fileexporter have traceId, spanId or parentSpanId not base64 encoded.
This leads to errors, when reading the JSON files back in.

Steps to Reproduce

Expected Result

Use proto3 standard defined JSON Mapping for mapping between protobuf and json. trace_id and span_id is base64 encoded in OTLP/HTTP+JSON.
See: https://github.com/open-telemetry/oteps/blob/main/text/0122-otlp-http-json.md#json-mapping

Example:

        "traceId": "bHE84Qqb0uYWr9oebVYwsA==",
        "spanId": "ygGTpeX0WXc=",
        "parentSpanId": "wcxj0FhL6CU=",

Actual Result

Example:

              "traceId": "345b5f5b69e9d28a1fac695cb5e20543",
              "spanId": "02765e6140c37e6c",
              "parentSpanId": "b8271c949767b3ca",

Collector version

v106.1

Environment information

Environment

OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")

OpenTelemetry Collector configuration

exporters:
      file:
        path: /data/traces.json
        rotation:
          max_days: 3
          max_megabytes: 10
          max_backups: 15
        format: json

Log output

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions