mirror of
https://github.com/hanzoai/otel-collector.git
synced 2026-11-03 02:20:04 +00:00
Brings in a copy of collector simulator from signoz query service. In a follow up, query service collector simulator will be removed and query service will starting using this collector simulator This change will unblock work on issues like https://github.com/SigNoz/engineering-pod/issues/1112 This change will also make it easier to maintain collector simulator whenever signoz-otel-collector is upgraded to a higher upstream version (eg: https://github.com/SigNoz/signoz/pull/6257/files#diff-943188c9097efb17b1b87d9f7166345f1520bb7277eda120832fc1897bf4c490R144) The code has been copied over as-is from https://github.com/SigNoz/signoz/tree/develop/pkg/query-service/collectorsimulator with minor changes to use `error` instead of `*model.ApiError`
17 lines
351 B
Go
17 lines
351 B
Go
package inmemoryreceiver
|
|
|
|
import "fmt"
|
|
|
|
type Config struct {
|
|
// Unique id for the receiver.
|
|
// Useful for getting a hold of the receiver in code that doesn't control its instantiation.
|
|
Id string `mapstructure:"id"`
|
|
}
|
|
|
|
func (c *Config) Validate() error {
|
|
if len(c.Id) < 1 {
|
|
return fmt.Errorf("inmemory receiver: id is required")
|
|
}
|
|
return nil
|
|
}
|