open-telemetry / open-telemetry/opentelemetry-cpp

Need a way to set 'key' field in jaeger span logs

Open
#2,299 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Stale triage/needs-information
Dominant language
C++
Stars
1.4k
Forks
632
Avg merge
1d 13h
Merged PRs (30d)
75

Description

Is your feature request related to a problem?
In Opentracing, it was possible to set the 'key' field in span logs, since the api took an array of key value pairs:
Span->Log({ { key, value } })

However, in opentelemetry's AddEvent api, you can only set a single log string, or optionally a timestamp and tags... there doesn't seem to be a way to get equivalent behavior as opentracing.

example:
"logs": [
{
"timestamp": 1691424565488606,
"fields": [
{
"key": "event", <--- How to set this?
"type": "string", <--- Or this?
"value": "log"
}

Describe the solution you'd like
A way to set the key field in jaeger span log

Describe alternatives you've considered
Seen the AddEvent overloads in class span

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the AddEvent overloads in the Span class and the Jaeger span-log representation shown in the issue. Compare them with the former OpenTracing key-value log behavior and determine the API and export changes needed. Done means callers can set the log field key and type, with tests confirming the resulting Jaeger span log.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
distributed-systems, observability-sre
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.