Skip to content

Commit

Permalink
[exporter/prometheusremotewrite] deprecate export_created_metric
Browse files Browse the repository at this point in the history
  • Loading branch information
pokgak committed Nov 5, 2024
1 parent 57caf5f commit ff2e575
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .chloggen/35003-deprecate-export_created_metric.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: deprecation

# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
component: exporter/prometheusremotewrite

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: deprecate export_created metric

# One or more tracking issues or pull requests related to the change
issues: [35003]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:

# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: [user]
1 change: 1 addition & 0 deletions exporter/prometheusremotewriteexporter/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ type Config struct {
TargetInfo *TargetInfo `mapstructure:"target_info,omitempty"`

// CreatedMetric allows customizing creation of _created metrics
// Deprecated: This feature is useless in PRWv1 and and PRWv2 already have the created timestamp in the proto
CreatedMetric *CreatedMetric `mapstructure:"export_created_metric,omitempty"`

// AddMetricSuffixes controls whether unit and type suffixes are added to metrics on export
Expand Down
4 changes: 4 additions & 0 deletions exporter/prometheusremotewriteexporter/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ func newPRWExporter(cfg *Config, set exporter.Settings) (*prwExporter, error) {
batchTimeSeriesState: newBatchTimeSericesState(),
}

if prwe.exporterSettings.ExportCreatedMetric {
prwe.settings.Logger.Warn("export_created_metric is deprecated and will be removed in a future release")
}

prwe.wal = newWAL(cfg.WAL, prwe.export)
return prwe, nil
}
Expand Down

0 comments on commit ff2e575

Please sign in to comment.