Documentation ¶
Index ¶
- Constants
- func NewFactory() extension.Factory
- type Config
- type ErrorAPI
- type SumologicExtension
- func (se *SumologicExtension) BaseURL() string
- func (se *SumologicExtension) CollectorID() string
- func (se *SumologicExtension) ComponentID() component.ID
- func (se *SumologicExtension) CreateCredentialsHeader() (http.Header, error)
- func (se *SumologicExtension) PerRPCCredentials() (grpccredentials.PerRPCCredentials, error)
- func (se *SumologicExtension) RoundTripper(base http.RoundTripper) (http.RoundTripper, error)
- func (se *SumologicExtension) SetBaseURL(baseURL string)
- func (se *SumologicExtension) SetStickySessionCookie(stickySessionCookie string)
- func (se *SumologicExtension) Shutdown(ctx context.Context) error
- func (se *SumologicExtension) Start(ctx context.Context, host component.Host) error
- func (se *SumologicExtension) StickySessionCookie() string
- func (se *SumologicExtension) WatchCredentialKey(ctx context.Context, old string) string
Constants ¶
const (
// The value of extension "type" in configuration.
DefaultAPIBaseURL = "https://open-collectors.sumologic.com"
)
const (
DefaultHeartbeatInterval = 15 * time.Second
)
Variables ¶
This section is empty.
Functions ¶
func NewFactory ¶
NewFactory creates a factory for Sumo Logic extension.
Types ¶
type Config ¶
type Config struct { // squash ensures fields are correctly decoded in embedded struct. confighttp.ClientConfig `mapstructure:",squash"` // Credentials contains Installation Token for Sumo Logic service. // Please refer to https://help.sumologic.com/docs/manage/security/installation-tokens // for detailed instructions how to obtain the token. Credentials accessCredentials `mapstructure:",squash"` // CollectorName is the name under which collector will be registered. // Please note that registering a collector under a name which is already // used is not allowed. CollectorName string `mapstructure:"collector_name"` // CollectorEnvironment is the environment which will be used when updating // the collector metadata. CollectorEnvironment string `mapstructure:"collector_environment"` // CollectorDescription is the description which will be used when the // collector is being registered. CollectorDescription string `mapstructure:"collector_description"` // CollectorCategory is the collector category which will be used when the // collector is being registered. CollectorCategory string `mapstructure:"collector_category"` // CollectorFields defines the collector fields. // For more information on this subject visit: // https://help.sumologic.com/docs/manage/fields CollectorFields map[string]any `mapstructure:"collector_fields"` // DiscoverCollectorTags enables collector metadata tag auto-discovery. DiscoverCollectorTags bool `mapstructure:"discover_collector_tags"` APIBaseURL string `mapstructure:"api_base_url"` HeartBeatInterval time.Duration `mapstructure:"heartbeat_interval"` // CollectorCredentialsDirectory is the directory where state files // with collector credentials will be stored after successful collector // registration. Default value is $HOME/.sumologic-otel-collector CollectorCredentialsDirectory string `mapstructure:"collector_credentials_directory"` // Clobber defines whether to delete any existing collector with the same // name and create a new one upon registration. // By default this is false. Clobber bool `mapstructure:"clobber"` // ForceRegistration defines whether to force registration every time the // collector starts. // This will cause the collector to not look at the locally stored credentials // and to always reach out to API to register itself. // // NOTE: if clobber is unset (default) then setting this to true will create // a new collector on Sumo UI on every collector start. // // By default this is false. ForceRegistration bool `mapstructure:"force_registration"` // Ephemeral defines whether the collector will be deleted after 12 hours // of inactivity. // By default this is false. Ephemeral bool `mapstructure:"ephemeral"` // TimeZone defines the time zone of the Collector. // For a list of possible values, refer to the "TZ" column in // https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List. TimeZone string `mapstructure:"time_zone"` // BackOff defines configuration of collector registration backoff algorithm // Exponential algorithm is being used. // Please see following link for details: https://github.com/cenkalti/backoff BackOff backOffConfig `mapstructure:"backoff"` // StickySessionEnabled defines if sticky session support is enable. // By default this is false. StickySessionEnabled bool `mapstructure:"sticky_session_enabled"` }
Config has the configuration for the sumologic extension.
type SumologicExtension ¶
type SumologicExtension struct {
// contains filtered or unexported fields
}
func (*SumologicExtension) BaseURL ¶ added in v0.96.0
func (se *SumologicExtension) BaseURL() string
func (*SumologicExtension) CollectorID ¶ added in v0.96.0
func (se *SumologicExtension) CollectorID() string
func (*SumologicExtension) ComponentID ¶ added in v0.96.0
func (se *SumologicExtension) ComponentID() component.ID
func (*SumologicExtension) CreateCredentialsHeader ¶ added in v0.96.0
func (se *SumologicExtension) CreateCredentialsHeader() (http.Header, error)
CreateCredentialsHeader produces an HTTP header containing authentication credentials. This function is for components that do not make use of the RoundTripper or have an HTTP request to build upon.
func (*SumologicExtension) PerRPCCredentials ¶ added in v0.96.0
func (se *SumologicExtension) PerRPCCredentials() (grpccredentials.PerRPCCredentials, error)
func (*SumologicExtension) RoundTripper ¶ added in v0.96.0
func (se *SumologicExtension) RoundTripper(base http.RoundTripper) (http.RoundTripper, error)
Implement 1 in order for this extension to be used as custom exporter authenticator.
func (*SumologicExtension) SetBaseURL ¶ added in v0.96.0
func (se *SumologicExtension) SetBaseURL(baseURL string)
func (*SumologicExtension) SetStickySessionCookie ¶ added in v0.96.0
func (se *SumologicExtension) SetStickySessionCookie(stickySessionCookie string)
func (*SumologicExtension) Shutdown ¶
func (se *SumologicExtension) Shutdown(ctx context.Context) error
Shutdown is invoked during service shutdown.
func (*SumologicExtension) StickySessionCookie ¶ added in v0.96.0
func (se *SumologicExtension) StickySessionCookie() string
func (*SumologicExtension) WatchCredentialKey ¶ added in v0.96.0
func (se *SumologicExtension) WatchCredentialKey(ctx context.Context, old string) string
WatchCredentialKey watches for credential key updates. It makes use of a channel close (done by injectCredentials) and string comparison with a known/previous credential key (old). This function allows components to be proactive when dealing with changes to authentication.