Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

- Change `AssertEqual` in `go.opentelemetry.io/otel/log/logtest` to accept `TestingT` in order to support benchmarks and fuzz tests. (#6908)
- Change `SDKProcessorLogQueueCapacity`, `SDKProcessorLogQueueSize`, `SDKProcessorSpanQueueSize`, and `SDKProcessorSpanQueueCapacity` in `go.opentelemetry.io/otel/semconv/v1.36.0/otelconv` to use a `Int64ObservableUpDownCounter`. (#7041)
- Change `go.opentelemetry.io/otel/exporters/prometheus` to no longer deduplicate suffixes when UTF8 is enabled.
It is recommended to disable unit and counter suffixes in the exporter, and manually add suffixes if you rely
on the existing behavior. (#7044)
Comment thread
dashpole marked this conversation as resolved.
Outdated

### Fixed

- Fix `go.opentelemetry.io/otel/exporters/prometheus` to properly handle unit suffixes when the unit is in brackets.
E.g. `{spans}`. (#7044)

<!-- Released section -->
<!-- Don't change this section unless doing release -->
Expand Down
13 changes: 0 additions & 13 deletions exporters/prometheus/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@
package prometheus // import "go.opentelemetry.io/otel/exporters/prometheus"

import (
"strings"
"sync"

"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/common/model"

"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/internal/global"
Expand Down Expand Up @@ -139,17 +137,6 @@ func WithoutScopeInfo() Option {
// have special behavior based on their name.
func WithNamespace(ns string) Option {
return optionFunc(func(cfg config) config {
if model.NameValidationScheme != model.UTF8Validation { // nolint:staticcheck // We need this check to keep supporting the legacy scheme.
logDeprecatedLegacyScheme()
// Only sanitize if prometheus does not support UTF-8.
ns = model.EscapeName(ns, model.NameEscapingScheme)
}
if !strings.HasSuffix(ns, "_") {
// namespace and metric names should be separated with an underscore,
// adds a trailing underscore if there is not one already.
ns = ns + "_"
}

cfg.namespace = ns
return cfg
})
Expand Down
8 changes: 4 additions & 4 deletions exporters/prometheus/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,17 @@ func TestNewConfig(t *testing.T) {
},
wantConfig: config{
registerer: prometheus.DefaultRegisterer,
namespace: "test_",
namespace: "test",
},
},
{
name: "with namespace with trailing underscore",
options: []Option{
WithNamespace("test_"),
WithNamespace("test"),
},
wantConfig: config{
registerer: prometheus.DefaultRegisterer,
namespace: "test_",
namespace: "test",
},
},
{
Expand All @@ -133,7 +133,7 @@ func TestNewConfig(t *testing.T) {
},
wantConfig: config{
registerer: prometheus.DefaultRegisterer,
namespace: "test/_",
namespace: "test/",
},
},
}
Expand Down
Loading
Loading