Skip to content
This repository was archived by the owner on Aug 30, 2023. It is now read-only.
This repository was archived by the owner on Aug 30, 2023. It is now read-only.

Fix tag merging implementation to be on-spec #6

Closed
@taylortrimble

Description

@taylortrimble

From the spec:

Tags are key/value pairs that describe an event. They should be configurable in the > following contexts:

  • Environment (client-level)
  • Thread (block-level)
  • Event (as part of capture)

Each of these should inherit its parent. So for example, if you configure your client as so:

client = Client(..., {
    'tags': {'foo': 'bar'},
})

And then you capture an event:

client.captureMessage('test', {
    'tags': {'foo': 'baz'},
})

The client should send the following upstream for tags:

{
    "tags": [
        ["foo", "bar"],
        ["foo", "baz"]
    ],
}

What does this mean for us? We should rethink how we merge tags, and allow duplicate "keys" by making packet.Tags something like this:

type Tag struct {
    Key   string,
    Value string
}

type Packet struct {
    ...
    Tags       []Tag      `json:"tags,omitempty"`
    ...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions