Skip to content

Commit

Permalink
Mark prometheus exporter as mutable since it sorts attributes (#16498)
Browse files Browse the repository at this point in the history
Fixes #16498

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
  • Loading branch information
bogdandrutu authored Nov 28, 2022
1 parent e862b78 commit 96185a7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
12 changes: 12 additions & 0 deletions .chloggen/fixprommuta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: bug_fix

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: prometheusexporter

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Mark prometheus exporter as mutable since it sorts attributes

# One or more tracking issues related to the change
issues: [16499]

3 changes: 2 additions & 1 deletion exporter/prometheusexporter/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ func createMetricsExporter(
set,
cfg,
prometheus.ConsumeMetrics,
exporterhelper.WithCapabilities(consumer.Capabilities{MutatesData: false}),
// TODO: Consider to revert to non mutable data, need to not modify the incoming data, like sorting when calculating the signature.
exporterhelper.WithCapabilities(consumer.Capabilities{MutatesData: true}),
exporterhelper.WithStart(prometheus.Start),
exporterhelper.WithShutdown(prometheus.Shutdown),
)
Expand Down

0 comments on commit 96185a7

Please sign in to comment.