Skip to content
This repository has been archived by the owner on May 25, 2022. It is now read-only.

windows_eventlog_input: Nicer error when metadata request fails #206

Closed
jsirianni opened this issue Jun 24, 2021 · 1 comment
Closed

windows_eventlog_input: Nicer error when metadata request fails #206

jsirianni opened this issue Jun 24, 2021 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@jsirianni
Copy link
Member

Windows event log input has two stages

  1. Read events from Windows Event
  2. Request metadata from Windows Events pertaining to the event in step 1.

Step 2 can fail if the event is old enough, this will produce an error like this:

Failed to open publisher: failed to open publisher handle: The system cannot find the file specified."

This error indicates a failure and does not mention that the event will still be processed in the pipeline, just without metadata. It would be nice if the error included information like "writing log entry to pipeline without metadata".

	publisher := NewPublisher()
	if err := publisher.Open(simpleEvent.Provider.Name); err != nil {
                // error is produced here
		e.Errorf("Failed to open publisher: %s")
                // event is written to the pipeline here
		e.sendEvent(ctx, simpleEvent)
		return
	}
	defer publisher.Close()

See https://github.com/open-telemetry/opentelemetry-log-collection/blob/main/operator/builtin/input/windows/operator.go#L204

This error is easily re-produced on windows systems with old events using the start_at: beginning parameter.

@jsirianni jsirianni added enhancement New feature or request good first issue Good for newcomers labels Jun 24, 2021
lastchiliarch added a commit to lastchiliarch/opentelemetry-log-collection that referenced this issue Jul 8, 2021
djaglowski pushed a commit that referenced this issue Jul 8, 2021
@djaglowski
Copy link
Member

Resolved by #206

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants