Skip to content

json: cannot unmarshal string into Go struct field MetricValue.tags of type map[string]string #26

@ttt777t7

Description

@ttt777t7

1、通过prometheus-exporter-collector收集的数据如下
[{
"metric": "redis_commands_processed_total",
"endpoint": "127.0.0.1",
"timestamp": 1631013680,
"step": 0,
"value": 1970,
"counterType": "COUNTER",
"tags": "aaa=hellw,dept=cloud",
"tagsMap": {},
"extra": ""
},
{
"metric": "redis_memory_used_peak_bytes",
"endpoint": "127.0.0.1",
"timestamp": 1631013680,
"step": 0,
"value": 813360,
"counterType": "GAUGE",
"tags": "aaa=hellw,dept=cloud",
"tagsMap": {},
"extra": ""
}
]
2、server端的日志却提示tags是map格式,这个是已知问题吗?
json: cannot unmarshal string into Go struct field MetricValue.tags of type map[string]string

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