diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/exporter/fieldstat_exporter.py | 12 | ||||
| -rw-r--r-- | src/fieldstat_easy.c | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/exporter/fieldstat_exporter.py b/src/exporter/fieldstat_exporter.py index 7b21451..887c5e9 100644 --- a/src/exporter/fieldstat_exporter.py +++ b/src/exporter/fieldstat_exporter.py @@ -210,9 +210,9 @@ class PrometheusExporter: fcntl.flock(file, fcntl.LOCK_UN) for item in json_data: # the item has __name__ in its global tag, move it to the name - if "__name__" in item["tags"]: - item["name"] = item["tags"]["__name__"] - item["tags"].pop("__name__", None) + if "name" in item["tags"]: + item["name"] = item["tags"]["name"] + item["tags"].pop("name", None) else: item["name"] = "-" payload += self.__build_metrics(item) @@ -652,9 +652,9 @@ class LocalExporter: try: objects = json.load(fd) for obj in objects: - if "__name__" in obj["tags"]: - obj["name"] = obj["tags"]["__name__"] - obj["tags"].pop("__name__", None) + if "name" in obj["tags"]: + obj["name"] = obj["tags"]["name"] + obj["tags"].pop("name", None) else: obj["name"] = "-" diff --git a/src/fieldstat_easy.c b/src/fieldstat_easy.c index 19092ea..ed94484 100644 --- a/src/fieldstat_easy.c +++ b/src/fieldstat_easy.c @@ -130,7 +130,7 @@ struct fieldstat_easy *fieldstat_easy_new(int max_thread_num, const char *name, if (name != NULL) { struct field *global_dimension_more = malloc(sizeof(struct field) * (n_dimension + 1)); - global_dimension_more[0].key = "__name__"; + global_dimension_more[0].key = "name"; global_dimension_more[0].value_str = name; global_dimension_more[0].type = FIELD_VALUE_CSTRING; for (size_t i = 0; i < n_dimension; i++) { |
