diff --git a/.chloggen/unexport-mezmo.yaml b/.chloggen/unexport-mezmo.yaml new file mode 100644 index 0000000000000..f2aaa9669a0f2 --- /dev/null +++ b/.chloggen/unexport-mezmo.yaml @@ -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: mezmoexporter + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Unexport the `MezmoLogLine` and `MezmoLogBody` structs + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [24842] + +# (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] diff --git a/exporter/mezmoexporter/exporter.go b/exporter/mezmoexporter/exporter.go index 1a7292b734784..b58845b31b980 100644 --- a/exporter/mezmoexporter/exporter.go +++ b/exporter/mezmoexporter/exporter.go @@ -29,7 +29,7 @@ type mezmoExporter struct { wg sync.WaitGroup } -type MezmoLogLine struct { +type mezmoLogLine struct { Timestamp int64 `json:"timestamp"` Line string `json:"line"` App string `json:"app"` @@ -37,8 +37,8 @@ type MezmoLogLine struct { Meta map[string]string `json:"meta"` } -type MezmoLogBody struct { - Lines []MezmoLogLine `json:"lines"` +type mezmoLogBody struct { + Lines []mezmoLogLine `json:"lines"` } func newLogsExporter(config *Config, settings component.TelemetrySettings, buildInfo component.BuildInfo, logger *zap.Logger) *mezmoExporter { @@ -71,7 +71,7 @@ func (m *mezmoExporter) stop(context.Context) (err error) { func (m *mezmoExporter) logDataToMezmo(ld plog.Logs) error { var errs error - var lines []MezmoLogLine + var lines []mezmoLogLine // Convert the log resources to mezmo lines... resourceLogs := ld.ResourceLogs() @@ -118,7 +118,7 @@ func (m *mezmoExporter) logDataToMezmo(ld plog.Logs) error { logLevel = "info" } - line := MezmoLogLine{ + line := mezmoLogLine{ Timestamp: tstamp, Line: truncateString(log.Body().Str(), maxMessageSize), App: truncateString(app, maxAppnameLen), diff --git a/exporter/mezmoexporter/exporter_test.go b/exporter/mezmoexporter/exporter_test.go index e7ec64a9cb612..f38c89196b9bd 100644 --- a/exporter/mezmoexporter/exporter_test.go +++ b/exporter/mezmoexporter/exporter_test.go @@ -109,7 +109,7 @@ type testServer struct { url string } -type httpAssertionCallback func(req *http.Request, body MezmoLogBody) (int, string) +type httpAssertionCallback func(req *http.Request, body mezmoLogBody) (int, string) type testServerParams struct { t *testing.T assertionsCallback httpAssertionCallback @@ -124,7 +124,7 @@ func createHTTPServer(params *testServerParams) testServer { params.t.Fatal(err) } - var logBody MezmoLogBody + var logBody mezmoLogBody if err = json.Unmarshal(body, &logBody); err != nil { w.WriteHeader(http.StatusUnprocessableEntity) } @@ -169,7 +169,7 @@ func createLogger() (*zap.Logger, *observer.ObservedLogs) { func TestLogsExporter(t *testing.T) { httpServerParams := testServerParams{ t: t, - assertionsCallback: func(req *http.Request, body MezmoLogBody) (int, string) { + assertionsCallback: func(req *http.Request, body mezmoLogBody) (int, string) { assert.Equal(t, "application/json", req.Header.Get("Content-Type")) assert.Equal(t, "mezmo-otel-exporter/"+buildInfo.Version, req.Header.Get("User-Agent")) return http.StatusOK, "" @@ -206,7 +206,7 @@ func TestLogsExporter(t *testing.T) { func TestAddsRequiredAttributes(t *testing.T) { httpServerParams := testServerParams{ t: t, - assertionsCallback: func(req *http.Request, body MezmoLogBody) (int, string) { + assertionsCallback: func(req *http.Request, body mezmoLogBody) (int, string) { assert.Equal(t, "application/json", req.Header.Get("Content-Type")) assert.Equal(t, "mezmo-otel-exporter/"+buildInfo.Version, req.Header.Get("User-Agent")) @@ -240,7 +240,7 @@ func Test404IngestError(t *testing.T) { httpServerParams := testServerParams{ t: t, - assertionsCallback: func(req *http.Request, body MezmoLogBody) (int, string) { + assertionsCallback: func(req *http.Request, body mezmoLogBody) (int, string) { return http.StatusNotFound, `{"foo":"bar"}` }, }