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

Windows input fix #478

Merged
merged 3 commits into from
May 4, 2022
Merged

Conversation

armstrmi
Copy link
Contributor

@armstrmi armstrmi commented May 3, 2022

Changes

  • Implemented fix for the Windows Event Log Input Operator.
  • Main fix was to the xml.go file.
  • Added tests in xml_test.go and a sample WEL xml file

Link to Tracking Issue
#476

@codecov
Copy link

codecov bot commented May 3, 2022

Codecov Report

Merging #478 (df95d8a) into main (70fe7c7) will decrease coverage by 0.1%.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##            main    #478     +/-   ##
=======================================
- Coverage   77.0%   76.9%   -0.2%     
=======================================
  Files         85      85             
  Lines       4153    4153             
=======================================
- Hits        3200    3195      -5     
- Misses       669     673      +4     
- Partials     284     285      +1     
Impacted Files Coverage Δ
operator/transformer/recombine/recombine.go 75.6% <0.0%> (-2.1%) ⬇️
operator/input/tcp/tcp.go 78.4% <0.0%> (-1.6%) ⬇️

@armstrmi armstrmi marked this pull request as ready for review May 3, 2022 18:18
@armstrmi armstrmi requested a review from a team May 3, 2022 18:18
Copy link
Member

@djaglowski djaglowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a test or two to demonstrate the functionality?

Comment on lines +37 to +38
RenderedLevel string `xml:"RenderingInfo>Level"`
Level string `xml:"System>Level"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the issue description, it sounds like we might expect only one or the other of these. Is that right? If so, should we parse both here and only set whichever one is populated?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be correct, only one of these would be populated, that being said I'm sure that could be done to only populate one of the fields. But I do have a question about that, would this mean getting rid of the RenderedLevel field of the EventXML struct, or simply removing that field from the output?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would expect that it only requires a change to the body of the log that is emitted.

Copy link
Contributor

@BinaryFissionGames BinaryFissionGames May 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to clarify, both may be populated in the XML. The RenderingInfo tag contains the "friendly" versions of these fields, for instance, System>Level may be 4, but RenderingInfo>Level would be Informational. In this case, both would be present on the XML returned from windows.

Only populating one field might make sense for the sake of removing redundancy, but I just want to clarify.

@armstrmi
Copy link
Contributor Author

armstrmi commented May 4, 2022

Can you add a test or two to demonstrate the functionality?

@djaglowski there should be some tests in there now

Copy link
Contributor

@BinaryFissionGames BinaryFissionGames left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me,

Copy link
Member

@djaglowski djaglowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @armstrmi

@djaglowski djaglowski merged commit c912ec5 into open-telemetry:main May 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants