Skip to content

Commit

Permalink
fixed pkg/stanza failed checks
Browse files Browse the repository at this point in the history
  • Loading branch information
bhogayatakb committed Jun 27, 2024
1 parent 2c1481d commit 762a760
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 115 deletions.
34 changes: 0 additions & 34 deletions pkg/stanza/operator/parser/json/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,9 @@
package json // import "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/parser/json"

import (
"context"
"fmt"

jsoniter "github.com/json-iterator/go"
"go.opentelemetry.io/collector/component"

"github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/entry"
"github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator"
"github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/helper"
)
Expand Down Expand Up @@ -50,33 +46,3 @@ func (c Config) Build(set component.TelemetrySettings) (operator.Operator, error
json: jsoniter.ConfigFastest,
}, nil
}

// Parser is an operator that parses JSON.
type Parser struct {
helper.ParserOperator
json jsoniter.API
}

// Process will parse an entry for JSON.
func (j *Parser) Process(ctx context.Context, entry *entry.Entry) error {
return j.ParserOperator.ProcessWith(ctx, entry, j.parse)
}

// parse will parse a value as JSON.
func (j *Parser) parse(value interface{}) (interface{}, error) {
fmt.Println(value)
if j.Flatten == true {
fmt.Println("Requested for flatten...!!")
}
var parsedValue map[string]interface{}
switch m := value.(type) {
case string:
err := j.json.UnmarshalFromString(m, &parsedValue)
if err != nil {
return nil, err
}
default:
return nil, fmt.Errorf("type %T cannot be parsed as JSON", value)
}
return parsedValue, nil
}
42 changes: 0 additions & 42 deletions receiver/k8seventsreceiver/log_agent_success.go

This file was deleted.

34 changes: 0 additions & 34 deletions receiver/k8seventsreceiver/log_agent_success_test.go

This file was deleted.

5 changes: 0 additions & 5 deletions receiver/k8seventsreceiver/receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,6 @@ func newReceiver(
func (kr *k8seventsReceiver) Start(ctx context.Context, _ component.Host) error {
kr.ctx, kr.cancel = context.WithCancel(ctx)

// Adding a log entry to indicate that the receiver has started successfully.
ld := logk8sClusterSuccessMessage(kr.settings.Logger)
consumerErr := kr.logsConsumer.ConsumeLogs(ctx, ld)
kr.obsrecv.EndLogsOp(ctx, metadata.Type, 1, consumerErr)

k8sInterface, err := kr.config.getK8sClient()
if err != nil {
return err
Expand Down

0 comments on commit 762a760

Please sign in to comment.