Skip to content

Commit

Permalink
JSON Convert Values for prometheus collector
Browse files Browse the repository at this point in the history
  • Loading branch information
Arvind2222 committed Apr 7, 2022
1 parent f81381c commit 4883455
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased](https://github.com/open-telemetry/opentelemetry-python/compare/v1.10.0-0.29b0...HEAD)

- JSON Based Conversion for native Prometheus Exporter, Default to String
([#2589](https://github.com/open-telemetry/opentelemetry-python/pull/2589))
- Fix parsing of trace flags when extracting traceparent
([#2577](https://github.com/open-telemetry/opentelemetry-python/pull/2577))
- Add default aggregation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"""

import collections
import json
import logging
import re
from itertools import chain
Expand Down Expand Up @@ -157,7 +158,7 @@ def _translate_to_prometheus(
label_keys = []
for key, value in metric.attributes.items():
label_keys.append(self._sanitize(key))
label_values.append(str(value))
label_values.append(json.dumps(value, default=str))

metric_name = ""
if self._prefix != "":
Expand Down

0 comments on commit 4883455

Please sign in to comment.