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

Exporter/Prometheus: Allow to set custom namespace.#1850

Merged
songy23 merged 2 commits intocensus-instrumentation:masterfrom
songy23:prometheus-namespace-option
Apr 19, 2019
Merged

Exporter/Prometheus: Allow to set custom namespace.#1850
songy23 merged 2 commits intocensus-instrumentation:masterfrom
songy23:prometheus-namespace-option

Conversation

@songy23
Copy link
Copy Markdown
Contributor

@songy23 songy23 commented Apr 18, 2019

Reported offline by @paivagustavo.

Copy link
Copy Markdown
Contributor

@rghetia rghetia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread CHANGELOG.md Outdated
CUMULATIVE_METRIC_DESCRIPTOR, namespace2))
.isEqualTo(
new MetricFamilySamples(
"opencensus_" + METRIC_NAME,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be "opencensus/" + METRIC_NAME

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No because Promtheus exporter automatically sanitizes non-alphanumeric characters to underscores. See https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels:

It may contain ASCII letters and digits, as well as underscores and colons. It must match the regex [a-zA-Z_:][a-zA-Z0-9_:]*.

@songy23 songy23 merged commit d62a2e7 into census-instrumentation:master Apr 19, 2019
@songy23 songy23 deleted the prometheus-namespace-option branch April 19, 2019 02:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants