Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure /debug/vars tags are not base64 encoded #7179

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

- [#1834](https://github.com/influxdata/influxdb/issues/1834): Drop time when used as a tag or field key.
- [#7152](https://github.com/influxdata/influxdb/issues/7152): Decrement number of measurements only once when deleting the last series from a measurement.
- [#7177](https://github.com/influxdata/influxdb/issues/7177): Fix base64 encoding issue with /debug/vars tags.

## v1.0.0 [unreleased]

Expand Down Expand Up @@ -144,6 +145,7 @@ With this release the systemd configuration files for InfluxDB will use the syst
- [#7127](https://github.com/influxdata/influxdb/pull/7127): Concurrent series limit
- [#7119](https://github.com/influxdata/influxdb/pull/7119): Fix CREATE DATABASE when dealing with default values.


## v0.13.0 [2016-05-12]

### Release Notes
Expand Down
17 changes: 17 additions & 0 deletions models/points.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package models // import "github.com/influxdata/influxdb/models"
import (
"bytes"
"encoding/binary"
"encoding/json"
"errors"
"fmt"
"hash/fnv"
Expand Down Expand Up @@ -1396,6 +1397,22 @@ type Tag struct {
Value []byte
}

// MarshalJSON implements the json.Marshaler interface.
//
// When Tags are marshalled to a JSON representation it is helpful if they're
// represented as readable strings, rather than the base64 encoded strings which
// are emitted when encoding a []byte.
func (t Tag) MarshalJSON() ([]byte, error) {
var out = struct {
Key string `json:"key"`
Value string `json:"value"`
}{
Key: string(t.Key),
Value: string(t.Value),
}
return json.Marshal(out)
}

// Tags represents a sorted list of tags.
type Tags []Tag

Expand Down