Skip to content

Commit

Permalink
[exporter/loki] do not expose method (#27050)
Browse files Browse the repository at this point in the history
Do not export the function `MetricViews` and pass checkapi.

#26304

Co-authored-by: Alex Boten <[email protected]>
  • Loading branch information
sakulali and Alex Boten authored Sep 21, 2023
1 parent 573c579 commit 104cb5f
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 3 deletions.
27 changes: 27 additions & 0 deletions .chloggen/lokiexporter-checkapi-26304.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Use this changelog template to create an entry for release notes.

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

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

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Do not export the function `MetricViews` and pass checkapi.

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [26304]

# (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:

# If your change doesn't affect end users or the exported elements of any package,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
# 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: [api]
1 change: 0 additions & 1 deletion cmd/checkapi/allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ exporter/awskinesisexporter
exporter/coralogixexporter
exporter/dynatraceexporter
exporter/kafkaexporter
exporter/lokiexporter
exporter/pulsarexporter
exporter/sentryexporter
exporter/sumologicexporter
Expand Down
2 changes: 1 addition & 1 deletion exporter/lokiexporter/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (

// NewFactory creates a factory for the legacy Loki exporter.
func NewFactory() exporter.Factory {
_ = view.Register(MetricViews()...)
_ = view.Register(metricViews()...)

return exporter.NewFactory(
metadata.Type,
Expand Down
2 changes: 1 addition & 1 deletion exporter/lokiexporter/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var (
lokiExporterFailedToSendLogRecordsDueToMissingLabels = stats.Int64("lokiexporter_send_failed_due_to_missing_labels", "Number of log records failed to send because labels were missing", stats.UnitDimensionless)
)

func MetricViews() []*view.View {
func metricViews() []*view.View {
return []*view.View{
{
Name: "lokiexporter_send_failed_due_to_missing_labels",
Expand Down

0 comments on commit 104cb5f

Please sign in to comment.