Skip to content

Commit

Permalink
Fix linter failures due to naming convention
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksmaus committed Jul 23, 2024
1 parent b7a5def commit abd9159
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions exporter/elasticsearchexporter/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,10 @@ func (e *elasticsearchExporter) pushLogsData(ctx context.Context, ld plog.Logs)
func (e *elasticsearchExporter) pushLogRecord(
ctx context.Context,
resource pcommon.Resource,
resourceSchemaUrl string,
resourceSchemaURL string,
record plog.LogRecord,
scope pcommon.InstrumentationScope,
scopeSchemaUrl string,
scopeSchemaURL string,
bulkIndexerSession bulkIndexerSession,
) error {
fIndex := e.index
Expand All @@ -153,7 +153,7 @@ func (e *elasticsearchExporter) pushLogRecord(
fIndex = formattedIndex
}

document, err := e.model.encodeLog(resource, resourceSchemaUrl, record, scope, scopeSchemaUrl)
document, err := e.model.encodeLog(resource, resourceSchemaURL, record, scope, scopeSchemaURL)
if err != nil {
return fmt.Errorf("failed to encode log event: %w", err)
}
Expand Down
12 changes: 6 additions & 6 deletions exporter/elasticsearchexporter/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,13 @@ const (
attributeField = "attribute"
)

func (m *encodeModel) encodeLog(resource pcommon.Resource, resourceSchemaUrl string, record plog.LogRecord, scope pcommon.InstrumentationScope, scopeSchemaUrl string) ([]byte, error) {
func (m *encodeModel) encodeLog(resource pcommon.Resource, resourceSchemaURL string, record plog.LogRecord, scope pcommon.InstrumentationScope, scopeSchemaURL string) ([]byte, error) {
var document objmodel.Document
switch m.mode {
case MappingECS:
document = m.encodeLogECSMode(resource, record, scope)
case MappingOTel:
document = m.encodeLogOTelMode(resource, resourceSchemaUrl, record, scope, scopeSchemaUrl)
document = m.encodeLogOTelMode(resource, resourceSchemaURL, record, scope, scopeSchemaURL)
default:
document = m.encodeLogDefaultMode(resource, record, scope)
}
Expand Down Expand Up @@ -132,7 +132,7 @@ func (m *encodeModel) encodeLogDefaultMode(resource pcommon.Resource, record plo

var datastreamKeys = []string{dataStreamType, dataStreamDataset, dataStreamNamespace}

func (m *encodeModel) encodeLogOTelMode(resource pcommon.Resource, resourceSchemaUrl string, record plog.LogRecord, scope pcommon.InstrumentationScope, scopeSchemaUrl string) objmodel.Document {
func (m *encodeModel) encodeLogOTelMode(resource pcommon.Resource, resourceSchemaURL string, record plog.LogRecord, scope pcommon.InstrumentationScope, scopeSchemaURL string) objmodel.Document {
var document objmodel.Document

docTimeStamp := record.Timestamp()
Expand Down Expand Up @@ -173,7 +173,7 @@ func (m *encodeModel) encodeLogOTelMode(resource pcommon.Resource, resourceSchem
// Resource
resourceMapVal := pcommon.NewValueMap()
resourceMap := resourceMapVal.Map()
resourceMap.PutStr("schema_url", resourceSchemaUrl)
resourceMap.PutStr("schema_url", resourceSchemaURL)
resourceMap.PutInt("dropped_attributes_count", int64(resource.DroppedAttributesCount()))
resourceAttrMap := resourceMap.PutEmptyMap("attributes")

Expand All @@ -195,8 +195,8 @@ func (m *encodeModel) encodeLogOTelMode(resource pcommon.Resource, resourceSchem
if scope.Version() != "" {
scopeMap.PutStr("version", scope.Version())
}
if scopeSchemaUrl != "" {
scopeMap.PutStr("schema_url", scopeSchemaUrl)
if scopeSchemaURL != "" {
scopeMap.PutStr("schema_url", scopeSchemaURL)
}
if scope.DroppedAttributesCount() > 0 {
scopeMap.PutInt("dropped_attributes_count", int64(scope.DroppedAttributesCount()))
Expand Down

0 comments on commit abd9159

Please sign in to comment.